PostgreSQL archive process failed on

postgresql

I upgraded a cluster from 8.3 to 8.4. Things seemed to be fine so I dropped the 8.3 cluster. Then noticed an error and found that the archive_command was still pointing to the 8.3 data directory

archive_command = 'cp "%p" /var/lib/postgresql/8.3/main/wal_archives/"%f"'

I changed this to 8.4 but now continually get the following errors in the log file and process list for one specific file

2014-10-09 17:02:12 CDT DETAIL:  The failed archive command was: cp "pg_xlog/000000010000000000000012" /var/lib/postgresql/8.4/main/wal_archives/"000000010000000000000012"
cp: cannot create regular file `/var/lib/postgresql/8.4/main/wal_archives/000000010000000000000012': No such file or directory
 4122 ?        Ss     0:00  \_ postgres: archiver process   failed on 000000010000000000000012

I'm not sure the best way to recover from this. As far as I can tell the database is fully functional

Best Answer

Check to ensure that /var/lib/postgresql/8.4/main/wal_archives exists.

You will also want to ensure it's writeable by the postgres user, though if this was a permissions problem the error would be different.