New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERR: Can't insert frame: Out of range value for column 'Score' at row 1 #319
Comments
Yes, the schema looks right, and at the moment I don't have a good answer for you. More troubleshooting would be required. You could be getting that error because the Score had a value of -1 or Null, which of course begs the question how that happened. Since the Score field is associated with a motion event, I would take a closer look at exactly when this error occurs. Not sure you could get that error by simply adding a new monitor.... at the moment it seems more likely that you might have something out of the ordinary in your zone. |
My zone is the default, I did not change anything after I added the monitor. The settings show it has 100% pixel coverage and is of Type "Active". Is there something specific I should look for in the Zone definition? Also, if I'm not mistaken a MySQL smallint unsigned has an acceptable range of 0 - 65535. If you look at /src/zm_event.cpp (line 568): const char *frame_type = score>0?"Alarm":(score<0?"Bulk":"Normal"); score is an int that obviously can be set to a negative value (seemingly indicating "Bulk" frames). With my database schema, if ZM tries to insert Bulk frames with a negative score it will produce the out of range error. |
I went ahead and updated the MariaDB schema to the following for Frames.Score:
This fixed the issue. If I select from the Frames table for a specific event I see records like this:
I have no idea if this is a bug or just that the database schema does not match the new zm_event.cpp code. Judging by the fact that the frame type gets set to "Bulk" if the score is less than zero, I would assume the code is doing this intentionally. Maybe updating the schema to accept a signed value is all that's necessary. |
I use a remote MySQL 5.6 installation. I changed the /etc/zm.conf file to match my remote database, and I am using the latest zoneminder from zmrepo by @connortechnology |
Steps to ReproduceIt took a while to figure this out, but here are the steps to duplicate this issue:
If either of these are not true, the error will not manifest itself. BackgroundThis link sums up what is happening perfectly: The logic in zm_event.cpp has indeed been attempting to write a value of "-1" to the score dB column. However, due to a "feature" of mysql, the dB engine would automagically translate a "-1" to "0" when trying to stuff the value into a field of type unsigned int, without so much as giving a warning. The refereed link describes this perfectly. This, in effect, covered up a bug that has been there since day one. WorkaroundThe immediate workaround is to set Note that changing the field type to a signed int is not the recommended way to fix this. The Score, as written to the database, should always be >= 0. Permanent FixPR #1016 fixes this permanently by resetting score to 0 if it is less than 0. I would not be surprised if there are other parts of ZoneMinder that develop the same kind of problem. |
I'm using ZoneMinder to capture an mjpeg stream from an ITS camera. My company has been using ZoneMinder for years with OpenSUSE 11.4 with great success, but I'm trying to move to OpenSUSE 13.1.
I just setup a brand new OpenSUSE 13.1 machine (physical machine, not VM) and installed ZM from the repo (version 1.26.4). It's running in conjunction with MariaDB 5.5.33.
When I tried to add my camera, I am receiving an error from zma "Can't insert frame: Out of range value for column 'Score' at row 1". This is from /src/zm_event.cpp line 568.
The schema in MariaDB shows the following for column Score in table Frames:
Could you offer any assistance here? Have I configured something improperly? I would love to get this running with OpenSUSE 13.1 since it was just picked up by Evergreen and we are moving our servers in that direction.
Thanks!
The text was updated successfully, but these errors were encountered: