/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: role "bareos" does not exist

774 views
Skip to first unread message

DUCARROZ Birgit

unread,
May 5, 2023, 4:39:51 AM5/5/23
to bareos...@googlegroups.com
Hi,

Please can anyone help me with this issue?
----------------------------------------------------------
sudo -u bareos -s

bareos@xxxx:/home/superuser$ psql

*psql: error: connection to server on socket
"/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: role "bareos" does
not exist*



LOG- AND CONFIGURATION FILES:
----------------------------------------------------------
netstat -nlp | grep 5432
tcp 0 0 127.0.0.1:5432 0.0.0.0:*
LISTEN 1218/postgres
unix 2 [ ACC ] STREAM LISTENING 59051 1218/postgres
/var/run/postgresql/.s.PGSQL.5432
----------------------------------------------------------
ps axf | grep postgres
8021 pts/1 S+ 0:00 \_ grep
--color=auto postgres
1218 ? Ss 0:01 /usr/lib/postgresql/15/bin/postgres -D
/var/lib/postgresql/15/main -c
config_file=/etc/postgresql/15/main/postgresql.conf
1246 ? Ss 0:00 \_ postgres: 15/main: checkpointer
1247 ? Ss 0:00 \_ postgres: 15/main: background writer
1322 ? Ss 0:00 \_ postgres: 15/main: walwriter
1323 ? Ss 0:00 \_ postgres: 15/main: autovacuum launcher
1324 ? Ss 0:00 \_ postgres: 15/main: logical replication
launcher
----------------------------------------------------------
/usr/sbin/bareos-dir -t
bareos-dir: dird/check_catalog.cc:64-0 Could not open Catalog
"MyCatalog", database "bareos".
bareos-dir: dird/check_catalog.cc:71-0 cats/postgresql.cc:230 Unable to
connect to PostgreSQL server. Database=bareos User=bareos
Possible causes: SQL server not running; password incorrect;
max_connections exceeded.
(connection to server at "localhost" (127.0.0.1), port 5432 failed:
FATAL: password authentication failed for user "bareos"
connection to server at "localhost" (127.0.0.1), port 5432 failed:
FATAL: password authentication failed for user "bareos"
)
bareos-dir ERROR TERMINATION

----------------------------------------------------------

/usr/sbin/bareos-dir --xc Catalog MyCatalog
Catalog {
Name = "MyCatalog"
DbAddress = "localhost"
DbPort = 5432
DbPassword = "test"
DbUser = "bareos"
DbName = "bareos"
}
----------------------------------------------------------
cat /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf
Catalog {
Name = MyCatalog
dbname = bareos
dbaddress = 127.0.0.1
#dbaddress = localhost
dbport = 5432
dbuser = bareos
dbpassword = test

}
----------------------------------------------------------
cat /etc/dbconfig-common/bareos-database-common.conf
# automatically generated by the maintainer scripts of
bareos-database-common
# any changes you make will be preserved, though your comments
# will be lost! to change your settings you should edit this
# file and then run "dpkg-reconfigure bareos-database-common"

# dbc_install: configure database with dbconfig-common?
# set to anything but "true" to opt out of assistance
dbc_install='true'

# dbc_upgrade: upgrade database with dbconfig-common?
# set to anything but "true" to opt out of assistance
dbc_upgrade='true'

# dbc_remove: deconfigure database with dbconfig-common?
# set to anything but "true" to opt out of assistance
dbc_remove='true'

# dbc_dbtype: type of underlying database to use
# this exists primarily to let dbconfig-common know what database
# type to use when a package supports multiple database types.
# don't change this value unless you know for certain that this
# package supports multiple database types
dbc_dbtype='pgsql'

# dbc_dbuser: database user
# the name of the user who we will use to connect to the database.
dbc_dbuser='bareos'

# dbc_dbpass: database user password
# the password to use with the above username when connecting
# to a database, if one is required
dbc_dbpass='test'

