[SRU] Database not upgraded while upgrading bacula

Bug #980189 reported by Thomas Schweikle
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
bacula (Ubuntu)
Fix Released
High
James Page
Precise
Fix Released
High
James Page
Quantal
Fix Released
High
James Page

Bug Description

[Impact]
Users of bacula upgrading from either 10.04 or 11.10 to 12.04 end up with a non-functional bacula-director as the database is not upgraded as part of the package installation process. This causes bacula-director to fail on startup.

[Test Case]
(oneiric base server install)
sudo apt-get install mysql-server
sudo apt-get install bacula-server
sudo do-release-upgrade
...
sudo cat /var/log/bacula/log

14-Jun 16:45 bacula-dir JobId 0: Fatal error: Version error for database "bacula". Wanted 14, got 12
14-Jun 16:45 bacula-dir JobId 0: Fatal error: Could not open Catalog "MyCatalog", database "bacula".
14-Jun 16:45 bacula-dir JobId 0: Fatal error: Version error for database "bacula". Wanted 14, got 12
14-Jun 16:45 bacula-dir ERROR TERMINATION
Please correct configuration file: /etc/bacula/bacula-dir.conf

[Regression Potential]
The changes to the package as in the dbconfig-common upgrade handling for postgresql, sqllite and mysql database types. A new upgrade is defined for 5.2.5-0ubuntu6.1 to upgrade the schema from version 12->14. This same fix is applied in quantal which ensures it only get applied once as an upgrade passes 5.2.5-0ubuntu6.1

[Original Bug Report]
Upgrading a bacula server from Ubuntu oneiric to precise upgrades bacula from 5.0.3 to 5.5.1, but misses the necessary database upgrade:

12-Apr 21:19 bacula-dir JobId 0: Fatal error: Version error for database "bacula". Wanted 14, got 12
12-Apr 21:19 bacula-dir JobId 0: Fatal error: Could not open Catalog "MyCatalog", database "bacula".
12-Apr 21:19 bacula-dir JobId 0: Fatal error: Version error for database "bacula". Wanted 14, got 12
12-Apr 21:19 bacula-dir ERROR TERMINATION
Please correct configuration file: /etc/bacula/bacula-dir.conf

In tune bacula-director doesn't start any more. Instructions how to upgrade the database manualy are missing.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: bacula-director-pgsql 5.2.5-0ubuntu6
ProcVersionSignature: Ubuntu 3.2.0-23.36-virtual 3.2.14
Uname: Linux 3.2.0-23-virtual x86_64
ApportVersion: 2.0.1-0ubuntu2
Architecture: amd64
Date: Thu Apr 12 21:22:21 2012
InstallationMedia: Ubuntu-Server 10.04.1 LTS "Lucid Lynx" - Release amd64 (20100816.2)
ProcEnviron:
 TERM=screen-bce
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: bacula
UpgradeStatus: Upgraded to precise on 2012-04-12 (0 days ago)

Revision history for this message
Thomas Schweikle (tps) wrote :
Revision history for this message
Thomas Schweikle (tps) wrote :

Since the script "update_bacula_tables" is missing from the install, normaly installed at /etc/bacula/scripts --- this is a showbreaker.
The script isn't found in the documentation as well.

Revision history for this message
James Page (james-page) wrote :

Hi Thomas

The upgrade script for 12->14 for postgresql can be found in /usr/share/bacula-director.

Does your installation use dbconfig? I believe that this should automatically upgrade the database but if you are not using dbconfig you will need to run this script manually.

Thnaks

