Bareos Bug Tracker
Bareos Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000631bareos-core[All Projects] directorpublic2016-03-04 10:432017-06-14 18:59
Reporterotto 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusfeedbackResolutionopen 
PlatformLinuxOSDebianOS Version8
Product Version15.2.2 
Target VersionFixed in Version 
Summary0000631: No DB-reconnect after connection lost (again)
DescriptionAfter Restart postgres, the director lost connection to the database.

There is still no reconnect to the db.
(The Issue 426 was marked as resolved since 15.2.1, but still not working!)

The logs says:
JobId 0: Fatal error: sql_get.c:621 sql_get.c:621 query SELECT PoolId,Name,NumVols,MaxVols,UseOnce,UseCatalog,AcceptAnyVolume,AutoPrune,Recycle,VolRetention,VolUseDuration,MaxVolJobs,MaxVolFiles,MaxVolBytes,PoolType,LabelType,LabelFormat,RecyclePoolId,ScratchPoolId,ActionOnPurge,MinBlocksize,MaxBlocksize FROM Pool WHERE Pool.Name='TWR-3W' failed:
bareos-dir: no connection to the server
bareos-dir:

Steps To Reproduce
1. Restart Database:
 service postgresq restart

2. Test Director ...

 bconsole
  * status dir days=0
  * run job ...

3. Look in Logs ...


TagsNo tags attached.
bareos-master: impact
bareos-master: action
bareos-17.2: impact
bareos-17.2: action
bareos-16.2: impact
bareos-16.2: action
bareos-15.2: impact
bareos-15.2: action
bareos-14.2: impact
bareos-14.2: action
bareos-13.2: impact
bareos-13.2: action
bareos-12.4: impact
bareos-12.4: action
Attached Files

- Relationships
related to 0000426resolved No DB-reconnect after connection los 

-  Notes
(0002225)
mvwieringen (developer)
2016-03-30 17:07

By default reconnecting is disabled as it might lead to surprises.
You can enable it or even say the director should see things as a
fatal error and then your systemd will probably restart the director.

I would not use it myself and not randomly restart your postgresql
and if you do at a proper moment restart your director.

You are looking for the Reconnect and ExitOnFatal keywords in the Catalog
resources. Reconnect will only happen when the connection is not in the
middle of a Transaction and its in no way a supported option. Given the
complexity it might harm more then do good so that is why the default
is off.
(0002669)
robertoschwald (reporter)
2017-06-14 18:56

In Bareos 16.2.4 on CentOS 7, ExitOnFatal = yes does not work here.
I restart PostgreSQL, and then perform a bconsole status director.

Log prints all the time in a loop:

14-Jun 18:53 backup-dir: Fatal Error at postgresql.c:670 because:
Fatal database error
14-Jun 18:53 backup-dir JobId 0: Fatal error: sql_get.c:661 sql_get.c:661 query SELECT PoolId,Name,NumVols,MaxVols,UseOnce,UseCatalog,AcceptAnyVolume,AutoPrune,Recycle,VolRetention,VolUseDuration,MaxVolJobs,MaxVolFiles,MaxVolBytes,PoolType,LabelType,LabelFormat,RecyclePoolId,ScratchPoolId,ActionOnPurge,MinBlocksize,MaxBlocksize FROM Pool WHERE Pool.Name='Default' failed:
no connection to the server


I expect that the director exits on the fatal error as stated in the docs.

bareos-dir -xc:


Catalog {
  Name = "MyCatalog"
  DbAddress = "127.0.0.1"
  DbPort = 0
  DbPassword = "****"
  DbUser = "bareos"
  DbName = "bareos"
  DbDriver = "postgresql"
  MultipleConnections = no
  ExitOnFatal = yes
}
(0002670)
robertoschwald (reporter)
2017-06-14 18:59

For now I use "Reconnect = yes", which works when the db is restarted until ExitOnFatal works.

- Issue History
Date Modified Username Field Change
2016-03-04 10:43 otto New Issue
2016-03-29 13:14 joergs Relationship added related to 0000426
2016-03-30 17:07 mvwieringen Note Added: 0002225
2016-03-30 17:08 mvwieringen Status new => feedback
2017-06-14 18:56 robertoschwald Note Added: 0002669
2017-06-14 18:59 robertoschwald Note Added: 0002670


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker