Re: [GENERAL] archive_command fails but works outside of Postgres - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: [GENERAL] archive_command fails but works outside of Postgres
Date
Msg-id 20170818194511.czfx4qdvsglx4yh3@alvherre.pgsql
Whole thread Raw
In response to Re: [GENERAL] archive_command fails but works outside of Postgres  (Scott Marlowe <scott.marlowe@gmail.com>)
Responses Re: [GENERAL] archive_command fails but works outside of Postgres  (twoflower <standa.kurik@gmail.com>)
Re: [GENERAL] archive_command fails but works outside of Postgres  (twoflower <standa.kurik@gmail.com>)
List pgsql-general
Scott Marlowe wrote:
> On Fri, Aug 18, 2017 at 12:40 PM, twoflower <standa.kurik@gmail.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


pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: [GENERAL] archive_command fails but works outside of Postgres
Next
From: Mark Watson
Date:
Subject: Re: [GENERAL] archive_command fails but works outside of Postgres