ERROR: cannot connect to the PostgreSQL Serve

628 views
Skip to first unread message

edh

unread,
Aug 20, 2012, 2:35:03 PM8/20/12
to pgba...@googlegroups.com
Hello.

Im new at barman and I'm trying to set it up. However when I perform this command: barman show-server main this erros shows up:

ERROR: cannot connect to the PostgreSQL Server

This is my barman.conf
[barman]
; Main directory
barman_home = /disk2/barman
; System user
barman_user = sshadmin
; Log location
log_file = /var/log/barman/barman.log
; Default compression level: possible values are None (default), bzip2, gzip or custom
compression = gzip
; 'main' PostgreSQL Server configuration
[main]
; Human readable description
description =  "Main PostgreSQL Database"
; SSH options
ssh_command = ssh pg...@192.168.0.210
; PostgreSQL connection string
conninfo = host=192.168.0.210 user=pgsql

I can perform the ssh command as user sshadmin on backup server and it doesn't ask for password, also I can  perform this command as sshadmin user on backup server: psql -c 'SELECT version()' -U pgsql -h 192.168.0.210 -d test

What am I doing wrong?.

Thanks in advance.

edh

unread,
Aug 20, 2012, 2:58:06 PM8/20/12
to pgba...@googlegroups.com
Solved it by changing user to postgres insted of pgsql in the barman.conf file. However I'd like to recommend that in a future version Barman can use a differente user, because on FreeBSD by default the system user and database user is named pgsql so this can lead to a confussion. 

Thanks for your hardwork on Barman.

Gabriele Bartolini

unread,
Aug 20, 2012, 5:34:41 PM8/20/12
to pgba...@googlegroups.com, edh
Hi,

Il 20/08/12 20:58, edh ha scritto:
> Solved it by changing user to postgres insted of pgsql in the
> barman.conf file. However I'd like to recommend that in a future
> version Barman can use a differente user, because on FreeBSD by
> default the system user and database user is named pgsql so this can
> lead to a confussion.
Barman is not tied to any particular user on the PostgreSQL server. You
can set it in the connection info parameter.

From the information you provided, it seems to me it is a client
authentication issue (see the pg_hba.conf configuration in PostgreSQL).

Cheers,
Gabriele

--
Gabriele Bartolini - 2ndQuadrant Italia
PostgreSQL Training, Services and Support
gabriele....@2ndQuadrant.it | www.2ndQuadrant.it

edh

unread,
Aug 20, 2012, 7:38:08 PM8/20/12
to pgba...@googlegroups.com, edh
Hello, thank you for your response. 

I tought that it was a problem related to pg_hba.conf but I performed this command on the backup server as barman user:  psql -c 'SELECT version()' -U pgsql -h 192.168.0.210 -d test  and it worked withouth problems. Then after I created the postgres user (as superuser) on the main server and changed it in the barman.conf it started to work. But now that you said that it should work with any user, I dont know what went wrong in my first configuration.

Thank you.
  gabriele.bartolini@2ndQuadrant.it | www.2ndQuadrant.it

Gabriele Bartolini

unread,
Aug 21, 2012, 3:05:30 AM8/21/12
to pgba...@googlegroups.com, edh
Hello,

Il 21/08/12 01:38, edh ha scritto:
> I tought that it was a problem related to pg_hba.conf but I performed
> this command on the backup server as barman user: psql -c 'SELECT
> version()' -U pgsql -h 192.168.0.210 -d test and it worked withouth
> problems. Then after I created the postgres user (as superuser) on the
> main server and changed it in the barman.conf it started to work. But
> now that you said that it should work with any user, I dont know what
> went wrong in my first configuration.
You are manually connecting to the 'test' database. Would it be possible
to get a list of databases that exist in your server?

psql -l -U psql ...

Thanks,
Gabriele

--
Gabriele Bartolini - 2ndQuadrant Italia
PostgreSQL Training, Services and Support
gabriele....@2ndQuadrant.it | www.2ndQuadrant.it

Reply all
Reply to author
Forward
0 new messages