Succesful restore but: ERROR: WAL file '00000002.history' not found in server

2,135 views
Skip to first unread message

puppycock

unread,
Apr 18, 2021, 3:36:37 PM4/18/21
to Barman, Backup and Recovery Manager for PostgreSQL
Hello, after having run barman server for 4 days I decided to check if the backup works by setting up a staging server and restoring the backup to it, here's the command I ran from barman:

barman recover --remote-ssh-command "ssh post...@192.168.1.207" --get-wal --jobs 2 postgresqlserver 20210414T130010 /var/lib/postgresql/13/main

After it finished this is the command found in postgresql.auto.conf in the staging server:

restore_command = 'barman-wal-restore -P -U barman 192.168.1.199 postgresqlserver %f %p'

I fired up postgresql on the staging server and the log showed everything normal until the end:

cat /var/log/postgresql/postgresql-13-main.log

2021-04-18 13:15:24.321 CDT [8554] LOG:  restored log file "000000010000001B000000CD" from archive
2021-04-18 13:15:25.407 CDT [8554] LOG:  restored log file "000000010000001B000000CE" from archive
2021-04-18 13:15:25.435 CDT [8554] LOG:  invalid record length at 1B/CE548BA0: wanted 24, got 0
2021-04-18 13:15:25.435 CDT [8554] LOG:  redo done at 1B/CE548B78
2021-04-18 13:15:25.435 CDT [8554] LOG:  last completed transaction was at log time 2021-04-18 13:15:24.914658-05
2021-04-18 13:15:26.385 CDT [8554] LOG:  restored log file "000000010000001B000000CE" from archive
ERROR: WAL file '00000002.history' not found in server 'postgresqlserver' (SSH host: 192.168.1.207)
ERROR: Remote 'barman get-wal' command has failed!
2021-04-18 13:15:27.131 CDT [8554] LOG:  selected new timeline ID: 2
2021-04-18 13:15:27.157 CDT [8554] LOG:  archive recovery complete
ERROR: WAL file '00000001.history' not found in server ' postgresqlserver  ' (SSH host: 192.168.1.207)
ERROR: Remote 'barman get-wal' command has failed!
2021-04-18 13:15:28.548 CDT [8553] LOG:  database system is ready to accept connections

The restored database seems to have all the data it should and apart from those errors it seems to be working fine, but this was only a test and I want to know that in case of a real recovery the backup will work.

Abhijit Menon-Sen

unread,
Jul 30, 2021, 12:23:29 AM7/30/21
to pgba...@googlegroups.com
On Mon, Apr 19, 2021 at 1:06 AM puppycock <pupp...@gmail.com> wrote:
>
> 2021-04-18 13:15:24.321 CDT [8554] LOG: restored log file "000000010000001B000000CD" from archive
> 2021-04-18 13:15:25.407 CDT [8554] LOG: restored log file "000000010000001B000000CE" from archive
> 2021-04-18 13:15:25.435 CDT [8554] LOG: invalid record length at 1B/CE548BA0: wanted 24, got 0
> 2021-04-18 13:15:25.435 CDT [8554] LOG: redo done at 1B/CE548B78
> 2021-04-18 13:15:25.435 CDT [8554] LOG: last completed transaction was at log time 2021-04-18 13:15:24.914658-05
> 2021-04-18 13:15:26.385 CDT [8554] LOG: restored log file "000000010000001B000000CE" from archive
> ERROR: WAL file '00000002.history' not found in server 'postgresqlserver' (SSH host: 192.168.1.207)
> ERROR: Remote 'barman get-wal' command has failed!
> 2021-04-18 13:15:27.131 CDT [8554] LOG: selected new timeline ID: 2
> 2021-04-18 13:15:27.157 CDT [8554] LOG: archive recovery complete
> ERROR: WAL file '00000001.history' not found in server ' postgresqlserver ' (SSH host: 192.168.1.207)
> ERROR: Remote 'barman get-wal' command has failed!
> 2021-04-18 13:15:28.548 CDT [8553] LOG: database system is ready to accept connections
>
> The restored database seems to have all the data it should and apart from those errors it seems to be working fine, but this was only a test and I want to know that in case of a real recovery the backup will work.

Yes, this is fine, it's normal for Postgres to probe for the existence
of .history files, and it's normal to not find them and carry on. If
it had been a "real" problem, Postgres would have refused to start.

-- Abhijit
Reply all
Reply to author
Forward
0 new messages