On 04/30/18 09:43, Ken Mandelberg wrote:
> I did a Ubuntu update from 16.04 to 18.04. The automatic Bacula update
> as part of the OS upgrade partially failed.
>
> After the upgrade I found myself with
>
> bacula-dir JobId 0: Fatal error: Version error for database "bacula".
> Wanted 16, got 14
>
> So I ran
>
> /usr/share/bacula-director/update_mysql_tables
>
> I had to change db_name in the script to "bacula", but it seemed to have
> worked and the the director was able to start.
>
> However, when it was time for its first backup job
>
> 29-Apr 23:05 orac-dir JobId 0: Fatal error: sql_create.c:84 Create DB
> Job record INSERT INTO Job
> (Job,Name,Type,Level,JobStatus,SchedTime,JobTDate,ClientId,Comment)
> VALUES
> ('BackupClient1.2018-04-29_23.05.00_03','BackupClient1','B','D','C','2018-04-29
>
> 23:05:00',1525057500,1,'') failed. ERR=Incorrect datetime value:
> '0000-00-00 00:00:00' for column 'StartTime' at row 1
> 29-Apr 23:10 orac-dir JobId 0: Fatal error: sql_create.c:84 Create DB
> Job record INSERT INTO Job
> (Job,Name,Type,Level,JobStatus,SchedTime,JobTDate,ClientId,Comment)
> VALUES
> ('BackupCatalog.2018-04-29_23.10.00_04','BackupCatalog','B','F','C','2018-04-29
>
> 23:10:00',1525057800,1,'') failed. ERR=Incorrect datetime value:
> '0000-00-00 00:00:00' for column 'StartTime' at row 1
>
> The new version is Version: 9.0.6 (20 November 2017). Not sure what the
> old version was.
This most likely means that Ubuntu 18.04 updated you to MySQL 5.7 or its
MariaDB equivalent (10.2.x).
Find your MySQL/MariaDB configuration file[s] and look for the line that
sets SQL_MODE. (There may not be one, especially if you've never tuned
it.) Log into MySQL and run this query:
SELECT @@GLOBAL.sql_mode;
Take the result, REMOVE the terms NO_ZERO_DATE and NO_ZERO_IN_DATE, and
set what is left as your new SQL_MODE. For example:
SET GLOBAL sql_mode =
'STRICT_ALL_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
(If in doubt, the above example is a good starting point.)
Add a line to your MySQL configuration setting the same, so that it will
persist across restarts:
SQL_MODE = STRICT_ALL_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
(This goes in the [mysqld] section)
This should get you up and running. You probably want to restart Bacula
just to be safe.
--
Phil Stracchino
Babylon Communications
[email protected]
[email protected]
Landline: +1.603.293.8485
Mobile: +1.603.998.6958
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users