Bug 827889 - Bacula fails after F17 upgrade if using MySql for catalog
Summary: Bacula fails after F17 upgrade if using MySql for catalog
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: bacula
Version: 17
Hardware: x86_64
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Andreas Thienemann
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-03 13:49 UTC by Martin
Modified: 2012-06-08 08:22 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-03 15:05:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Martin 2012-06-03 13:49:34 UTC
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 14:25:54 UTC
Are your "alternatives" settings right?

# alternatives --display bacula-dir

Comment 2 Martin 2012-06-03 14:34:39 UTC
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 14:39:41 UTC
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 14:47:07 UTC
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 14:48:16 UTC
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 08:22:55 UTC
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.