Strange problem: not able to creat or edit monitors (Solved)

Forum for questions and support relating to the 1.28.x releases only.
Locked
jfm
Posts: 46
Joined: Tue Mar 29, 2005 9:30 pm

Strange problem: not able to creat or edit monitors (Solved)

Post by jfm »

I am running 1.28.0 on opensuse 13.2

I upgraded from 1.26 running on opensuse 12.x and restored the complete database from this to the new installation and after some minor "adjustments" got everything up an running just fine. Have been running it for about 2 months like this now, and never had the need to add a new monitor or adjust settings on the existing monitors. However I just installed a new server, identical to my own setup, for a friend and when I tried to add a monitor it would just not create it. The configuration dialog closes without any error messages as if everything is ok. But no monitor is saved to the database. After troubleshooting on his installation, i decided to add his camera to my installation, but to my surprise it fails there too! I then tried to edit one of my existing monitors to use his camera, but it will not save changes. Still no error messages. There is nothing in mysql, apache or zoneminders logs indicating problems.

I have granted all rights to the zm database for the zmuser, so there should not be any user right problems.
Even changing "Function" from "None" to "Modect" does not work from the dialog for editing the monitor.
However, changing from "None" to "Modect" by using the smaller dialog when clicking "None" in the "Function" column works just fine for all monitors.
ALL other database operations in zonminder works AFAIK...

I can add or change monitors directly in mysql and all changes are visible in zoneminder.

I wish I could give some more details like output from logfiles, but honestly, I can't find anything that seems relevant. Does anyone have a clue why the "edit monitor" will not work when "change function" works? They access the same record in the database, so there must be a difference in how zoneminder accesses the records from within these two "methods" of altering the database records.
Last edited by jfm on Sun Jan 11, 2015 11:32 am, edited 1 time in total.
td
Posts: 20
Joined: Wed Sep 27, 2006 5:56 am
Location: Breckerfeld, Germany

Re: Strange problem: not able to creat or edit monitors

Post by td »

SAme with me with the same configuration (ZM1.28, openSuse 13.2, 64bit).

td
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Strange problem: not able to creat or edit monitors

Post by knight-of-ni »

I'm not sure the following is the appropriate fix for your issue or not. It's worth a shot:
http://www.zoneminder.com/forums/viewto ... 32&t=22671
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
jfm
Posts: 46
Joined: Tue Mar 29, 2005 9:30 pm

Re: Strange problem: not able to creat or edit monitors

Post by jfm »

Thanks for at least giving me something to try out 8) but no luck :(

Problem is not a display problem, but that nothing is saved to the database from the monitor settings "dialog". If I only could find the part of the code that is supposed to save to the database, I could at least try to do some debuging. I have tried to turn on maximum debuging in "Options - Logging ", but i can not find any relevant output in the debug logs :(

The strange thing is that changing "function" on a monitor by clicking the "function" link does work. And it writes to the same database record that the monitor settings should hav written to...
jfm
Posts: 46
Joined: Tue Mar 29, 2005 9:30 pm

Re: Strange problem: not able to creat or edit monitors

Post by jfm »

Just discovered that adding an alarm zone does not work either! :(
Editing an alarm zone seems to work though! :)
jfm
Posts: 46
Joined: Tue Mar 29, 2005 9:30 pm

Re: Strange problem: not able to creat or edit monitors

Post by jfm »

Ok, this is a much more serious problem than I first thought!

When trying to add a new monitor, the part of the code that creates the "default" alarm zone to the monitor actually creates the alarm zone, but set the monitor id for the zone to 0 (zero).

When i looked at the zones table in the database there were 16 zones with monitor id = 0. All of these a result of trying to add monitors, but no monitors were saved to the monitors table in the database.

I added a monitor directly in the database and made that work with a camera. As ther were no alarm zone for that monitor I tried to add an alarm zone from within zonminder, but the alarm zone did not save to the database. When I then was going to add an alarm zone in the database, to my surprise, there were already a lot of zones ther, but as I said above, I discoverd that these had monitor id = 0 and was created when I tried to creat a monitor...

Altering an alarm zone from within zm does not work either.

There is someting really strange stuff going on here. I read somewhere about a php-mysqlnd module which is needed (or preffered?), but I do not have that, but i have php5-mysql module. PHP is version 5.6.1-4.1 (opensuse 13.2)
Could this be the problem? I buildt zm from source (pulled latest release from the git repo) with: cmake -DZM_TARGET_DISTRO="OS13" and have managed to add all modules an optional modules and it compiled with no errors, but with the usual random warnings "all over the place".
jfm
Posts: 46
Joined: Tue Mar 29, 2005 9:30 pm

Re: Strange problem: not able to creat or edit monitors

Post by jfm »

I have not had much time to debug, and it's kind of hard when I do not know where in the code to look, but I discovered that I CAN actually edit alarm zones IF none of the fields in the record is 'NULL'. Wich leads me to think there is some fundamental difference in how records are created and updated in the "combo" i have now (I.e. Opensuse 13.2 - PHP 5.6 - Zoneminder1,28) compared to my previous setup (opensuse 12.x - php 5.4 (i think) - Zoneminder 1,26)? I suspect so because creating and editing both zone records and monitor records with NULL in some fields used to work with my old setup.

If i use phpMyAdmin to update a record which contains fields with value 'NULL' in a filed/column that has "not null" attribute" everything worke fine, as long as that field/column is not touched. All fields that I do touch is updated. Same if I from comandline log in to mysql server and use something like: update Monitors set path ='/cam/realmonitor' where id = 3.

But If i use Webmin to update the same record, it complains about Subpath (or some other field with "not null" attribute) can not be 'NULL' if it already contains 'NULL'. How the 'NULL' value got ther in the first place is a different story...

I guess webmin is "dumb" and tries to update all fields even if not changed, and phpMyAdmin is "smart" and only updates the fields that are changed.

Now, my questions:
1 Is Zoneminder "dumb" or "smart" when creating and updating database records, or is Zoneminder "dumb" in some places and "smart" in som other places?

2 Would it hurt to alter the database scheme to allow all fields/columns to be NULL?

3 Am I on to something or is this just a shot in the dark? 8) :)
jfm
Posts: 46
Joined: Tue Mar 29, 2005 9:30 pm

Strange problem: not able to creat or edit monitors (Solved)

Post by jfm »

In the distro instructions it says to comment out the following line in my.cnf:

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

I had done this in /etc/my.cnf but it turned out that mysql used /usr/my.cnf

Commenting out the line in this file solved my problems.

PS. It turns out that this forum is pretty much "dead" regarding getting help from developers. The developers now hang out on github: https://github.com/ZoneMinder/ZoneMinder/issues
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Strange problem: not able to creat or edit monitors (Sol

Post by knight-of-ni »

jfm, your last statement is not true at all. And I don't particularly appreciate claims that "this forum is dead" when I spend hours of my time answering questions each week. Do a search on me for example and you will see the responses.

The forums should be used for general configuration type errors and github is intended strictly for bug reporting. Naturally, it may not be clear what type of issue you are facing initially, so just post in one or the other.

There are only a few of us whom you could call "developers" and we each do this on a part time volunteer basis. Zoneminder's community is quite large, and it is not possible for the few of us to keep up AND continue to develop zoneminder. If you want something to change then that means you need to step up and help out.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
jfm
Posts: 46
Joined: Tue Mar 29, 2005 9:30 pm

Re: Strange problem: not able to creat or edit monitors (Sol

Post by jfm »

knnniggett, first of all, it is not easy to know who are developers and who ar users here. I know that YOU do reply a lot to questions here, but I am a bit disappointed that I had to find out for my self that there actually is discussions on github that were relevant to my problem and to others problems as well. It would be very nice to have "sticky" topic at the forums stating that bug reports and issues can be found at github, and that one should look there for solutions befor starting a topic in this forum.

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.

I have donated to the zoneminder project, althoug it was a long time ago. I will probably donate in near future because of the support I just got. And I think happy users make more donations, so it would be in the developers interest to keep users happy. And informed useres are more happy than non informed users.

PS. I DO try to help the best I can if I see someone struggle with something I know the answer to. But It is confusing when there ar two "arenas" to keep up with!
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Strange problem: not able to creat or edit monitors (Sol

Post by knight-of-ni »

You can think of github as the place to go to report and track bugs. Whereas the forum is the place to go to ask configuration questions or learn how to use the application.

Ubuntu, for example, is set up the same way. One reports bugs to bugs.launchpad, but general questions go to the Ubuntu forums.

My concern isn't you in particular (I think you did the right thing by first posting in the forum and then moving the conversation to github), but I'm concerned about others who might read this thread. We don't want others to get the idea that everything should get posted into github because the developers don't read the forums. That simply isn't true.

We do however want to separate, as best we can, issues that may require changes to the source code and other issues that do not. That is why we live in two places. It helps to make our job easier.

And you are absolutely right about the documentation. While we have total control of our github site, the zoneminder.com domain is still owned by Phil. This isn't necessarily a bad thing, but it has created some communication difficulties on the zoneminder.com site. For example, until last week, we didn't have permission to do anything a normal use could not do.... so things like stickies and announcements were not possbile. Now that I have admin privileges, you can expect better communication from us moving forward.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
Nerre
Posts: 100
Joined: Thu Sep 25, 2014 10:22 am

Re: Strange problem: not able to creat or edit monitors (Sol

Post by Nerre »

One could say that the forum is a place to get help. Whether the help comes from the developers or other users shouldn't matter. Users helping other users means the developers can focus on developing instead of helping users.

Usually developers of Open Source Software aren't much helped by monetary donations, what limits development is available time. Donations may be useful to pay for domains, servers etc, but the actual development work isn't really helped unless the donations are large enough to allow the developers to quit their ordinary jobs.
Locked