barman-cloud-wal-restore failed

22 views
Skip to first unread message

Julián Panzitta

unread,
Apr 26, 2022, 1:41:17 PM4/26/22
to Barman, Backup and Recovery Manager for PostgreSQL
I'm trying to recover a database from s3 bucket, and it fails

I followed the steps of the configuration indicated in the blog, executed the previous command correctly, and finally the command; barman-cloud-restore finished successfully. 

I setup restore_command in recovery.conf and then got the following error when starting PostgreSQL 11 ( the wals are on the s3)


My recovery.conf file contains:
restore_command = ‘barman-cloud-wal-restore -P barman-cloud s3://barman/ pg11 %f %p’
recovery_target_timeline = ‘latest’

Error (database log)
< 2022-04-05 22:25:49.208 -03 1 > LOG: the database system was interrupted; last time in operation on 2022-03-23 20:18:01 -03
< 2022-04-05 22:25:49.209 -03 2 > LOG: creating missing WAL directory "pg_wal/archive_status"
< 2022-04-05 22:25:49.362 -03 3 > LOG: checkpoint log is invalid
< 2022-04-05 22:25:49.362 -03 4 > FATAL: Could not locate required checkpoint record
< 2022-04-05 22:25:49.362 -03 5 > HINT: If you are not restoring a backup, try removing "/data/data5432/backup_label".
< 2022-04-05 22:25:49.363 -03 7 > LOG: startup process (PID 3511) terminated with exit code 1
< 2022-04-05 22:25:49.363 -03 8 > LOG: aborting boot due to boot processing failure
< 2022-04-05 22:25:49.365 -03 9 > LOG: Database system is down

Can anyone help me?

Michael Wallace

unread,
Apr 27, 2022, 5:54:58 AM4/27/22
to pgba...@googlegroups.com
It looks like PostgreSQL is unable to restore the recovery checkpoint from the WAL archive. This could be for a number of reasons so it's worth checking the following:

1. Is the required WAL file present in the archive?

Take a look at the contents of PGDATA/backup_label, specifically the START_WAL_LOCATION line - it should tell you which WAL file contains START_WAL_LOCATION.
Verify that this WAL exists in the s3 bucket referenced by the `barman-cloud-wal-restore` command.

2. Is barman-cloud-wal-restore able to find and download WALs successfully?

The PostgreSQL logs don't tell you much if anything went wrong while running `barman-cloud-wal-restore` so it's worth manually running it as the postgres user to verify it completes successfully. Use the WAL file name from the previous step and add `-vv` to the command for maximum verbosity.

Hopefully this should give you a bit more information about what is going wrong.

--
--
You received this message because you are subscribed to the "Barman for PostgreSQL" group.
To post to this group, send email to pgba...@googlegroups.com
To unsubscribe from this group, send email to
pgbarman+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/pgbarman?hl=en?hl=en-GB

---
You received this message because you are subscribed to the Google Groups "Barman, Backup and Recovery Manager for PostgreSQL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pgbarman+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/pgbarman/787780c7-d1f3-49f0-b4a5-a2ef1ba895cen%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages