Error executing "barman show-server main"

2,358 views
Skip to first unread message

Mikalai Palauko

unread,
Sep 26, 2013, 10:07:08 AM9/26/13
to pgba...@googlegroups.com
Hello everybody!

I've installed Barman, configured SSH both on Barman and Postgres servers.
And now I have a problem with executing this command:
barman show-server main

It gives this output:
2013-09-26 16:28:34,023 barman.config WARNING: Failed opening the requested log file. Using standard error instead.
Unknown server 'main'


Here is contents of my /etc/barman.conf:
; Barman, Backup and Recovery Manager for PostgreSQL
; http://www.pgbarman.org/ - http://www.2ndQuadrant.com/
;
; Main configuration file

[barman]
; Main directory
barman_home = /var/lib/barman

; System user
barman_user = barman

; Log location
log_file = /var/log/barman/barman.log


; Default compression level: possible values are None (default), bzip2, gzip or custom
;compression = gzip

; Pre/post backup hook scripts
;pre_backup_script = env | grep ^BARMAN
;post_backup_script = env | grep ^BARMAN

; Directory of configuration files. Place your sections in separate files with .conf extension
; For example place the 'main' server section in /etc/barman.d/main.conf
;configuration_files_directory = /etc/barman.d

; Minimum number of required backups (redundancy)
;minimum_redundancy = 0

; Global retention policy (REDUNDANCY or RECOVERY WINDOW) - default empty
;retention_policy =

; Global bandwidth limit in KBPS - default 0 (meaning no limit)
;bandwidth_limit = 4000

 ; 'main' PostgreSQL Server configuration
 [main]
 ; Human readable description
 description =  "Main PostgreSQL Database"

 ; SSH options
 ssh_command = ssh post...@192.168.1.11

 ; PostgreSQL connection string
 conninfo = host=192.168.1.11 user=postgres

 ; Minimum number of required backups (redundancy)
 minimum_redundancy = 1

 ; Examples of retention policies

 ; Retention policy (disabled)
 ; retention_policy =
 ; Retention policy (based on redundancy)
 retention_policy = REDUNDANCY 2
 ; Retention policy (based on recovery window)
 ; retention_policy = RECOVERY WINDOW OF 4 WEEKS


I've checked that user barman have permissions to write into /var/log/barman/barman.log.
What can I do to fix it? Any ideas?

Alessio Gennari

unread,
Sep 28, 2013, 5:00:12 AM9/28/13
to pgba...@googlegroups.com
Hello Mikalai,
try to place barman.conf in this location:

/etc/barman/barman.conf


Best regards.

Alessio

Mikalai Palauko

unread,
Sep 30, 2013, 6:08:15 AM9/30/13
to pgba...@googlegroups.com
Hello Alessio!
Thanks for your respond.
I moved "barman.conf" to "/etc/barman/". It didn't help me - I still get the same error.

I don't know whether it is useful information: my Barman server runs Ubuntu 12.04 LTS.
By the way I have another server running Debian 7.0. I have also installed Barman to this server and it works perfectly with my Postgres server...

Alessio Gennari

unread,
Oct 2, 2013, 9:54:07 AM10/2/13
to pgba...@googlegroups.com
The error is the same?

How did you install barman? With or without --user option?

Try to move barman.conf to ~/.barman.conf.

Regards.

Alessio

Mikalai Palauko

unread,
Oct 8, 2013, 9:30:13 AM10/8/13
to pgba...@googlegroups.com
Hi, Alessio!

Yes, error the same.
I installed Barman with this command:
"sudo apt-get install barman".

As you adviced me I moved "barman.conf" to "~/.barman.conf".
Nothing has changed - it gives me the same error.

Saulo Neiva

unread,
Dec 28, 2017, 8:10:12 AM12/28/17
to Barman, Backup and Recovery Manager for PostgreSQL
Hello!
I'm having this same problem.
I've uncommented the Main line and it brings the following error:
-bash-4.2 $ barman show-server barman
EXCEPTION: File contains parsing errors: /etc/barman.conf
[line 14]: 'Main directory \ n'
See log file for more details.
No handlers could be found for logger "barman.cli"
I returned the Main line comment

Georg Hartmann

unread,
Dec 30, 2017, 11:29:35 AM12/30/17
to Barman, Backup and Recovery Manager for PostgreSQL
Hello Mikalai,

pls read http://docs.pgbarman.org/release/2.3/#show-server

for "barman show-server" it states:
barman show-server <server_name>


1. move your barman.conf back to /etc/
2. within /etc/barman/ you'll find some example conf files which have to be copied and modified to fit to your environment.
I assume you want to configure streaming backup for a pg-cluster?
So make a copy of the streaming example and put your values here.
The file should be named e.g. like your cluster. We (at work) use servername_port.conf and <server_name> refers ALWAYS to the names of such conf files within /etc/barman/ .

To summarize: 
/etc/barman.conf holds general settings for barman itself and defaults for configured servers
/etc/barman/yourservername.conf contains server specific settings and may also overrule values from /etc/barman.conf (like Retention period, binary path a.s.o.

The command should then looks like
barman show-server yourservername

hope it helps

regards Georg
Reply all
Reply to author
Forward
0 new messages