# dbc_dballow: allowed host to connect from
# only for database types that support specifying the host from
# which the database user is allowed to connect from
# this string defines for which host the dbc_dbuser is allowed
# to connect
# this value is only really used again when you reconfigure the
# package
dbc_dballow='localhost'

# dbc_dbserver: database host.
# leave unset to use localhost (or a more efficient local method
# if it exists).
dbc_dbserver='localhost'

# dbc_dbport: remote database port
# leave unset to use the default. only applicable if you are
# using a remote database.
dbc_dbport='5432'

# dbc_dbname: name of database
# this is the name of your application's database.
dbc_dbname='bareos'

# dbc_dbadmin: name of the administrative user
# this is the administrative user that is used to create all of the above
# The exception is the MySQL/MariaDB localhost case, where this value is
# ignored and instead is determined from /etc/mysql/debian.cnf.
dbc_dbadmin='postgres'

# dbc_basepath: base directory to hold database files
# leave unset to use the default. only applicable if you are
# using a local (filesystem based) database.
dbc_basepath=''

##
## postgresql specific settings. if you don't use postgresql,
## you can safely ignore all of these
##

# dbc_ssl: should we require ssl?
# set to "true" to require that connections use ssl
dbc_ssl=''

# dbc_authmethod_admin: authentication method for admin
# dbc_authmethod_user: authentication method for dbuser
# see the section titled "AUTHENTICATION METHODS" in
# /usr/share/doc/dbconfig-common/README.pgsql for more info
dbc_authmethod_admin='ident'
dbc_authmethod_user='password'

##
## end postgresql specific settings
##


----------------------------------------------------------

