Failed archive command with Remote Recovery

979 views
Skip to first unread message

Ruud Zonnenberg

unread,
Apr 24, 2015, 7:57:10 AM4/24/15
to pgba...@googlegroups.com
Hey everyone,

I'm trying to use remote recovery but am running into a problem. I'm using the following command to recover the database: 

barman recover main 20150403T133807 /etc/postgresql/9.3/main/ --remote-ssh-command "ssh postgres@sunspear"


Which yields the following message:
Using safe horizon time for smart rsync copy: 2015-04-03 13:38:08.074545+02:00
Copying the base backup.
Copying required wal segments.
Generating archive status files
Disabling dangerous settings in destination directory.
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)

Recovery completed successful.

So everything seems to work! Great! However, nothing had been restored so I went looking for a solution which led met to the following link. Seem pretty similar to my problem. So I tried the solution provided by Xavier C which gives me the following error:

2015-04-24 13:54:42 CEST LOG:  archive command failed with exit code 1
2015-04-24 13:54:42 CEST DETAIL:  The failed archive command was: false
2015-04-24 13:54:43 CEST LOG:  archive command failed with exit code 1
2015-04-24 13:54:43 CEST DETAIL:  The failed archive command was: false
2015-04-24 13:54:44 CEST LOG:  archive command failed with exit code 1
2015-04-24 13:54:44 CEST DETAIL:  The failed archive command was: false
2015-04-24 13:54:44 CEST WARNING:  archiving transaction log file "000000010000000000000019" failed too many times, will try again later

Does anyone know what's going wrong here? I would greatly appreciate any help!

Regard,
Ruud

Extra info:
barman status main:
main:
Description: Main DB - Sunspear
PostgreSQL version: 9.3.6
pgespresso extension: Not available
PostgreSQL Data directory: /var/lib/postgresql/9.3/main
PostgreSQL 'archive_command' setting: false
Last archived WAL: 000000010000000000000017.00000028.backup
Current WAL segment: 00000001000000000000001D
Retention policies: not enforced
No. of available backups: 3
First available backup: 20150327T152534
Last available backup: 20150403T133807
Minimum redundancy requirements: satisfied (3/1)


barman diagnose:
{
    "global": {
        "config": {
            "barman_home": "/var/lib/barman", 
            "barman_user": "barman", 
            "log_file": "/var/log/barman/barman.log"
        }, 
        "system_info": {
            "barman_ver": "1.4.0", 
            "kernel_ver": "Linux lemonwood 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux", 
            "python_ver": "Python 2.7.6", 
            "release": "Distributor ID:\tUbuntu\nDescription:\tUbuntu 14.04.2 LTS\nRelease:\t14.04\nCodename:\ttrusty", 
            "rsync_ver": "rsync  version 3.1.0  protocol version 31", 
            "ssh_ver": "OpenSSH_6.6.1p1 Ubuntu-2ubuntu2, OpenSSL 1.0.1f 6 Jan 2014"
        }
    }, 
    "servers": {
        "main": {
            "backups": {
                "20150327T152534": {
                    "backup_id": "20150327T152534", 
                    "backup_label": "None", 
                    "begin_offset": "40", 
                    "begin_time": "Fri Mar 27 15:25:34 2015", 
                    "begin_wal": "000000010000000000000012", 
                    "begin_xlog": "0/12000028", 
                    "config_file": "/etc/postgresql/9.3/main/postgresql.conf", 
                    "deduplicated_size": null, 
                    "end_offset": "184", 
                    "end_time": "Fri Mar 27 15:25:44 2015", 
                    "end_wal": "000000010000000000000012", 
                    "end_xlog": "0/120000B8", 
                    "error": null, 
                    "hba_file": "/etc/postgresql/9.3/main/pg_hba.conf", 
                    "ident_file": "/etc/postgresql/9.3/main/pg_ident.conf", 
                    "mode": "default", 
                    "pgdata": "/var/lib/postgresql/9.3/main", 
                    "server_name": "main", 
                    "size": 25998550, 
                    "status": "DONE", 
                    "tablespaces": null, 
                    "timeline": 1, 
                    "version": 90306
                }, 
                "20150403T131631": {
                    "backup_id": "20150403T131631", 
                    "backup_label": "None", 
                    "begin_offset": "40", 
                    "begin_time": "Fri Apr  3 13:16:31 2015", 
                    "begin_wal": "000000010000000000000015", 
                    "begin_xlog": "0/15000028", 
                    "config_file": "/etc/postgresql/9.3/main/postgresql.conf", 
                    "deduplicated_size": 25999396, 
                    "end_offset": "184", 
                    "end_time": "Fri Apr  3 13:16:47 2015", 
                    "end_wal": "000000010000000000000015", 
                    "end_xlog": "0/150000B8", 
                    "error": null, 
                    "hba_file": "/etc/postgresql/9.3/main/pg_hba.conf", 
                    "ident_file": "/etc/postgresql/9.3/main/pg_ident.conf", 
                    "mode": "default", 
                    "pgdata": "/var/lib/postgresql/9.3/main", 
                    "server_name": "main", 
                    "size": 25999396, 
                    "status": "DONE", 
                    "tablespaces": null, 
                    "timeline": 1, 
                    "version": 90306
                }, 
                "20150403T133807": {
                    "backup_id": "20150403T133807", 
                    "backup_label": "None", 
                    "begin_offset": "40", 
                    "begin_time": "Fri Apr  3 13:38:08 2015", 
                    "begin_wal": "000000010000000000000017", 
                    "begin_xlog": "0/17000028", 
                    "config_file": "/etc/postgresql/9.3/main/postgresql.conf", 
                    "deduplicated_size": 26165400, 
                    "end_offset": "184", 
                    "end_time": "Fri Apr  3 13:38:28 2015", 
                    "end_wal": "000000010000000000000017", 
                    "end_xlog": "0/170000B8", 
                    "error": null, 
                    "hba_file": "/etc/postgresql/9.3/main/pg_hba.conf", 
                    "ident_file": "/etc/postgresql/9.3/main/pg_ident.conf", 
                    "mode": "default", 
                    "pgdata": "/var/lib/postgresql/9.3/main", 
                    "server_name": "main", 
                    "size": 26165400, 
                    "status": "DONE", 
                    "tablespaces": null, 
                    "timeline": 1, 
                    "version": 90306
                }
            }, 
            "config": {
                "active": true, 
                "backup_directory": "/var/lib/barman/main", 
                "backup_options": "exclusive_backup", 
                "bandwidth_limit": null, 
                "barman_home": "/var/lib/barman", 
                "basebackup_retry_sleep": 30, 
                "basebackup_retry_times": 0, 
                "basebackups_directory": "/var/lib/barman/main/base", 
                "compression": null, 
                "conninfo": "host=sunspear user=postgres", 
                "custom_compression_filter": null, 
                "custom_decompression_filter": null, 
                "description": "Main DB - Sunspear", 
                "immediate_checkpoint": false, 
                "incoming_wals_directory": "/var/lib/barman/main/incoming", 
                "last_backup_maximum_age": null, 
                "lock_file": "/var/lib/barman/main/main.lock", 
                "minimum_redundancy": 1, 
                "name": "main", 
                "network_compression": false, 
                "post_archive_script": null, 
                "post_backup_script": null, 
                "pre_archive_script": null, 
                "pre_backup_script": null, 
                "retention_policy": null, 
                "retention_policy_mode": "auto", 
                "reuse_backup": null, 
                "ssh_command": "ssh postgres@sunspear", 
                "tablespace_bandwidth_limit": null, 
                "wal_retention_policy": "main", 
                "wals_directory": "/var/lib/barman/main/wals"
            }, 
            "status": {
                "archive_command": "false", 
                "archive_mode": "on", 
                "config_file": "/etc/postgresql/9.3/main/postgresql.conf", 
                "current_xlog": "00000001000000000000001B", 
                "data_directory": "/var/lib/postgresql/9.3/main", 
                "hba_file": "/etc/postgresql/9.3/main/pg_hba.conf", 
                "ident_file": "/etc/postgresql/9.3/main/pg_ident.conf", 
                "last_archived_wal": "000000010000000000000017.00000028.backup", 
                "pgespresso_installed": false, 
                "server_txt_version": "9.3.6"
            }, 
            "system_info": {
                "kernel_ver": "Linux sunspear 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux", 
                "python_ver": "Python 2.7.6", 
                "release": "Distributor ID:\tUbuntu\nDescription:\tUbuntu 14.04.2 LTS\nRelease:\t14.04\nCodename:\ttrusty", 
                "rsync_ver": "rsync  version 3.1.0  protocol version 31", 
                "ssh_ver": "OpenSSH_6.6.1p1 Ubuntu-2ubuntu2, OpenSSL 1.0.1f 6 Jan 2014"
            }
        }
    }
}



MP

unread,
Apr 28, 2015, 7:56:00 AM4/28/15
to pgba...@googlegroups.com
Comment out archive_command. Barman is changing its syntax and Postgres has problem with it.

Dne pátek 24. dubna 2015 13:57:10 UTC+2 Ruud Zonnenberg napsal(a):
Message has been deleted

Ruud Zonnenberg

unread,
May 1, 2015, 3:48:29 AM5/1/15
to pgba...@googlegroups.com
Thanks for the reply. Does that mean that my archive_command ('rsync etc etc...') is faulty?

'rsync -a %p barman@lemonwood:/var/lib/barman/main/incoming/%f --protocol=26'
Message has been deleted

Ruud Zonnenberg

unread,
May 8, 2015, 2:25:36 AM5/8/15
to pgba...@googlegroups.com
Unfortunately this doesn't help the problem and I still get the error. Any other suggestions?


On Tuesday, April 28, 2015 at 1:56:00 PM UTC+2, MP wrote:
Reply all
Reply to author
Forward
0 new messages