problem with barman receive-wal --create-slot my_server

5,150 views
Skip to first unread message

Thomas Poty

unread,
May 9, 2018, 8:24:04 AM5/9/18
to Barman, Backup and Recovery Manager for PostgreSQL

Dear All,

I am running postgresql 9.6.8 and barman 2.3

I try to set up a barman server but I have an issue with the wal streaming :

Here is the result of barman check :
Server CONT03-07-001-016-00000369:
    PostgreSQL: OK
    is_superuser: OK
    PostgreSQL streaming: OK
    wal_level: OK
    replication slot: FAILED (replication slot 'barman__CONT03_07_001_016_00000369' doesn't exist. Please execute 'barman receive-wal --create-slot CONT03-07-001-016-00000369')
    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 0 backups, expected at least 0)
    pg_basebackup: OK
    pg_basebackup compatible: OK
    pg_basebackup supports tablespaces mapping: OK
    archive_mode: OK
    archive_command: OK
    continuous archiving: OK
    pg_receivexlog: OK
    pg_receivexlog compatible: OK
    receive-wal running: FAILED (See the Barman log file for more details)
    archiver errors: OK


Here is end of log of /var/log/barman/barman.log :
2018-05-09 14:13:01,298 [115794] barman.config DEBUG: Including configuration file: CONT03-07-001-016-00000369.conf
2018-05-09 14:13:01,298 [115794] barman.cli DEBUG: Initialised Barman version 2.3 (config: /etc/barman.conf, args: {'debug': False, 'command': 'cron', 'quiet': True, 'format': 'console'})
2018-05-09 14:13:01,309 [115794] barman.backup_executor DEBUG: The default backup strategy for postgres backup_method is: concurrent_backup
2018-05-09 14:13:01,309 [115794] barman.command_wrappers DEBUG: BarmanSubProcess: ['/usr/bin/python', '/usr/bin/barman', '-c', '/etc/barman.conf', '-q', 'archive-wal', 'CONT03-07-001-016-00000369']
2018-05-09 14:13:01,311 [115794] barman.command_wrappers DEBUG: BarmanSubProcess: subprocess started. pid: 115795
2018-05-09 14:13:01,311 [115794] barman.command_wrappers DEBUG: BarmanSubProcess: ['/usr/bin/python', '/usr/bin/barman', '-c', '/etc/barman.conf', '-q', 'receive-wal', 'CONT03-07-001-016-00000369']
2018-05-09 14:13:01,313 [115794] barman.command_wrappers DEBUG: BarmanSubProcess: subprocess started. pid: 115796
2018-05-09 14:13:01,400 [115795] barman.config DEBUG: Including configuration file: CONT03-07-001-016-00000369.conf
2018-05-09 14:13:01,401 [115795] barman.cli DEBUG: Initialised Barman version 2.3 (config: /etc/barman.conf, args: {'command': 'archive_wal', 'server_name': 'CONT03-07-001-016-00000369', 'format': 'console', 'debug': False, 'config': '/etc/barman.conf', 'quiet': True})
2018-05-09 14:13:01,403 [115796] barman.config DEBUG: Including configuration file: CONT03-07-001-016-00000369.conf
2018-05-09 14:13:01,403 [115796] barman.cli DEBUG: Initialised Barman version 2.3 (config: /etc/barman.conf, args: {'reset': False, 'server_name': 'CONT03-07-001-016-00000369', 'format': 'console', 'stop': False, 'create_slot': False, 'quiet': True, 'command': 'receive_wal', 'debug': False, 'drop_slot': False, 'config': '/etc/barman.conf'})
2018-05-09 14:13:01,411 [115795] barman.backup_executor DEBUG: The default backup strategy for postgres backup_method is: concurrent_backup
2018-05-09 14:13:01,412 [115795] barman.server DEBUG: Starting archive-wal for server CONT03-07-001-016-00000369
2018-05-09 14:13:01,412 [115795] barman.wal_archiver INFO: No xlog segments found from file archival for CONT03-07-001-016-00000369.
2018-05-09 14:13:01,412 [115795] barman.wal_archiver INFO: No xlog segments found from streaming for CONT03-07-001-016-00000369.
2018-05-09 14:13:01,414 [115796] barman.backup_executor DEBUG: The default backup strategy for postgres backup_method is: concurrent_backup
2018-05-09 14:13:01,414 [115796] barman.server INFO: Starting receive-wal for server CONT03-07-001-016-00000369
2018-05-09 14:13:01,418 [115796] barman.command_wrappers DEBUG: Command: ['/usr/pgsql-9.6/bin/pg_receivexlog', '--version']
2018-05-09 14:13:01,422 [115796] barman.command_wrappers DEBUG: Command return code: 0
2018-05-09 14:13:01,422 [115796] barman.command_wrappers DEBUG: Command stdout: pg_receivexlog (PostgreSQL) 9.6.8

