We just released our second eBook: "The Most Important Events to Monitor in Your Postgres Logs"Download Now

W52: Archive command failed

Category: WAL & Checkpoint Events
SQLSTATE: n/a
Urgency: medium

Example Postgres Log Output:

LOG: archive command failed with exit code 1
DETAIL: The failed archive command was: /etc/rds/dbbin/pgscripts/rds_wal_archive pg_xlog/0000000100025DFA00000023
FATAL: archive command was terminated by signal 6: Abort trap
DETAIL: The failed archive command was: /usr/local/bin/envdir /usr/local/etc/wal-e.d/env /usr/local/bin/wal-e wal-push pg_xlog/000000040000023B000000CC
LOG:  archiver process (PID 5886) exited with exit code 1

Explanation:

PostgreSQL failed to archive a WAL file, as the configured archive_command exited with a non-zero exit code, or the program got terminated.

This typically occurs because of a problem with the program you are using for archiving / backups, and you will need to check its log files to determine what exactly happened.

Note that this can be a problematic situation, as Postgres has to retain all WAL files it could not archive, regardless of any max_wal_size you might have configured.

That means if you do not resolve this failure (and make archive_command complete successfully for the failed segments), you will eventually run out of disk on your WAL partition.

Recommended Action:

Investigate the underlying failure in the log files of your backup program.

If you are okay with not having reliable backups and potentially missing a file, in order to avoid running out of disk space you can also temporarily change your configuration to archive_command = /bin/true which will make Postgres succeed at archiving all WAL files.

Note in the case of the WAL file not being copied correctly, you are highly advised to make a new base backup after the situation has been resolved.

Learn More:

No additional resources available.


Couldn't find what you were looking for or want to talk about something specific?
Start a conversation with us →