Bareos Bug Tracker
Bareos Bug Tracker

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000705bareos-core[All Projects] directorpublic2016-10-07 12:242017-12-18 12:11
Reporterjoergs 
Assigned To 
PrioritylowSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version17.2.4 
Summary0000705: create_bareos_database fails on MySQL 5.7
DescriptionCalling the script against a MySQL 5.7 database results in following error messages:

Making mysql tables
ERROR 1067 (42000) at line 88: Invalid default value for 'CleaningDate'
ERROR 1067 (42000) at line 107: Invalid default value for 'SchedTime'
ERROR 1067 (42000) at line 140: Invalid default value for 'SchedTime'
ERROR 1067 (42000) at line 180: Invalid default value for 'Date'
ERROR 1067 (42000) at line 192: Invalid default value for 'CreateTime'
ERROR 1067 (42000) at line 215: Invalid default value for 'FirstWritten'
ERROR 1067 (42000) at line 310: Invalid default value for 'Time'
ERROR 1171 (42000) at line 379: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead
Creation of Bareos MySQL tables succeeded.
Additional InformationThe Bareos database creation script set DATETIME columns by default to 0, which is no longer allowed in MySQL 5.7:

e.g. "SchedTime DATETIME DEFAULT 0,"

The other problem is at

CREATE TABLE Quota (
   ClientId INT UNSIGNED DEFAULT NULL,
   GraceTime BIGINT DEFAULT 0,
   QuotaLimit BIGINT UNSIGNED DEFAULT 0,
   PRIMARY KEY (ClientId)
);

This results into the error message:
All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead
TagsNo tags attached.
bareos-master: impactyes
bareos-master: actionfixed
bareos-18.2: impact
bareos-18.2: action
bareos-17.2: impactyes
bareos-17.2: actionfixed
bareos-16.2: impactyes
bareos-16.2: actionnone
bareos-15.2: impactyes
bareos-15.2: actionnone
bareos-14.2: impactyes
bareos-14.2: actionnone
bareos-13.2: impactyes
bareos-13.2: actionnone
bareos-12.4: impactyes
bareos-12.4: actionnone
Attached Filespatch file icon 0001-updated-MySQL-creation-schema-to-current-standards.patch [^] (7,801 bytes) 2017-05-03 15:48 [Show Content]

- Relationships
has duplicate 0000660closed MySQL DDL files use wrong syntax 
has duplicate 0000809closed MySQL errors on Installation 
has duplicate 0000842closedjoergs Cannot create database anymore on MySQL 5.17 and higher 
child of 0000861closedjoergs Release bareos-17.2.4 

-  Notes
(0002375)
joergs (administrator)
2016-10-07 12:27

It is planed to fix this someday in the future. For now, we recommend to use MariaDB instead (which is also the default on most Linux distributions).
(0002526)
bareos_user (reporter)
2017-01-23 22:33

Is there any workaround for those of us who are stuck with MySql >=5.7 ?

When I run a job. I get this error:
JobId 0: Fatal error: sql_create.c:97 Create DB Job record INSERT INTO Job (Job,Name,Type,Level,JobStatus,SchedTime,JobTDate,ClientId,Comment) VALUES ('MyBackup.2017-01-23_15.27.15_46','MyBackup','B','F','C','2017-01-23 15:27:11',1485203231,3,'') failed. ERR=Incorrect datetime value: '0000-00-00 00:00:00' for column 'StartTime' at row 1

It's been 4 months since this was last reported. I guess someone would have come up with a workaround.
(0002540)
Andreas.vdL (reporter)
2017-01-30 11:46

I fixed it under Ubuntu 16.04.1 with MySQL 5.7.17 by manuipulating the create-File under "/usr/lib/bareos/scripts/ddl/creates/mysql.sql"

The date-problem could be fixed by
"sed -i 's/DATETIME DEFAULT 0/DATETIME DEFAULT CURRENT_TIMESTAMP/g' mysql.sql"
I think that an older date at creation time ist not necessary.

There are two other options (NDMP...) with an wrong value of 256 and should be 255.
"CONSTRAINT NDMPLevelMap_pkey PRIMARY KEY (ClientId, FilesetId, FileSystem(255))"
"CONSTRAINT NDMPJobEnvironment_pkey PRIMARY KEY (JobId, FileIndex, EnvName(255))"

