archive_command fails but works outside of Postgres

From: twoflower <standa(dot)kurik(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: archive_command fails but works outside of Postgres
Date: 2017-08-18 18:40:28
Message-ID: 1503081628787-5979040.post@n3.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I changed my archive_command to the following:
archive_command = 'gsutil cp /storage/postgresql/9.6/main/%p
gs://my_bucket/pg_xlog/'
and it fails, leaving the following in the log:

2017-08-18 18:34:25.057 GMT [1436][0]: [104319] LOG: archive command failed
with exit code 12017-08-18 18:34:25.057 GMT [1436][0]: [104320] DETAIL: The
failed archive command was: gsutil cp
/storage/postgresql/9.6/main/000000010000038B000000D8
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

But the command works when executed manually:
root$ su postgres -c "gsutil cp
/storage/postgresql/9.6/main/000000010000038B000000D8
gs://my_bucket/pg_xlog/"root$ echo $?0
The last command verifies that gsutil indeed exited with 0.

How to best debug this issue?

--
View this message in context: http://www.postgresql-archive.org/archive-command-fails-but-works-outside-of-Postgres-tp5979040.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Igor Korot 2017-08-18 18:45:40 Re: Results interpretation
Previous Message Scott Marlowe 2017-08-18 18:25:30 Re: make postgresql 9.5 default on centos 7