FS#30727 - Bacula won't connect to existing MySQL DB after upgrade - looks for Postgresql

Attached to Project: Community Packages
Opened by Mark (fiddlinmacx) - Tuesday, 17 July 2012, 15:07 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Thursday, 19 July 2012, 08:59 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description: Once again bacula-dir is trying to connect to postgresql after the recent update to 5.2.10-3. I have no reference to postgresql in my configs and it was working up until this update which added support for postgresql back in although as an optional dependancy.

Additional info:
* Package version: 5.2.10-3
excerpt from bacula.log:

17-Jul 10:36 bacula-dir JobId 0: Fatal error: Could not open Catalog "MyCatalog", database "bacula".
17-Jul 10:36 bacula-dir JobId 0: Fatal error: postgresql.c:248 Unable to connect to PostgreSQL server. Database=bacula User=bacula
Possible causes: SQL server not running; password incorrect; max_connections exceeded.
17-Jul 10:36 bacula-dir ERROR TERMINATION
Please correct configuration file: bacula-dir.conf


Steps to reproduce: Upgrade to bacula 5.2.10-3 with a mysql database configured and restart bacula-dir.
This task depends upon

Closed by  Sven-Hendrik Haase (Svenstaro)
Thursday, 19 July 2012, 08:59 GMT
Reason for closing:  Fixed
Additional comments about closing:  Rel -4.
Comment by Mark (fiddlinmacx) - Tuesday, 17 July 2012, 15:09 GMT
I've tried to set the 'dbdriver' line - it makes no difference.
I've tried to set the address and port - same thing.

Does bacula support --with-mysql and --with-postgresql at the same time?
Comment by Mark (fiddlinmacx) - Tuesday, 17 July 2012, 15:23 GMT
Once again, if I remove postgresql-libs entirely, I find that it is actually required to run bacula-dir at all:

/usr/sbin/bacula-dir: error while loading shared libraries: libpq.so.5: cannot open shared object file: No such file or directory

There doesn't seem to be a command line switch that starts bacula-dir with only one db driver working. It looks like only one --with-?? is tolerated. I'll have to downgrade again to get things working.
Is this an upstream bug??
Comment by Mark (fiddlinmacx) - Wednesday, 18 July 2012, 12:18 GMT
I've posted on the bacula-users mailing list. Hopefully I can find out something from that end. Maybe it's a bug, but I haven't found mention of it in their bug tracker. Do other distros use both ./configure switches (all 3 if you include sqlite??)?
I'll have a look at other distros' packages when I have a chance.
Comment by Sven-Hendrik Haase (Svenstaro) - Wednesday, 18 July 2012, 12:21 GMT
Other distros work around this by having multiple packages for the different configurations which I think sucks. I will revert this change for now and see if I will create multiple packages for the different configurations.
Comment by Mark (fiddlinmacx) - Wednesday, 18 July 2012, 12:38 GMT
Don't worry about it right now until a new upstream version arrives unless you're certain there's no other way around it. I can deal with it this way for now.
You're right though, this does suck. I found a similar problem with postfix. They must load all the DB drivers even when they're not using them.
I'm going to continue working on the upstream angle. I'll let you know what I find out.
Comment by Mark (fiddlinmacx) - Wednesday, 18 July 2012, 14:04 GMT
OK. It looks like the Bacula docs have the answer. Someone on the bacula IRC channel pointed this out:
"bacula can only handle a single database server ... that is defined when configuring Bacula."
I think we might be stuck with having separate packages for now.
Comment by Sven-Hendrik Haase (Svenstaro) - Thursday, 19 July 2012, 08:59 GMT
I reverted the postgresql changes with rel -4. Reopen if problem persists.

Loading...