Re: archive_command fails but works outside of Postgres

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: twoflower <standa(dot)kurik(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: archive_command fails but works outside of Postgres
Date: 2017-08-18 19:45:11
Message-ID: 20170818194511.czfx4qdvsglx4yh3@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Scott Marlowe wrote:
> On Fri, Aug 18, 2017 at 12:40 PM, twoflower <standa(dot)kurik(at)gmail(dot)com> wrote:
> > I changed my archive_command to the following:
> >
> > archive_command = 'gsutil cp /storage/postgresql/9.6/main/%p
> > gs://my_bucket/pg_xlog/'

> > 2017-08-18 18:34:25.057 GMT [1436][0]: [104321] WARNING: archiving
> > transaction log file "000000010000038B000000D8" failed too many times, will
> > try again later

> Sounds like it depends on some envvar it doesn't see when run from the
> postmaster. If you sudo -u postgres and run it does it work?

I saw one installation with "gsutil cp" in archive_command recently. It
had the CLOUDSDK_PYTHON environment variable set in the archive_command
itself. Maybe that's a problem.

Another possible problem might be the lack of %f (this command seems to
rely on the file being the same name at the other end, which isn't
necessarily so) and the fact that %p is supposed to be the path of the
file, so you shouldn't qualify it with the full path.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mark Watson 2017-08-18 19:46:34 Re: archive_command fails but works outside of Postgres
Previous Message Scott Marlowe 2017-08-18 19:27:23 Re: archive_command fails but works outside of Postgres