Upgrading Ubuntu Precise skips database version - Fatal error: Version error for database "bacula". Wanted 14, got 12
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bacula |
New
|
Undecided
|
Unassigned |
Bug Description
After upgrading Ubuntu from oneiric to precise the bacula software crashed with the error:
Please correct configuration file: /etc/bacula/
11-abr 09:45 bacula-dir JobId 0: Fatal error: Version error for database "bacula". Wanted 14, got 12
11-abr 09:45 bacula-dir JobId 0: Fatal error: Could not open Catalog "MyCatalog", database "bacula".
11-abr 09:45 bacula-dir JobId 0: Fatal error: Version error for database "bacula". Wanted 14, got 12
11-abr 09:45 bacula-dir ERROR TERMINATION
I need to run manualy the upgrade script /usr/share/
The table RestoreObject appeared that already created as equal the new column DeltaSeq in File table, but the VersionId field in table Version isn't updated. Delete this record and insert the new one with version updated fix the problem and now i can restart the director and all works OK.
Another (possibly easier) workaround would be to edit the update_mysql_tables script. Making the following changes worked for me:
Line 11: changed db_name to the name of my database. Ex: db_name=bacula
Line 13: added "-u bacula -p" after ${db_name} inline. The script was giving me errors running as root, so this logs into the database as bacula and prompts you for the database password. Ex: mysql $* -D {db_name} -u bacula -p -e "select VersionID from Version\G" >/tmp/$$
Line 24: added "-u bacula -p" after "$*" here also, just as with line 13. Ex: if mysql $* -u bacula -p -f <<END-OF-DATA
Now when you run the script, you will be prompted for the DB password twice. Enter it, wait a bit, and you should get an "Update of Bacula MySQL tables succeeded" message.