/usr/sbin/bareos-dir -t -f -d 500
bareos-dir (10): lib/parse_conf.h:440-0 ConfigResourcesContainer: new
configuration_resources_ 55e8b2aa27d0
bareos-dir (100): lib/parse_conf.cc:174-0 config file =
/etc/bareos/bareos-dir.d/*/*.conf
bareos-dir (100): lib/lex.cc:316-0 glob
/etc/bareos/bareos-dir.d/*/*.conf: 25 files
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/client/bareos-fd.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/console/admin.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/console/bareos-mon.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/director/bareos-dir.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/fileset/Catalog.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/fileset/SelfTest.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/fileset/Windows All Drives.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/job/BackupCatalog.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/job/RestoreFiles.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/messages/Daemon.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/messages/Standard.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/pool/Differential.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/pool/Full.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/pool/Incremental.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/pool/Scratch.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/profile/operator.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/profile/webui-admin.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/profile/webui-readonly.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/storage/File.conf
bareos-dir (9): dird/inc_conf.cc:548-0 set wildfile 55e8b2aa9420 size=1
[A-Z]:/hiberfil.sys
bareos-dir (9): dird/inc_conf.cc:548-0 set wildfile 55e8b2aa9420 size=2
[A-Z]:/pagefile.sys
bareos-dir (9): dird/inc_conf.cc:548-0 set wildfile 55e8b2aa9420 size=3
[A-Z]:/swapfile.sys
bareos-dir (9): dird/inc_conf.cc:548-0 set wilddir 55e8b2aa9420 size=1
[A-Z]:/RECYCLER
bareos-dir (9): dird/inc_conf.cc:548-0 set wilddir 55e8b2aa9420 size=2
[A-Z]:/$RECYCLE.BIN
bareos-dir (9): dird/inc_conf.cc:548-0 set wilddir 55e8b2aa9420 size=3
[A-Z]:/System Volume Information
bareos-dir (100): lib/lex.cc:316-0 glob
/etc/bareos/bareos-dir.d/*/*.conf: 25 files
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/client/bareos-fd.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/console/admin.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/console/bareos-mon.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/director/bareos-dir.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/fileset/Catalog.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/fileset/SelfTest.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/fileset/Windows All Drives.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/job/BackupCatalog.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/job/RestoreFiles.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/messages/Daemon.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/messages/Standard.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/pool/Differential.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/pool/Full.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/pool/Incremental.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/pool/Scratch.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/profile/operator.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/profile/webui-admin.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/profile/webui-readonly.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf
bareos-dir (100): lib/lex.cc:213-0 open config file:
/etc/bareos/bareos-dir.d/storage/File.conf
bareos-dir (200): dird/dird_conf.cc:2313-0 job RestoreFiles RunScript
inherited: 1 1
bareos-dir (200): dird/dird_conf.cc:2313-0 job DefaultJob RunScript
inherited: 1 1
bareos-dir (500): dird/dird_conf.cc:2905-0 runscript: creating new
RunScript object
bareos-dir (500): lib/runscript.cc:210-0 runscript: setting command =
/usr/lib/bareos/scripts/make_catalog_backup MyCatalog
bareos-dir (500): lib/runscript.cc:220-0 runscript: setting target = *None*
bareos-dir (200): lib/runscript.cc:297-0 runscript: debug
bareos-dir (200): lib/runscript.cc:298-0 --> RunScript
bareos-dir (200): lib/runscript.cc:299-0 -->
Command=/usr/lib/bareos/scripts/make_catalog_backup MyCatalog
bareos-dir (200): lib/runscript.cc:300-0 --> Target=*None*
bareos-dir (200): lib/runscript.cc:301-0 --> RunOnSuccess=1
bareos-dir (200): lib/runscript.cc:302-0 --> RunOnFailure=0
bareos-dir (200): lib/runscript.cc:303-0 --> FailJobOnError=1
bareos-dir (200): lib/runscript.cc:304-0 --> RunWhen=2
bareos-dir (500): dird/dird_conf.cc:2905-0 runscript: creating new
RunScript object
bareos-dir (500): lib/runscript.cc:210-0 runscript: setting command =
/usr/lib/bareos/scripts/delete_catalog_backup MyCatalog
bareos-dir (500): lib/runscript.cc:220-0 runscript: setting target = *None*
bareos-dir (200): lib/runscript.cc:297-0 runscript: debug
bareos-dir (200): lib/runscript.cc:298-0 --> RunScript
bareos-dir (200): lib/runscript.cc:299-0 -->
Command=/usr/lib/bareos/scripts/delete_catalog_backup MyCatalog
bareos-dir (200): lib/runscript.cc:300-0 --> Target=*None*
bareos-dir (200): lib/runscript.cc:301-0 --> RunOnSuccess=1
bareos-dir (200): lib/runscript.cc:302-0 --> RunOnFailure=0
bareos-dir (200): lib/runscript.cc:303-0 --> FailJobOnError=0
bareos-dir (200): lib/runscript.cc:304-0 --> RunWhen=1
bareos-dir (200): dird/dird_conf.cc:2313-0 job BackupCatalog RunScript
inherited: 1 1
bareos-dir (200): dird/dird_conf.cc:2313-0 job backup-bareos-fd
RunScript inherited: 1 1
bareos-dir (250): lib/message.cc:244-0 Copied message resource 55e8b2aaada0
bareos-dir (100): dird/dird.cc:320-0 backend path: /usr/lib/bareos/backends
bareos-dir (150): dird/dir_plugins.cc:273-0 Load dir plugins
bareos-dir (150): dird/dir_plugins.cc:275-0 No dir plugin dir!
bareos-dir (100): cats/cats_backends.cc:71-0 db_init_database: Trying to
find mapping of given interfacename postgresql to mapping interfacename
dbi, partly_compare = true
bareos-dir (100): cats/cats_backends.cc:71-0 db_init_database: Trying to
find mapping of given interfacename postgresql to mapping interfacename
mysql, partly_compare = false
bareos-dir (100): cats/cats_backends.cc:71-0 db_init_database: Trying to
find mapping of given interfacename postgresql to mapping interfacename
postgresql, partly_compare = false
bareos-dir (100): cats/cats_backends.cc:219-0 db_init_database: checking
backend /usr/lib/bareos/backends/libbareoscats-postgresql.so
bareos-dir (100): cats/cats_backends.cc:245-0 db_init_database: loaded
backend /usr/lib/bareos/backends/libbareoscats-postgresql.so
bareos-dir (100): cats/postgresql.cc:956-0 db_init_database first time
bareos-dir (50): cats/postgresql.cc:224-0 pg_real_connect failed
bareos-dir (50): cats/postgresql.cc:226-0 db_user=bareos db_name=bareos
db_password=test
bareos-dir: dird/check_catalog.cc:64-0 Could not open Catalog
"MyCatalog", database "bareos".
bareos-dir: dird/check_catalog.cc:71-0 cats/postgresql.cc:230 Unable to
connect to PostgreSQL server. Database=bareos User=bareos
Possible causes: SQL server not running; password incorrect;
max_connections exceeded.
(connection to server at "localhost" (127.0.0.1), port 5432 failed:
FATAL: password authentication failed for user "bareos"
connection to server at "localhost" (127.0.0.1), port 5432 failed:
FATAL: password authentication failed for user "bareos"
)
bareos-dir ERROR TERMINATION
Please correct the configuration in /etc/bareos/bareos-dir.d/*/*.conf


Thank you so much for any hint!
Regards,
Birgit
OpenPGP_0xD86E168D606536D7.asc
OpenPGP_signature
Message has been deleted
Message has been deleted

Bruce Eckstein

unread,
Nov 26, 2023, 11:17:01 AM11/26/23
to bareos-users
If this is the upgrade to version 23, I had a similar issue. I needed to run /usr/lib/bareos/script/update_bareos_tables to update the tables in bareos. Then I had to reboot the server. I tried to just reboot the postgresql but that did not work.
best of luck.

Bruno Friedmann (bruno-at-bareos)

unread,
Nov 27, 2023, 4:30:32 AM11/27/23
to bareos-users
Hi Bruce, It look really weird to me, to have to reboot a server due to Bareos update or upgrade.
Mostly update just need to restart services which all can be done in one go with `systemctl restart bareos-dir bareos-sd bareos-fd` 

For upgrade, it has always been a good idea (beside reading the documentation and changelog) to run the 
/usr/lib/bareos/script/update_bareos_tables
/usr/lib/bareos/script/grant_bareos_privileges
Which update the database schema, and associated right 
Then restart the service.

I would always in my case check each daemon before restart to handle configuration warning deprecation etc.
`
bareos-dir -t -u bareos -g bareos
bareos-sd -t u bareos -g bareos
bareos-fd -t -u root -g bareos
`

If you still have to reboot, would be interesting to know which platform requires that.

jens.gr...@gmail.com

unread,
Nov 29, 2023, 3:46:05 PM11/29/23
to bareos-users
Hi Bruno,

I had the same issue as Bruce had. I'm working on a Debian 11.8 system and the reboot was the only way to get bareos up and running again.

Greetings, Jens

Bruno Friedmann (bruno-at-bareos)

unread,
Nov 30, 2023, 4:26:47 AM11/30/23
to bareos-users
Hello Jens, that would tend to prove the following.

When the upgraded packages are installed, the dbconfig should take care of the upgrade of the database. and only then the bareos-director should be restarted.

What you describe, seems to tell that for non expected reason the postgresql cluster instance is down when the director restart, which is as said: unexpected.

Would be great if someone else upgrading, can check in which state is the postgresql cluster after the dbconfig occur ?

aeron...@gmail.com

unread,
Nov 30, 2023, 3:10:10 PM11/30/23
to bareos...@googlegroups.com

So, I figured that I was the only one as my configuation is very old and I do not update unless backups not working correctly.

So I am on Ubuntu 22.04 using Dell XPS13 running as a server.

Postgres is on a single server, no backup cluster. A script (in bareos) creates a download of all postgres databases incase of disaster.

psql (PostgreSQL) 14.9 (Ubuntu 14.9-0ubuntu0.22.04.1) after upgrade last saturday. (Don't really know what it was before saturday upgrade which is when i do regular ubuntu upgrades).

Is there any other info that would be helpful?

bee

--
You received this message because you are subscribed to the Google Groups "bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bareos-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bareos-users/74e7934d-2b16-48f3-a824-24cea5a16bc0n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages