Bug 827889 - Bacula fails after F17 upgrade if using MySql for catalog
Bacula fails after F17 upgrade if using MySql for catalog
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: bacula (Show other bugs)
17
x86_64 Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Andreas Thienemann
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-03 09:49 EDT by Martin
Modified: 2012-06-08 04:22 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-03 11:05:31 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Martin 2012-06-03 09:49:34 EDT
Description of problem:

Bacula director seems to fail to start on F17 if it was configured to use MySql on F16. It appears to be trying to connect to Postgres though the bacula configuration file has not changed.

Version-Release number of selected component (if applicable):

bacula 5.2.6-2.fc17

How reproducible:

Only tried it on my bacula host

Steps to Reproduce:
1. Configure bacula on F16 using mysql
2. Upgrade to F17
  
Actual results:

Bacula director exits logging messages that it could not open the catalog database, referencing line dird.c:959 postgresql.c:248 unable to connect to postgres server.

Example:

Jun  3 14:39:20 zen systemd[1]: Unit bacula-dir.service entered failed state.
Jun  3 14:39:50 zen bacula-dir[2726]: bacula-dir: dird.c:954 Could not open Catalog "MyCatalog", database "bacula".
Jun  3 14:39:50 zen bacula-dir[2726]: bacula-dir: dird.c:959 postgresql.c:248 Unable to connect to PostgreSQL server. Database=bacula User=bacula
Jun  3 14:39:50 zen bacula-dir[2726]: Possible causes: SQL server not running; password incorrect; max_connections exceeded.
Jun  3 14:39:50 zen bacula-dir[2726]: 03-Jun 14:39 bacula-dir ERROR TERMINATION
Jun  3 14:39:50 zen bacula-dir[2726]: Please correct configuration file: /etc/bacula/bacula-dir.conf
Jun  3 14:39:50 zen systemd[1]: bacula-dir.service: main process exited, code=exited, status=1

Expected results:

Director to start correctly using its configured mysql server as it always has. Postgres is not running on this machine and never has been.

Backups were running correctly immediately before the F17 upgrade.

Additional Info:

Specifying the mysql driver explicitly in the config file with dbdriver="dbi:mysql"; ..... does not help.
Comment 1 Paul Howarth 2012-06-03 10:25:54 EDT
Are your "alternatives" settings right?

# alternatives --display bacula-dir
Comment 2 Martin 2012-06-03 10:34:39 EDT
Hmmm. That doesn't display anything. 

Does bacula use alternatives? I can't see evidence of this in the systemd unit. It just execs /usr/sbin/bacula-dir

The packaging has definitely changed from F16 though so you could be right. What would I configure?
Comment 3 Paul Howarth 2012-06-03 10:39:41 EDT
Ah yes, I seem to remember the packaging may have changed for F-17 and it's just the backend library that needs handling now (see README.Fedora from the bacula-common docs area):

# alternatives --display libbaccats.so
Comment 4 Simone Caronni 2012-06-03 10:47:07 EDT
Hello,

Bacula has changed drastically regarding backend and libraries from 5.0x (f16) to 5.2.x (f17).

Database backends are now handled by a single library and that is what is needed to manage the catalog.

Just type:

# alternatives --config libbaccats.so

and choose your library backends; no changes are required in the config files.

Regards,
--Simone
Comment 5 Martin 2012-06-03 10:48:16 EDT
Ok, that appears to be it. It seems to pick postgres regardless of which director rpm was installed in f16.

I also had to run the db upgrade script from v12 to 14 manually after setting the alternative.

The director is now up. Thanks for the help!
Comment 6 Simone Caronni 2012-06-08 04:22:55 EDT
I'm building now the package in Koji for 5.2.7, when it is available in updates-testing please bear the following:

The symlink library name has changed because we discovered a bug during version upgrades.

Please issue the following before upgrading:

alternatives --remove /usr/lib64/libbaccats-mysql-5.2.6.so
alternatives --remove /usr/lib64/libbaccats-sqlite3-5.2.6.so
alternatives --remove /usr/lib64/libbaccats-postgresql-5.2.6.so

And then set again your preference database with:

# alternatives --config libbaccats.so

There are 3 programs which provide 'libbaccats.so'.

  Selection    Command
-----------------------------------------------
   1           /usr/lib64/libbaccats-mysql.so
 + 2           /usr/lib64/libbaccats-sqlite3.so
*  3           /usr/lib64/libbaccats-postgresql.so

Enter to keep the current selection[+], or type selection number:

Note You need to log in before you can comment on or make changes to this bug.