Hello,
when issuing label command, it fails when inserting a new record in the database. How can a fix this permanently?
Version is bareos-19.2.6
Msql version is Ver 5.7.31-0ubuntu0.18.04.1
Root cause: Mysql no longer accept a value of '0' for datetime fields. FirstWritten,LastWritten,LabelDate,InitialWrite are set to 0 per default.
Workaround: I inserted the row manually into the mysql database, setting the fields to utc_timestamp.
ErrorMessage:
label storage=TapeStorage1 pool=Tgvs2-Tape volume=Tgvs2Tape-6
Enter slot (0 or Enter for none): 6
Connecting to Storage daemon TapeStorage1 at qtron.fritz.box:9103 ...
Sending label command for Volume "Tgvs2Tape-6" Slot 6 ...
stored/block.cc:300 Volume data error at 0:0! Wanted ID: "BB02", got "". Buffer discarded.
3000 OK label. VolBytes=64512 Volume="Tgvs2Tape-6" Device="TapeDrive1" (/dev/nst0)
cats/sql_create.cc:489 Create DB Media record INSERT INTO Media (VolumeName,MediaType,MediaTypeId,PoolId,MaxVolBytes,VolCapacityBytes,Recycle,VolRetention,VolUseDuration,MaxVolJobs,MaxVolFiles,VolStatus,Slot,VolBytes,InChanger,VolReadTime,VolWriteTime,EndFile,EndBlock,LabelType,StorageId,DeviceId,LocationId,ScratchPoolId,RecyclePoolId,Enabled,ActionOnPurge,EncryptionKey,MinBlocksize,MaxBlocksize) VALUES ('Tgvs2Tape-6','DDS-4',0,14,26843545600,0,1,2592000,0,1,0,'Append',6,64512,1,0,0,0,0,0,1,0,0,0,0,1,0,'',0,0) failed. ERR=Incorrect datetime value: '0000-00-00 00:00:00' for column 'FirstWritten' at row 1
Do not forget to mount the drive!!!
Thanks
Tilman