Can't restart Postgres after recovery. Posgres returns: could not locate required checkpoint record

989 views
Skip to first unread message

Corine Morin

unread,
Oct 23, 2016, 2:12:37 PM10/23/16
to Barman, Backup and Recovery Manager for PostgreSQL
Hi,

   I created a backup with Barman, and changed some data inside my database and then tried to run the recovery

------------------------------------------------------------------------------------------------------------

Terminal>barman recover --remote-ssh-command "ssh postgres@localhost" local-vm latest /var/lib/postgresql/9.3/main
Starting remote restore for server local-vm using backup 20161021T233002
Destination directory: /var/lib/postgresql/9.3/main
Copying the base backup.
Copying required wal segments.
The archive_command was set to 'false' to prevent data losses.

Your PostgreSQL server has been successfully prepared for recovery!

Please review network and archive related settings in the PostgreSQL
configuration file before starting the just recovered instance.

WARNING: Before starting up the recovered PostgreSQL server,
please review also the settings of the following configuration
options as they might interfere with your current recovery attempt:

    data_directory = '/var/lib/postgresql/9.3/main'            # use data in another directory
    external_pid_file = '/var/run/postgresql/9.3-main.pid'             # write an extra PID file
    hba_file = '/etc/postgresql/9.3/main/pg_hba.conf'      # host-based authentication file
    ident_file = '/etc/postgresql/9.3/main/pg_ident.conf'          # ident configuration file
    ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem'             # (change requires restart)
    ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key'            # (change requires restart)

------------------------------------------------------------------------------------------------------------


After that I restart my postgres:
Terminal>sudo service postgresql start
 * Starting PostgreSQL 9.3 database server            * The PostgreSQL server failed to start. Please check the log output:
2016-10-22 00:11:25 EDT LOG:  database system was interrupted; last known up at 2016-10-21 23:30:02 EDT
2016-10-22 00:11:26 EDT LOG:  incomplete startup packet
2016-10-22 00:11:26 EDT FATAL:  the database system is starting up
2016-10-22 00:11:26 EDT LOG:  invalid checkpoint record
2016-10-22 00:11:26 EDT FATAL:  could not locate required checkpoint record
2016-10-22 00:11:26 EDT HINT:  If you are not restoring from a backup, try removing the file "/var/lib/postgresql/9.3/main/backup_label".
2016-10-22 00:11:26 EDT LOG:  startup process (PID 13585) exited with exit code 1
2016-10-22 00:11:26 EDT LOG:  aborting startup due to startup process failure
                                              [fail]


Here are my 2 questions:
Question1: Why can cause the WARNING messages when I run recover, how can I remove this?
Question2: Any idea why postgres can't restart after recovery...
Question3: what is the error: could not locate required checkpoint record?

Your input will be appreciated!

Giulio Calacoci

unread,
Nov 9, 2016, 3:53:51 PM11/9/16
to pgbarman
Hi Corine,

First of all, sorry for the late response, don't know how but I have
missed this email.

Ok, so, that WARNING message is there because we want you to review
your config file after the restore.
Barman identifies the presence of some that some configuration option
could be an issue
(that's why barman suggests you to review them.)

Just a question, which version of barman are you using?

On the restart of postgres: is PostgreSQL able to retrieve all the config files?
Have you tried to start PostgreSQL using the pg_ctl command with the
-D option, pointing it to your restored postgres data dir?

Regards
Giulio
> --
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.



--
Giulio Calacoci - 2ndQuadrant Italia
PostgreSQL Training, Services and Support
giulio....@2ndQuadrant.it | www.2ndQuadrant.it
Reply all
Reply to author
Forward
0 new messages