Re: failed archive command

From: Joe Lester <joe_lester(at)mac(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: failed archive command
Date: 2011-07-08 03:15:43
Message-ID: 9C242AB9-8D4B-4E1D-ADAA-89E26FDF4840@mac.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I tried to use only %p to specify the path, but it does not seem to output the full path according to the server log. It only starts at /pg_xlog:

archive_command = '/usr/bin/scp -B "%p" postgres(at)172(dot)20(dot)204(dot)55:/Volumes/DataDrive/wals_from_master/%f'

DETAIL: The failed archive command was: /usr/bin/scp -B "pg_xlog/000000010000007400000086" postgres(at)172(dot)20(dot)204(dot)55:/Volumes/DataDrive/wals_from_master/000000010000007400000086

Also, if I specify the full path (like I was doing before) and execute the scp command as the postgres user on the master, it works (see output below). So I don't understand why it's not working when the postgres server tries to execute the same command.

mybox:~ admin$ su postgres
Password:
bash-3.2$ /usr/bin/scp -B /Volumes/DataDrive/data/pg_xlog/000000010000007400000086 postgres(at)172(dot)20(dot)204(dot)55:/Volumes/DataDrive/wals_from_master/000000010000007400000086
000000010000007400000086 100% 16MB 16.0MB/s 00:01
bash-3.2$

> %p is expanded to the *full* path, so /Volumes/DataDrive/data/%p might
> not be the correct. I'd use just %p instead of it.
>> I'm trying to setup wal archiving to a secondary computer on OSX 10.6.5 using postgres 9.0.3.
>>
>> Here are my settings in postgresql.conf on the primary box:
>>
>> wal_level = archive
>> archive_mode = on
>> max_wal_senders = 1
>> archive_command = '/usr/bin/scp -B /Volumes/DataDrive/data/%p postgres(at)172(dot)20(dot)204(dot)55:/Volumes/DataDrive/wals_from_master/%f'
>>
>> The problem is that I keep getting the following message over and over again in the postgres log:
>>
>> FATAL: archive command failed with exit code 255
>> DETAIL: The failed archive command was: /usr/bin/scp -B /Volumes/DataDrive/data/pg_xlog/000000010000007400000086 postgres(at)172(dot)20(dot)204(dot)55:/Volumes/DataDrive/wals_from_master/000000010000007400000086
>> LOG: archiver process (PID 17771) exited with exit code 1
>> unknown user 502
>>
>> The archive command works if I copy and paste it into the Terminal under the postgres user. Any pointers as to what I'm doing wrong? Thanks.

Browse pgsql-general by date

  From Date Subject
Next Message Darren Duncan 2011-07-08 03:56:34 Re: Creating temp tables inside read only transactions
Previous Message Dr. Tingrong Lu 2011-07-08 00:39:29 Re: Add Foreign Keys To Table