Environment
PostgreSQL 13 primary on Debian 11; archive_mode=on; archive_command calls a shell script that scp WAL files to remote archiver. Script runs as postgres user, uses ssh key in /var/lib/postgresql/.ssh, remote host reachable via corporate WAN. Observed during nightly bulk loads.
Symptoms
WAL files stop being archived; primary logs show repeated WARNING: archive command failed with exit code 75, archiver process sleeping for 60 seconds. Replica lag grows; disk on primary starts filling with WAL. The scp/ssh endpoint is reachable from other hosts and filesystem on the primary has free space.
Observations
Postgres log entries show 'archive command failed with exit code 75' at times matching the bulk load bursts. Running the archive script manually as the postgres user succeeds. strace on postgres process not possible in prod. File permissions on /var/lib/postgresql/.ssh/id_rsa are 600 and owned by postgres. The script uses /bin/bash -l -c 'scp ...' via sudo in some older configs.
Already attempted
Restarted postgresql service (temporary archival resumed then failed again); ran the archive script manually as postgres and it worked. Switched archive_command to a simpler psql-friendly 'test-wal && scp' wrapper temporarily; still saw intermittent exit 75 from PostgreSQL. Increased logging verbosity for archive_command but logs only show exit code.
Question
What causes PostgreSQL's archive_command to return 75 intermittently despite the script working when run manually, and how to prevent WAL pileup safely?
Verified community troubleshooting
No answers yet..
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags
- Databases38% match
PostgreSQL WAL archiving stalls during pg_basebackup when archive_command uses rsync over SSH
Open0 answers - Databases37% match
PostgreSQL WAL archiving fails with 'archive_command' permission denied after automated logrotate changed owner
Open0 answers - Databases37% match
PostgreSQL replica accumulates WAL and stalls after archive_command ownership changed during maintenance
Open0 answers - Databases33% match
Primary PostgreSQL WAL directory fills after interrupted base backup and failing archive_command
Open0 answers - Databases33% match
PostgreSQL standby stops applying WAL during long-running transactions on primary after pg_basebackup restore
Open0 answers