On 05/03/18 03:54, Peter Grupe wrote:
> Since a few days Bacula isn't able to create new jobs.
> 
> I got this error:
> 
> 25-Apr 23:15 ftirtaper-dir JobId 0: Fatal error: sql_create.c:90 Create 
> DB Job record INSERT INTO Job 
> (Job,Name,Type,Level,JobStatus,SchedTime,JobTDate,ClientId,Comment) 
> VALUES 
> ('Ftirrd02_2-Backup.2018-04-25_23.15.00_53','Ftirrd02_2-Backup','B','F','C','2018-04-25
>  
> 23:15:00',1524690900,3,'') failed. ERR=Incorrect datetime value: 
> '0000-00-00 00:00:00' for column 'StartTime' at row 1
> 
> I run Bacula 7.0.5 with MySQL 5.7.22 on Ubuntu Server 16.04.4 LTS.

And that's the root of your problem.

> ERROR 1067 (42000): Invalid default value for 'SchedTime'
> 
> When I alter the default value of ShedTime to '1970-01-01 00:00:00' this 
> entry works but the error occurs with the next DATETIME entry StartTime.
> 
> Could you please help me to overcome this error in Bacula.


You can't fix it in Bacula without code changes.  You need to change
your MySQL configuration.  You need to remove the terms NO_ZERO_DATE and
NO_ZERO_IN_DATE from the SQL_MODE global variable.  You can do this
interactively, but you will need to add it to the config files in order
for it to persist across restarts.

Try the following as a safe default:

SQL_MODE = STRICT_ALL_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

in the config file, and:

SET GLOBAL SQL_MODE =
'STRICT_ALL_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';

in the running MySQL.



-- 
  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

Reply via email to