SQL-ERR after update

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
tigerA
Posts: 12
Joined: Thu Sep 27, 2018 6:35 am

SQL-ERR after update

Post by tigerA »

Hi.

After update to Fedora 30/Zoneminder 1.34 I had seen in logs:
SQL-ERR 'SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'StorageId' cannot be null', statement was 'UPDATE Events SET `Id`=?, `Name`=?, `MonitorId`=?, `StorageId`=?, `SecondaryStorageId`=?, `Cause`=?, `StartTime`=?, `EndTime`=?, `Width`=?, `Height`=?, `Length`=?, `Frames`=?, `AlarmFrames`=?, `DefaultVideo`=?, `SaveJPEGs`=?, `TotScore`=?, `AvgScore`=?, `MaxScore`=?, `Archived`=?, `Videoed`=?, `Uploaded`=?, `Emailed`=?, `Messaged`=?, `Executed`=?, `Notes`=?, `StateId`=?, `Orientation`=?, `DiskSpace`=?, `Scheme`=?, `Locked`=? WHERE Id=?' params:2417291,Event-ip02- 2417291,2,,,Continuous,2020-01-21 11:10:00,2020-01-21 11:20:00,1280,800,600.05,4777,,2417291-video.mp4,0,0,0,0,0,1,0,0,0,0,,1,ROTATE_0,320632263,Medium,0,2417291

Options->Storage->id = 0
lightenup
Posts: 14
Joined: Mon Oct 22, 2018 6:36 pm

Re: SQL-ERR after update

Post by lightenup »

I see the same error but it is only when I am in the montage review page. Otherwise, everything works fine.
User avatar
iconnor
Posts: 2900
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: SQL-ERR after update

Post by iconnor »

Your db's must have come from a time during development. There was a time when that column was NOT NULL. Nowadays we allow it to be null.

Actually looking at the db update scripts, I may have screwed this up.

So the following sql code will change it to allow NULLs but I will have to look into side effects before including in 1.34.10


ALTER TABLE Events MODIFY `StorageId` smallint(5) unsigned default 0;
lightenup
Posts: 14
Joined: Mon Oct 22, 2018 6:36 pm

Re: SQL-ERR after update

Post by lightenup »

I made the db change suggested and it fixed my issue! I will post back if I see any issues crop up.

Thanks again!
Post Reply