PostgreSQL Service Unable to Start After Archive Log delete
PostgreSQL Service Unable to Start After Archive Log delete
От:
loganathan P <plogandba@gmail.com>
Дата:
Dear All,
Unfortunately, the OS housekeeping activity has been performed, and all archive log files has been deleted from both the archive log and pg_wal locations. We attempted to start the service, but it is unable to start due to the error shown below. Please provide the solution.
starting PostgreSQL 15.18 on x86_64-pc-linux-gun, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-28), 64-bit
listening on IPv4 address "192.168.56.15", port 5423
listening on Unix socket "var/run/postgresql/.s.PGSQL.5423"
listening on Unix socket "/tmp/ .s.PGSQL.5423"
database system was shut down in recovery at 2026-09-10 11:10:40 IST
invalid primary checkpoint record
PANIC: could not locate a valid checkpoint record
startup process (PID 1031317) was terminated by signal 6: Aborted
terminating any other active sever processes
shutting down due to startup process failure
database system is shut down
listening on IPv4 address "192.168.56.15", port 5423
listening on Unix socket "var/run/postgresql/.s.PGSQL.5423"
listening on Unix socket "/tmp/ .s.PGSQL.5423"
database system was shut down in recovery at 2026-09-10 11:10:40 IST
invalid primary checkpoint record
PANIC: could not locate a valid checkpoint record
startup process (PID 1031317) was terminated by signal 6: Aborted
terminating any other active sever processes
shutting down due to startup process failure
database system is shut down
Thanks.
Regards,
Loganathan P
Re: PostgreSQL Service Unable to Start After Archive Log delete
От:
Justin <zzzzz.graf@gmail.com>
Дата:
On Thu, Sep 10, 2026 at 11:02 AM Oli Sennhauser <oli.sennhauser@fromdual.com> wrote:
Hi Loganathan
I am a complete PostgreSQL noob! Reading the manual (after googling) I found this: https://www.postgresql.org/docs/current/app-pgresetwal.html
When I tried to simulate your situation I ended up with this:
Loganathan, and Oli.
Yes you can use pg_resetwal to get PG to start to get more records that would be lost otherwise.
CAN NOT STRESS THIS ENOUGH using pg_resetwal is the last ditch option after exploring all other options. Use this to fetch what data can be fetched. DO NOT USE a database that has used pg_resetwal for any other activity other than getting missing records.
make a backup of the database before executing pg_walreset. There are other options to get the data out of the PostgreSQL tables but the catalog has to be intact. pg_class, pg_attribute, pg_type. loose those tables the database is toast
Would like to see the DR and backup methods that was being used. If normal housekeeping included purging WAL directories there is a very big disconnect between the sysadmins and dbas
Best of luck