2018-05-09 14:13:01,422 [115796] barman.command_wrappers DEBUG: Command stderr:
2018-05-09 14:13:01,439 [115796] barman.wal_archiver DEBUG: Look for 'barman_receive_wal' in 'synchronous_standby_names': ['']
2018-05-09 14:13:01,439 [115796] barman.wal_archiver INFO: Synchronous WAL streaming for barman_receive_wal: False
2018-05-09 14:13:01,440 [115796] barman.server ERROR: ArchiverFailure:replication slot 'barman__CONT03_07_001_016_00000369' doesn't exist. Please execute 'barman receive-wal --create-slot CONT03-07-001-016-00000369'


Here is the data of table pg_replication_slots :
[[local]] postgres@technical=# select * from pg_replication_slots ;
┌────────────────────────────────────┬────────┬───────────┬────────┬──────────┬────────┬────────────┬────────┬──────────────┬─────────────┬─────────────────────┐
│             slot_name              │ plugin │ slot_type │ datoid │ database │ active │ active_pid │  xmin  │ catalog_xmin │ restart_lsn │ confirmed_flush_lsn │
├────────────────────────────────────┼────────┼───────────┼────────┼──────────┼────────┼────────────┼────────┼──────────────┼─────────────┼─────────────────────┤
│ srv370                             │ (null) │ physical  │ (null) │ (null)   │ t      │       7729 │ (null) │       (null) │ 0/80000760  │ (null)              │
│ srv371                             │ (null) │ physical  │ (null) │ (null)   │ t      │       7728 │ (null) │       (null) │ 0/80000760  │ (null)              │
│ barman__cont03_07_001_016_00000369 │ (null) │ physical  │ (null) │ (null)   │ f      │     (null) │ (null) │       (null) │ (null)      │ (null)              │
└────────────────────────────────────┴────────┴───────────┴────────┴──────────┴────────┴────────────┴────────┴──────────────┴─────────────┴─────────────────────┘
(3 rows)



Postgresql.conf defined :
max_wal_senders = 4
max_replication_slots = 4
wal_level = replica
archive_command = 'rsync -a %p barman@VM04-07-001-041-00000363:/var/lib/barman/CONT03-07-001-016-00000369/incoming/%f'

Of course, on barman server I have already executed :
barman receive-wal --reset CONT03-07-001-016-00000369
barman receive-wal --drop-slot CONT03-07-001-016-00000369
barman receive-wal --create-slot CONT03-07-001-016-00000369

Postgresql see the replication slot but it is not active ...

Could you help me?

Many thanks

Regards Thomas

Amarnath Gopalan

unread,
May 9, 2018, 8:29:13 AM5/9/18
to pgba...@googlegroups.com
Could you also send barman.conf file ? 
I don’t think archive_command is needed if you are backup method is using streaming .

You have to specify the replication slot name in barman conf file and create them manually .

Thanks 
Amar 

On Wed, May 9, 2018 at 8:24 PM Thomas Poty <thoma...@gmail.com> wrote:
--
Amar Senior Database Consultant +6598240094 sg.linkedin.com/pub/amarnath-gopalan/86/774/584/ ~Fear Drains, Faith Energises.

Thomas Poty

unread,
May 9, 2018, 8:34:18 AM5/9/18
to Barman, Backup and Recovery Manager for PostgreSQL
Here is the server configuration :
; Barman, Backup and Recovery Manager for PostgreSQL
; http://www.pgbarman.org/ - http://www.2ndQuadrant.com/
;
; Template configuration file for a server using
; only streaming replication protocol
;

[CONT03-07-001-016-00000369]
; Human readable description
description =  "CONT03-07-001-016-00000369 (Cluster=publifund Project=general Environment=prod)"

; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; PostgreSQL connection string (mandatory)
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
conninfo = host=CONT03-07-001-016-00000369 user=barman_streaming dbname=postgres

; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; PostgreSQL streaming connection string
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; To be used by pg_basebackup for backup and pg_receivexlog for WAL streaming
; NOTE: streaming_barman is a regular user with REPLICATION privilege
streaming_conninfo = host=CONT03-07-001-016-00000369 user=barman_streaming dbname=postgres

; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Backup settings (via pg_basebackup)
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
backup_method = postgres
;streaming_backup_name = barman_streaming_backup

; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WAL streaming settings (via pg_receivexlog)
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
archiver = on
streaming_archiver = on
;F2C comment : impossible to include character '@' and '-'
slot_name = barman__CONT03_07_001_016_00000369
streaming_archiver_name = barman_receive_wal
streaming_archiver_batch_size = 50

; PATH setting for this server
path_prefix = "/usr/pgsql-9.6/bin"


Thanks

Amarnath Gopalan

unread,
May 9, 2018, 9:14:44 AM5/9/18
to pgba...@googlegroups.com
You need to execute this as stated in the output of barman check command 

Run this 
1) barman receive-wal --create-slot CONT03-07-001-016-00000369'

2) barman cron 
 #should start receive-wal

3) barman check CONT03-07-001-016-00000369

4) if still you see error run the below command to manually start the receive-wal and press ctl + c to terminate 

barman receive-wal CONT03-07-001-016-00000369

5) check again for any error 

barman check CONT03-07-001-016-00000369


Thanks 
Amar 

Amarnath Gopalan

unread,
May 9, 2018, 9:16:46 AM5/9/18
to pgba...@googlegroups.com

remove the quotes at the end ( typo )
I.e from
barman receive-wal --create-slot CONT03-07-001-016-00000369'
 
To 
barman receive-wal --create-slot CONT03-07-001-016-00000369

Gabriele Bartolini

unread,
May 9, 2018, 9:19:00 AM5/9/18
to pgba...@googlegroups.com
Hi Thomas,

2018-05-09 14:34 GMT+02:00 Thomas Poty <thoma...@gmail.com>:
[CONT03-07-001-016-00000369]

Wow ... you were afraid of duplication in names! :)
 
slot_name = barman__CONT03_07_001_016_00000369

I think you spotted a bug. We insert it as case insensitive in PostgreSQL, therefore the slot name is converted - by default - in lowercase.

I am opening a bug now. I suggest that, for back compatibility, we make it lowercase by default in Barman - rather than case sensitive.

I will keep you posted.

Cheers,
Gabriele

Thomas Poty

unread,
May 9, 2018, 9:35:17 AM5/9/18
to Barman, Backup and Recovery Manager for PostgreSQL
Hi Gabriele,

I was back here to say I found the solution by putting all in lowercase when I saw your answer...

So I am happy to know  I contribute to involve pgbarman ;-)

Thank you Gabriele and Thank you Others

Thomas

Amarnath Gopalan

unread,
May 9, 2018, 9:36:30 AM5/9/18
to pgba...@googlegroups.com
Hi Thomas , 

Can try with simpler slot name :) ? 

I just noticed the slot name in conf file and output of barman check command are different. 

Let me know if you still see the error ..

Thanks 
Amar 

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

Amarnath Gopalan

unread,
May 9, 2018, 9:37:04 AM5/9/18
to pgba...@googlegroups.com
Great nice 👍 

Gabriele Bartolini

unread,
May 9, 2018, 10:09:15 AM5/9/18
to pgba...@googlegroups.com

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

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+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages