Page 1 of 2

Unable to delete Zone

Posted: Wed Aug 17, 2022 10:29 am
by swolsen
Running 1.36.24
Altered camera resolution and noticed only zone for that camera no longer was lined up correctly. Tried to edit the zone and when trying to save it reverts back to what was there. Created a new Zone and tried to delete the "corrupt one" to no avail.

Getting these in the web_php.log

Code: Select all

8/17/22, 6:31:43 AM EDT.080442 web_php[1955].ERR [192.168.54.88] [socket_sendto( /run/zm/zms-232759s.sock ) failed: Connection refused] at /usr/share/zoneminder/www/includes/functions.php line 1880
8/17/22, 6:32:32 AM EDT.002633 web_php[1823].ERR [192.168.54.88] [SQL-ERR 'SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction', statement was 'DELETE FROM `Zones` WHERE Id=?' params:5] at /usr/share/zoneminder/www/includes/database.php line 161
8/17/22, 6:32:52 AM EDT.049652 web_php[1867].ERR [192.168.54.88] [socket_sendto( /run/zm/zms-716750s.sock ) failed: Connection refused] at /usr/share/zoneminder/www/includes/functions.php line 1880
8/17/22, 6:33:41 AM EDT.568599 web_php[1986].ERR [192.168.54.88] [SQL-ERR 'SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction', statement was 'DELETE FROM `Zones` WHERE Id=?' params:5] at /usr/share/zoneminder/www/includes/database.php line 161
8/17/22, 6:38:25 AM EDT.440095 web_php[1402].ERR [192.168.54.88] [socket_sendto( /run/zm/zms-999415s.sock ) failed: Connection refused] at /usr/share/zoneminder/www/includes/functions.php line 1880
8/17/22, 6:39:12 AM EDT.266573 web_php[1883].ERR [192.168.54.88] [SQL-ERR 'SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction', statement was 'DELETE FROM `Zones` WHERE Id=?' params:5] at /usr/share/zoneminder/www/includes/database.php line 161
8/17/22, 6:41:37 AM EDT.801100 web_php[1577].ERR [192.168.54.88] [socket_sendto( /run/zm/zms-984299s.sock ) failed: Connection refused] at /usr/share/zoneminder/www/includes/functions.php line 1880
8/17/22, 6:42:26 AM EDT.541492 web_php[2074].ERR [192.168.54.88] [SQL-ERR 'SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction', statement was 'DELETE FROM `Zones` WHERE Id=?' params:5] at /usr/share/zoneminder/www/includes/database.php line 161

Re: Unable to delete Zone

Posted: Wed Aug 17, 2022 1:56 pm
by iconnor
Okay, so here's the problem: mysql sucks.

At some point, we added foreign keys to some tables and so if you want to delete a zone, it has to delete entries in Stats table that reference it. This means that mysql wants to lock the Stats table, which links to Events and Frames and Monitors and basically ALL the tables must be locked.

If you stop ZoneMinder, your delete will probably succeed and then you can restart it.

Or, we will have to remove the foreign keys (which I am considering doing in 1.37.21).

Re: Unable to delete Zone

Posted: Thu Aug 18, 2022 12:23 pm
by swolsen
Ok I will give it a try later. Thanks.

Re: Unable to delete Zone

Posted: Mon Nov 07, 2022 10:14 am
by karsta62
Did not work on v1.36.31 :-(

Re: Unable to delete Zone

Posted: Mon Nov 07, 2022 10:26 am
by Magic919
Probably a different situation. You might see an error in your logs like 'actions can no longer be performed without POST.'

Have a look here viewtopic.php?t=32122

Re: Unable to delete Zone

Posted: Wed Nov 09, 2022 7:14 am
by karsta62
Magic919 wrote: Mon Nov 07, 2022 10:26 am Probably a different situation. You might see an error in your logs like 'actions can no longer be performed without POST.'

Have a look here viewtopic.php?t=32122
You are right. I'll live with this until the v1.36.32 version. And beyond if needed :-)

Re: Unable to delete Zone

Posted: Wed Nov 09, 2022 8:19 am
by Magic919
It's just a quick edit if you want to 'fix' it. Change one word.

Re: Unable to delete Zone

Posted: Wed Nov 09, 2022 4:20 pm
by jogo
Or, we will have to remove the foreign keys (which I am considering doing in 1.37.21).
I think so, too. I am currently developing a business application with telephony, etc, where we are testing MariaDB/Galera and MongoDb with replica sets (i.e. multi-master). So far I have not seen an urgent need to implement foreign keys and the somewhat differently constructed docs inside collections in Mongo are rather pleasant to work with. Replica sets are not only about failure safety, btw.

On the other hand I do not have any difficulties with a single MySQL DB on a system with an older 4 core Xeon CPU and about 20 cams (mostly 720p). Before I'd switch to dogmatic SQL, I'd move to a bunch of noSQL DBs.

Re: Unable to delete Zone

Posted: Fri Nov 11, 2022 12:29 pm
by karsta62
Magic919 wrote: Wed Nov 09, 2022 8:19 am It's just a quick edit if you want to 'fix' it. Change one word.
Sure, but I didn't quite get where/how to do it. What does "Edit the zones view" mean exactly?
Is it code, or html file or in the database or what?
Found it on the page code using chrome's ctrl-c editor, but can't save or anything.

Re: Unable to delete Zone

Posted: Fri Nov 11, 2022 1:22 pm
by Magic919
It's this file on my system -

Code: Select all

/usr/share/zoneminder/www/skins/classic/views/zones.php

Re: Unable to delete Zone

Posted: Sat Nov 12, 2022 7:40 am
by karsta62
Oh cool. Thanks.
Found it, edited it, restarted zoneminder, but it did not do the trick. Still unable to delete zones.
And still getting "ERR actions can no longer be performed without POST"

Re: Unable to delete Zone

Posted: Sat Nov 12, 2022 3:50 pm
by Magic919
You must have done it wrong.

Re: Unable to delete Zone

Posted: Sun Nov 13, 2022 7:30 am
by karsta62
I guess so too, but I used vi to edit end systemctl to restart zoneminder and now:

# grep method /usr/share/zoneminder/www/skins/classic/views/zones.php
<form name="contentForm" id="contentForm" method="opt" action="?">

I don't know any other way to do it :(

Re: Unable to delete Zone

Posted: Sun Nov 13, 2022 7:42 am
by Magic919
Isaac in the other thread said

Edit the zones view and change the method="get" to method="post" in the form tag.

Try that.

Re: Unable to delete Zone

Posted: Sun Nov 13, 2022 8:41 am
by karsta62
Oh my crap!!
I have eyes made of wood....
Thank you guys. Works now....oh I feel so stupid....