Changed in bacula (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Thomas Schweikle (tps) wrote :

dbconfig is used. But the update not applied. The script in /usr/share/bacula-director differs from the one given in the bacula sources (where I found it). The differences are minor and shouldn't matter, but it is a pitty to find scripts referenced to be found at /etc/bacula/scripts in the manual at /usr/share/bacula-director. This means the manuals would have to be updated too, but this wasn't done.

Revision history for this message
James Page (james-page) wrote :

Looks like the dbconfig upgrade steps are missing for the version in precise.

Raising tasks - will target SRU for 12.04.1 (but probably earlier).

Changed in bacula (Ubuntu):
status: Incomplete → Confirmed
importance: Low → High
Changed in bacula (Ubuntu Precise):
status: New → Confirmed
importance: Undecided → High
milestone: none → ubuntu-12.04.1
summary: - Database not upgraded while upgrading bacula
+ [SRU] Database not upgraded while upgrading bacula
Revision history for this message
James Page (james-page) wrote :

Had to work around a misconfiguration in the director config for mysql on a fresh install but confirmed:

Please correct configuration file: /etc/bacula/bacula-dir.conf
14-Jun 12:58 bacula-dir JobId 0: Fatal error: Version error for database "bacula". Wanted 14, got 12
14-Jun 12:58 bacula-dir JobId 0: Fatal error: Could not open Catalog "MyCatalog", database "bacula".
14-Jun 12:58 bacula-dir JobId 0: Fatal error: Version error for database "bacula". Wanted 14, got 12
14-Jun 12:58 bacula-dir ERROR TERMINATION
Please correct configuration file: /etc/bacula/bacula-dir.conf

James Page (james-page)
Changed in bacula:
status: New → Invalid
no longer affects: bacula
James Page (james-page)
Changed in bacula (Ubuntu Quantal):
assignee: nobody → James Page (james-page)
Changed in bacula (Ubuntu Precise):
assignee: nobody → James Page (james-page)
James Page (james-page)
Changed in bacula (Ubuntu Precise):
status: Confirmed → In Progress
Changed in bacula (Ubuntu Quantal):
status: Confirmed → In Progress
James Page (james-page)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bacula - 5.2.5-0ubuntu7

---------------
bacula (5.2.5-0ubuntu7) quantal; urgency=low

  * Ensure bacula database is upgraded from 12->14 as part of
    upgrade to 5.2.x (LP: #980189):
    - d/rules: Add dbconfig-common upgrade step for 5.2.5-0ubuntu6.1 for
      all database types.
 -- James Page <email address hidden> Thu, 14 Jun 2012 16:09:41 +0100

Changed in bacula (Ubuntu Quantal):
status: In Progress → Fix Released
James Page (james-page)
description: updated
description: updated
Revision history for this message
James Page (james-page) wrote :

Uploaded to precise-proposed for SRU team review.

Revision history for this message
Scott Kitterman (kitterman) wrote : Please test proposed package

Hello Thomas, or anyone else affected,

Accepted bacula into precise-proposed. The package will build now and be available in a few hours. Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users. If this package fixes the bug for you please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case details of your testing will help us make a better decision. Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in bacula (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
m1fcj (hakan-koseoglu) wrote :

Verified as fixed via aptitude upgrade. I didn't have to do anything manually, can read previous and generate new backups so far.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bacula - 5.2.5-0ubuntu6.1

---------------
bacula (5.2.5-0ubuntu6.1) precise-proposed; urgency=low

  * Ensure bacula database is upgraded from 12->14 as part of
    upgrade to 5.2.x (LP: #980189):
    - d/rules: Add dbconfig-common upgrade step for 5.2.5-0ubuntu6.1 for
      all database types.
 -- James Page <email address hidden> Thu, 14 Jun 2012 15:52:27 +0100

Changed in bacula (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Fabian Köster (maestro-alubia) wrote :

Is this bug really fixed in precise? I just upgraded from oneiric using 'do-release-upgrade' and director is not starting:

28-Jul 19:20 bacula-dir JobId 0: Fatal error: Version error for database "bacula". Wanted 14, got 12
28-Jul 19:20 bacula-dir JobId 0: Fatal error: Could not open Catalog "MyCatalog", database "bacula".
28-Jul 19:20 bacula-dir JobId 0: Fatal error: Version error for database "bacula". Wanted 14, got 12
28-Jul 19:20 bacula-dir ERROR TERMINATION

Database is MySQL.

Revision history for this message
m1fcj (hakan-koseoglu) wrote :

The packages in the proposed worked for me at least like a treat:

Upgrade: bacula-sd-mysql:amd64 (5.2.5-0ubuntu6, 5.2.5-0ubuntu6.1), bacula-client:amd64 (5.2.5-0ubuntu6, 5.2.5-0ubuntu6.1), bacula-director-mysql:amd64 (5.2.5-0ubuntu6, 5.2.5-0ubuntu6.1), bacula-common:amd64 (5.2.5-0ubuntu6, 5.2.5-0ubuntu6.1), bacula:amd64 (5.2.5-0ubuntu6, 5.2.5-0ubuntu6.1), bacula-console:amd64 (5.2.5-0ubuntu6, 5.2.5-0ubuntu6.1), bacula-fd:amd64 (5.2.5-0ubuntu6, 5.2.5-0ubuntu6.1), bacula-sd:amd64 (5.2.5-0ubuntu6, 5.2.5-0ubuntu6.1), bacula-server:amd64 (5.2.5-0ubuntu6, 5.2.5-0ubuntu6.1), bacula-common-mysql:amd64 (5.2.5-0ubuntu6, 5.2.5-0ubuntu6.1), bacula-director-common:amd64 (5.2.5-0ubuntu6, 5.2.5-0ubuntu6.1), bacula-console-qt:amd64 (5.2.5-0ubuntu6, 5.2.5-0ubuntu6.1)
End-Date: 2012-06-19 12:27:20

and my director started fine after that.

Revision history for this message
Fabian Köster (maestro-alubia) wrote :

Sorry, I did not notice that the package is not yet in precise-updates. I did not enable precise-proposed.

Revision history for this message
m1fcj (hakan-koseoglu) wrote :

Hi Fabian,
I thought they were released by the maintainer to the wild. Apt-cache shows the 5.2.5-0ubuntu6.1 for the bacula-server version.

James Page's log shows (http://bazaar.launchpad.net/~james-page/ubuntu/precise/bacula/fix-db-upgrade/revision/87#debian/rules) that it is missing the upgrade script which looks like it is not running the following:
/usr/share/dbconfig-common/data/bacula-director-mysql/upgrade/mysql/5.2.5-0ubuntu6.1

If you can check the file exists, you should be able to run it by hand as a worst-case fallback.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.