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
MySQL 5.6 compatibility issues #649
Comments
Using zm1.28.03 - Also, cannot write to the Database: Full error from /var/log/messages: Full error from REMOTE MySQL /var/log/mysqld.log: |
Ok, first off... 1.28.03 doesn't exist. We havn't release 1.28.1, so what are you running, on what distro? |
Sorry. Using your distro: rpm -q zoneminder I just imported the zm_create.sql manually. That way there were no issues on initial creation. |
Issue still present when Zoneminder is using PHP 5.5.18 |
zmc -m means something is wrong as it should have a number for the monitor, so zmc -m 1 runs zmc for Monitor 1. Assuming you can't write to db is as per your second post, maybe this error is caused by DB being as per setup and can't update monitor and config settings. |
This is my zm.conf, MySQL priveleges, and errors I get on writing. cat /etc/zm.confPath to installed data directory, used mostly for finding DB upgrade scripts MySQL Priveleges on 10.1.22.23| Grants for zoneminder@% | |
I started with zoneminder 1.2.6.5 SQL-ERR 'Field 'User' doesn't have a default value', statement was 'insert into Monitors set LinkedMonitors = '', Name = 'Monitor-51', Type = 'Remote', Function = 'Monitor', Enabled = '1', RefBlendPerc = '6', AlarmRefBlendPerc = '3', MaxFPS = '', AlarmMaxFPS = '', Device = '/dev/video0', Channel = '0', Format = '255', Palette = '0', LabelFormat = '%N - %d/%m/%y %H:%M:%S', LabelX = '0', LabelY = '0', ImageBufferCount = '50', WarmupCount = '25', PreEventCount = '25', PostEventCount = '25', StreamReplayBuffer = '1000', AlarmFrameCount = '1', Controllable = '0', ControlId = '', ControlDevice = '', ControlAddress = '', AutoStopTimeout = '', TrackMotion = '0', TrackDelay = '', ReturnLocation = '-1', ReturnDelay = '', EventPrefix = 'Event-', SectionLength = '600', FrameSkip = '0', FPSReportInterval = '1000', DefaultView = 'Events', DefaultRate = '100', DefaultScale = '100', WebColour = 'red', SignalCheckColour = '#0000c0', Protocol = 'http', Method = 'simple', Host = 'usern:passw@10.1.22.29', Port = '80', Path = '/mjpg/video.mjpg', Colours = '3', Width = '320', Height = '240', Orientation = '0', Deinterlacing = '0', Sequence = 50' Moving onto ZM 1.27 then 1.28 |
On ZM 1.28.0-3Having a hard time debugging. Turned up the output to a level "9" and I enabled debugging. Debug message is /var/log/messages Anything else I can try? |
On ZM 1.27I started a new VM with RPM install of Zoneminder 1.27 from zmrepo. Using PHP 5.3 and remote DB MySQL 5.6 First step, enable debugging and level "9" Create new monitor, and error Database seems to be installed correctly. |
I would say we should focus on 1.28 as most current release, I know you are trying to get a running version but swapping around is just confusing things. |
Scratch that they are the same when I looked again. |
When I created the new ZoneMinder 1.28 I changed it since the other db was ZoneMinder is installed using default zmrepo rpm. I have tested both php 5.3 and 5.5. On Fri, Jan 9, 2015, 3:29 PM Steve Gilvarry notifications@github.com
|
My environment is virtual. ZoneMinder is installed using default zmrepo rpm. I have tested both php 5.3 and 5.5 I edit the /etc/zm.conf for the remote db credentials |
Centos I have not played with but I will have a look as I can bring up some VMs quickly over the weekend. Not sure if I can help much but willing to try and see if I get same issues. I think it is going to be db connection related, @connortechnology is it ok to change DB post make or generally something as part of the build? |
If you want to pass me on credentials, I'd be happy to remote in and check on this issue. |
Business environment. Can't get you through the firewall On Fri, Jan 9, 2015, 3:54 PM Kyle Johnson notifications@github.com wrote:
|
I don't know what's going on... but from what I've of the logs it looks like mysql is being pedantic about empty fields vs undefined(NULL) fields... I may try to bring up a vm wit 5.6 too.. but... anything non-debian is low for me. |
I am pretty sure that I have this same issue but with a bit different environment: Opensuse 13.2, mysql 5.6.17 (mariadb) , php 5.6.1 and zoneminder 1.28 I have described my issues and findings in the zonminder forums (http://www.zoneminder.com/forums/viewtopic.php?f=32&t=22813&sid=f63f9cf02712a0c5cab3ea4cf8666ce3) I will do som more debuging this weekend and report findings here... But my current gut feeling is also that is has something to do with how php/mysql combo handles NULL fields PS. my system is private so I could give access to one of you developers if that would help... |
I can't access my system over the weekend, but I see MySQL 5.6 introduced a default strict mode. P.S. |
strict_trans_tables seems like the likely cause, turned it on on mysql5.5 and can no longer add monitors. I couldn't find a definitive reference for our case, but I did find some stuff talking about Insert and Updates with Not Null fields would throw this error. But documentation seemed to indicate this would only occur if a Default was not defined, but we do have empty string ''. I could see strict would not work with the implied Defaults, i.e. int is implied as 0 and varchar implied as '' if no Default specified, but should be OK using explicit Defaults to fill values not given. |
strict_trans_tables may be part of the problem, but it is not the complete problem. In the build instructions for opensuse you ar instructed to comment out this line in my.conf: sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES So i AM running mysql with STRICT_TRANS_TABLES turned off, and still have problems. |
Just discovered that I am NOT using mariadb, but mysql-community-server. |
Mmmmm very odd thought this was bang on. Before I bail on this option, can I ask you to indulge me and try sql_mode='' instead of just commenting out. |
I repeat: Assumptions is the mother of all f... ups! It turned out that the mysql installation does not use /etc/my.cnf as config file, but /usr/my.cnf Commented out the line there and then before restart: mysql> SELECT @@GLOBAL.sql_mode; mysql> SELECT @@SESSION.sql_mode; After restart: mysql> SELECT @@GLOBAL.sql_mode; mysql> SELECT @@SESSION.sql_mode; And now things seems to work nicely... |
Good news so sounds like a confirmed workaround as per @newburns suggestion, but discussion around the correct fix to allow Strict is needed. Could be change field away from NOT NULLS, or ensure Insert and Update pass all values that are set as NOT NULL. We cannot be the first to hit the problem, but couldn't find any good discussions on resolving it. |
@jornmoe Please do not make false statements in the forum that it is "dead". Just because you didn't get the answer you wanted from the forum does not mean it is dead. |
Maybe dead is a bit harsh, and thats why i put it within exclamation marks. And my current impression and experience is that the developers have their attention to issues in github, not in the forum. Nothing wrong about that, but it would be nice if this was "documented" in the forum as I think most forum users hardly know that there excists discussions/issues at github that can be relevant for them. And I actually had to go here to fin an answer to my problems. Also the comment of newburns saying: Made me draw the conclution that most developers does not pay attention to the forums any more! |
Between @jornmoe and I, we can definitely say we appreciate everyone's assistance. The few that can be called developers are essential to this community, and we thank you. |
If there are no cases where the db should accept "" instead of NULL, then I can quickly add a line to the db wrapper that looks for "" and replaces it with null. As to the zoneminder.com forum, I for one check it mostly every day. I don't have answers to everyone's problems though. |
I thought the problem was that zm tries to put NULL in NOT NULLS fields. With STRICT_TRANS_TABLES turned on, the transaction will then fail. Inserting empty string or 0 would resolve that. But one should really be considering whether all NOT NULLS fields really needs to be NOT NULLS? Reducing number of fields with that attribute would afaik reduce the imnpact of STRICT_TRANS_TABLES turned on. Also setting defaults to NOT NULLS will override if Field is left empty. Actually, a field with NOT NULLS will accept a default of NULL as the default overrides NOT NULLS. At least that was what a mysql expert told me at work :-P |
I seem to recall that NOT NULL was actually a performance enhancer for mysql.... The problem if you will go back up to the original post is that we are entering '' into an integer field. '' is not a valid integer. It is also, not a NULL value. Hence the error. |
So the solution is to replace " with a 0 inside all the scripts? Where are the scripts, I'll start changing them now. What I'm assuming is that all of the scripts are "if null then " and I just change to "if null then 0" |
I think it comes down to this, and it is something that I've also experienced in working with my new frontend. |
I don't there is anything wrong with updating all fields. That's how it works internally to the database anyways. And no, don't replace '' with 0. If you do that, then fields that should be '' will become '0' |
still an issue, users get added to database just fine but monitors don't |
@hrwebasst We are going need more information that just "this is still an issue". What distro are you using? What version of ZoneMinder are you using? How did you install ZoneMinder onto your system? What have you tried to get around the problem? Did you read through this thread and attempt to make the suggested changes to your mysql config? What do your logs say? I'm running mysql 5.6 on Fedora 21 and have not experienced any database issues. So far, this looks to be a database configuration issue, but without providing more data we don't have anyway to assist any further. |
Sorry about that, I thought it was discussed that this is an issue with "default strict mode"... Adding monitors doesn't happen until I run: |
Closing due to inactivity |
So far using a REMOTE MySQL 5.6 the following issues have arose:
1.) Using zm1.28.03 - Initial error on column SCORE in FRAMES table. Had to remove the (unsigned) attribute in order for it to work temporarily. Not suggesting this for a fix, but this was the temp solution.
Full error from /var/log/messages:
ERR [Can't insert frame: Out of range value for column 'Score' at row 1]
2.) Using zm1.26.5 - Must have a MaxFPS and AlarmFPS set for all new/updated cameras. The single " is an incorrect decimal value. Not sure how to fix it, but I use a hard number like 32. Assuming that I would never use a 60fps camera for security.
Full error from in Screen:
SQL-ERR 'Incorrect decimal value: '' for column 'MaxFPS' at row 1', statement was 'update Monitors set MaxFPS = '', Triggers = '' where Id = '1';
The text was updated successfully, but these errors were encountered: