Loading....
Postgres is looking for a checkpoint record in the transaction log that probably doesn't exist or is corrupted.
Using pg_resetwal may fix it. Keep in mind this is the last attempt, You can not recover data by Point In Time Recovery after reset wal
time=2020-09-21 02:32:27 UTC; pid=1; LOG: listening on IPv4 address "0.0.0.0", port 5432
time=2020-09-21 02:32:27 UTC; pid=1; LOG: listening on IPv6 address "::", port 5432
time=2020-09-21 02:32:27 UTC; pid=1; LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
time=2020-09-21 02:32:27 UTC; pid=20; LOG: database system was interrupted; last known up at 2020-09-20 08:19:14 UTC
time=2020-09-21 02:32:29 UTC; pid=20; LOG: invalid primary checkpoint record
time=2020-09-21 02:32:29 UTC; pid=20; PANIC: could not locate a valid checkpoint record
time=2020-09-21 02:32:29 UTC; pid=1; LOG: startup process (PID 20) was terminated by signal 6: Aborted
time=2020-09-21 02:32:29 UTC; pid=1; LOG: aborting startup due to startup process failure
time=2020-09-21 02:32:29 UTC; pid=1; LOG: database system is shut down
Add follow line in docker-compose.yml, make sure the user is : postgres and add this cmd to docker-compose.yml file
su - postgres -c "pg_resetwal /var/lib/postgresql/data"
And make sure you remove pg_resetwal cmd after container re-instance
time=2020-09-21 02:49:29 UTC; pid=1; LOG: listening on IPv4 address "0.0.0.0", port 5432
time=2020-09-21 02:49:29 UTC; pid=1; LOG: listening on IPv6 address "::", port 5432
time=2020-09-21 02:49:29 UTC; pid=1; LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
time=2020-09-21 02:49:29 UTC; pid=12; LOG: database system was shut down at 2020-09-21 02:49:17 UTC
time=2020-09-21 02:49:29 UTC; pid=1; LOG: database system is ready to accept connections