receive-wal reports invalid WAL file size

692 views
Skip to first unread message

hay...@playerdata.co.uk

unread,
Jun 8, 2018, 12:34:50 PM6/8/18
to Barman, Backup and Recovery Manager for PostgreSQL
Hello all.

I've recently set up barman using streaming as the backup method.
After a day or so of running barman has now started failing, and I've no idea as to how to recover it (I'm probably just missing something that's in the documentation).

Barman check reports receive-wal isn't running:

barman check postgres-master
Server postgres-master:
PostgreSQL: OK
is_superuser: OK
PostgreSQL streaming: OK
wal_level: OK
replication slot: FAILED (slot 'barman' not active: is 'receive-wal' running?)
directories: OK
retention policy settings: OK
backup maximum age: OK (no last_backup_maximum_age provided)
compression settings: OK
failed backups: OK (there are 0 failed backups)
minimum redundancy requirements: OK (have 1 backups, expected at least 1)
pg_basebackup: OK
pg_basebackup compatible: OK
pg_basebackup supports tablespaces mapping: OK
pg_receivexlog: OK
pg_receivexlog compatible: OK
receive-wal running: FAILED (See the Barman log file for more details)
archiver errors: OK

If I attempt to start receive-wal myself, I receive the following error:

barman receive-wal postgres-master
Starting receive-wal for server postgres-master
postgres-master: pg_receivewal: starting log streaming at 1D/C3000000 (timeline 1)
postgres-master: pg_receivewal: write-ahead log file "000000010000001D000000C3.partial" has 131072 bytes, should be 0 or 16777216
postgres-master: pg_receivewal: disconnected
ERROR: ArchiverFailure:pg_receivexlog terminated with error code: 1

I've tried running `barman receive-wal postgres-master --reset`, but this hasn't helped at all.

Any help diagnosing this (or even skipping over it so I can get a working backup again) would be really appreciated.

Output of barman diagnose below:

barman diagnose
{
    "global": {
        "config": {
            "barman_home": "/var/lib/barman", 
            "barman_user": "barman", 
            "compression": "gzip", 
            "configuration_files_directory": "/etc/barman.d", 
            "errors_list": [], 
            "log_file": "/var/log/barman/barman.log", 
            "log_level": "INFO", 
            "minimum_redundancy": "1", 
            "retention_policy": "RECOVERY WINDOW OF 4 WEEKS"
        }, 
        "system_info": {
            "barman_ver": "2.4", 
            "kernel_ver": "Linux barman-0 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 GNU/Linux", 
            "python_ver": "", 
            "release": "Distributor ID:\tDebian\nDescription:\tDebian GNU/Linux 9.4 (stretch)\nRelease:\t9.4\nCodename:\tstretch", 
            "rsync_ver": "rsync  version 3.1.2  protocol version 31", 
            "ssh_ver": ""
        }
    }, 
    "servers": {
        "postgres-master": {
            "backups": {
                "20180523T142405": {
                    "backup_id": "20180523T142405", 
                    "backup_label": null, 
                    "begin_offset": 96, 
                    "begin_time": "Wed May 23 14:24:10 2018", 
                    "begin_wal": "000000010000000000000005", 
                    "begin_xlog": "0/5000060", 
                    "config_file": "/etc/postgresql/postgresql.conf", 
                    "copy_stats": {
                        "copy_time": 124.97895, 
                        "total_time": 124.97895
                    }, 
                    "deduplicated_size": 67112915, 
                    "end_offset": 70376, 
                    "end_time": "Wed May 23 14:26:10 2018", 
                    "end_wal": "000000010000000000000006", 
                    "end_xlog": "0/60112E8", 
                    "error": null, 
                    "hba_file": "/var/lib/postgresql/data/pg_hba.conf", 
                    "ident_file": "/var/lib/postgresql/data/pg_ident.conf", 
                    "included_files": null, 
                    "mode": "postgres", 
                    "pgdata": "/var/lib/postgresql/data", 
                    "server_name": "postgres-master", 
                    "size": 67112915, 
                    "status": "DONE", 
                    "tablespaces": null, 
                    "timeline": 1, 
                    "version": 100003, 
                    "xlog_segment_size": 16777216
                }
            }, 
            "config": {
                "active": true, 
                "archiver": false, 
                "archiver_batch_size": 0, 
                "backup_directory": "/var/lib/barman/postgres-master", 
                "backup_method": "postgres", 
                "backup_options": "concurrent_backup", 
                "bandwidth_limit": null, 
                "barman_home": "/var/lib/barman", 
                "barman_lock_directory": "/var/lib/barman", 
                "basebackup_retry_sleep": 30, 
                "basebackup_retry_times": 0, 
                "basebackups_directory": "/var/lib/barman/postgres-master/base", 
                "check_timeout": 30, 
                "compression": "gzip", 
                "conninfo": "host=postgres-master.database user=barman dbname=playerdata", 
                "custom_compression_filter": null, 
                "custom_decompression_filter": null, 
                "description": "Postgres Master", 
                "disabled": false, 
                "errors_directory": "/var/lib/barman/postgres-master/errors", 
                "immediate_checkpoint": false, 
                "incoming_wals_directory": "/var/lib/barman/postgres-master/incoming", 
                "last_backup_maximum_age": null, 
                "max_incoming_wals_queue": null, 
                "minimum_redundancy": 1, 
                "msg_list": [], 
                "name": "postgres-master", 
                "network_compression": false, 
                "parallel_jobs": 1, 
                "path_prefix": "/usr/pgsql-10/bin", 
                "post_archive_retry_script": null, 
                "post_archive_script": null, 
                "post_backup_retry_script": null, 
                "post_backup_script": null, 
                "post_delete_retry_script": null, 
                "post_delete_script": null, 
                "post_recovery_retry_script": null, 
                "post_recovery_script": null, 
                "post_wal_delete_retry_script": null, 
                "post_wal_delete_script": null, 
                "pre_archive_retry_script": null, 
                "pre_archive_script": null, 
                "pre_backup_retry_script": null, 
                "pre_backup_script": null, 
                "pre_delete_retry_script": null, 
                "pre_delete_script": null, 
                "pre_recovery_retry_script": null, 
                "pre_recovery_script": null, 
                "pre_wal_delete_retry_script": null, 
                "pre_wal_delete_script": null, 
                "recovery_options": "", 
                "retention_policy": "window 4 w", 
                "retention_policy_mode": "auto", 
                "reuse_backup": null, 
                "slot_name": "barman", 
                "ssh_command": null, 
                "streaming_archiver": true, 
                "streaming_archiver_batch_size": 0, 
                "streaming_archiver_name": "barman_receive_wal", 
                "streaming_backup_name": "postgres_master_backup", 
                "streaming_conninfo": "host=postgres-master.database user=barman dbname=playerdata", 
                "streaming_wals_directory": "/var/lib/barman/postgres-master/streaming", 
                "tablespace_bandwidth_limit": null, 
                "wal_retention_policy": "simple-wal 4 w", 
                "wals_directory": "/var/lib/barman/postgres-master/wals"
            }, 
            "status": {
                "config_file": "/etc/postgresql/postgresql.conf", 
                "connection_error": null, 
                "current_size": 1352108308.0, 
                "current_xlog": "000000010000001D000000C3", 
                "data_directory": "/var/lib/postgresql/data", 
                "hba_file": "/var/lib/postgresql/data/pg_hba.conf", 
                "ident_file": "/var/lib/postgresql/data/pg_ident.conf", 
                "is_in_recovery": false, 
                "is_superuser": true, 
                "pg_basebackup_bwlimit": true, 
                "pg_basebackup_compatible": true, 
                "pg_basebackup_installed": true, 
                "pg_basebackup_path": "/usr/bin/pg_basebackup", 
                "pg_basebackup_tbls_mapping": true, 
                "pg_basebackup_version": "10.4-2.pgdg90+1)", 
                "pg_receivexlog_compatible": true, 
                "pg_receivexlog_installed": true, 
                "pg_receivexlog_path": "/usr/bin/pg_receivewal", 
                "pg_receivexlog_supports_slots": true, 
                "pg_receivexlog_synchronous": false, 
                "pg_receivexlog_version": "10.4-2.pgdg90+1)", 
                "pgespresso_installed": false, 
                "replication_slot": [
                    "barman", 
                    false, 
                    "1D/C3000000"
                ], 
                "replication_slot_support": true, 
                "server_txt_version": "10.3", 
                "streaming": true, 
                "streaming_supported": true, 
                "synchronous_standby_names": [
                    ""
                ], 
                "systemid": "6558677718500028447", 
                "timeline": 1, 
                "wal_level": "logical", 
                "xlogpos": "1D/C3000140"
            }, 
            "wals": {
                "last_archived_wal_per_timeline": {
                    "00000001": {
                        "compression": "gzip", 
                        "name": "00000001000000150000005F", 
                        "size": 4097364, 
                        "time": 1527272535.628746
                    }
                }
            }
        }
    }
}

Regards,

Hayden

hay...@playerdata.co.uk

unread,
Jun 8, 2018, 1:30:03 PM6/8/18
to Barman, Backup and Recovery Manager for PostgreSQL
I got brave, and decided to remove barman's partial WAL

rm /var/lib/barman/postgres-master/streaming/000000010000001D000000C3.partial

... and now it seems happy again.

I'd quite like to know what was going on here though - this doesn't seem like it should be normal.

Chance Nursey-Bush

unread,
Sep 13, 2019, 6:01:45 PM9/13/19
to Barman, Backup and Recovery Manager for PostgreSQL
Thanks so much; this is what worked for me. Then running "$barman cron" again 

Gabriele Bartolini

unread,
Sep 14, 2019, 3:58:10 AM9/14/19
to pgba...@googlegroups.com
Hi,


Please update to Barman 2.9.

Cheers,
Gabriele

--
--
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.


--
Gabriele Bartolini - Head of Global Support
PostgreSQL Training, Services and Support
gabriele.bartolini@2ndQuadrant.com | www.2ndQuadrant.com
Reply all
Reply to author
Forward
0 new messages