Hope this helps.
(0002558)
bareos_user (reporter)
2017-02-10 16:22

Thanks Andreas.vdL.

I used the following workaround -

1. vim /etc/mysql/mysql.conf.d/mysqld.cnf

2. add/update
sql_mode=NO_ENGINE_SUBSTITUTION
(remove STRICT_TRANS_TABLES)
(0002561)
jacknob (reporter)
2017-02-14 10:40

Moving to MySQL 5.7 and PHP7.0, I experienced the same for sql statements throughout our systems. Once we upgraded bareos from 15.x to 16.x
I noticed the problems here.
I highly suggest to integrate a solution as suggested by @Andreas.vdL

MariaDB might be nice, but many people out there (like us) are using MySQL. It is well known and handles large amounts of bareos clients (like in our companies).
(0002562)
joergs (administrator)
2017-02-14 10:44

So maybe somebody can provide a patch/github pull request?
(0002633)
Keksdose (reporter)
2017-05-03 15:49

I just attached a patch which will fix the issue with MySQL >= 5.7.
(0002839)
joergs (administrator)
2017-12-14 12:43

That you for the patch. We included it in bareos-17.2.
(0002842)
joergs (administrator)
2017-12-18 12:11

Patch integrated and tested against bareos-regress against, MariaDB, MySQL 5.5 and MySQL 5.7.

- Related Changesets
bareos: bareos-17.2 964ef032
Timestamp: 2017-05-03 15:35:09
Author: mpiejh
Committer: joergs
Ported: N/A
Details ] Diff ]
updated MySQL creation schema to current standards
mod - src/cats/ddl/creates/mysql.sql Diff ] File ]

- Issue History
Date Modified Username Field Change
2016-10-07 12:24 joergs New Issue
2016-10-07 12:25 joergs Relationship added related to 0000660
2016-10-07 12:27 joergs bareos-master: impact => yes
2016-10-07 12:27 joergs bareos-master: action => will care
2016-10-07 12:27 joergs bareos-16.2: impact => yes
2016-10-07 12:27 joergs bareos-15.2: impact => yes
2016-10-07 12:27 joergs bareos-15.2: action => none
2016-10-07 12:27 joergs bareos-14.2: impact => yes
2016-10-07 12:27 joergs bareos-14.2: action => none
2016-10-07 12:27 joergs bareos-13.2: impact => yes
2016-10-07 12:27 joergs bareos-13.2: action => none
2016-10-07 12:27 joergs bareos-12.4: impact => yes
2016-10-07 12:27 joergs bareos-12.4: action => none
2016-10-07 12:27 joergs Note Added: 0002375
2017-01-23 22:33 bareos_user Note Added: 0002526
2017-01-30 11:46 Andreas.vdL Note Added: 0002540
2017-02-10 16:22 bareos_user Note Added: 0002558
2017-02-14 10:40 jacknob Note Added: 0002561
2017-02-14 10:44 joergs Note Added: 0002562
2017-05-03 15:48 Keksdose File Added: 0001-updated-MySQL-creation-schema-to-current-standards.patch
2017-05-03 15:49 Keksdose Note Added: 0002633
2017-11-28 12:31 joergs Assigned To => joergs
2017-11-28 12:31 joergs Status new => assigned
2017-11-28 12:31 joergs bareos-17.2: impact => yes
2017-11-28 12:31 joergs bareos-17.2: action => will care
2017-11-28 12:31 joergs bareos-16.2: action => none
2017-11-28 12:32 joergs Relationship added has duplicate 0000809
2017-11-28 12:33 joergs Relationship replaced has duplicate 0000660
2017-11-28 12:35 joergs Relationship added has duplicate 0000842
2017-12-14 12:41 joergs Changeset attached => bareos bareos-17.2 964ef032
2017-12-14 12:43 joergs bareos-master: action will care => fixed
2017-12-14 12:43 joergs bareos-17.2: action will care => fixed
2017-12-14 12:43 joergs Note Added: 0002839
2017-12-14 12:43 joergs Status assigned => resolved
2017-12-14 12:43 joergs Fixed in Version => 17.2.4
2017-12-14 12:43 joergs Resolution open => fixed
2017-12-18 12:05 joergs Relationship added child of 0000861
2017-12-18 12:11 joergs Note Added: 0002842
2017-12-18 12:11 joergs Status resolved => closed
2017-12-18 12:11 joergs Assigned To joergs =>


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker