Unable to delete Zone

Discussions related to the 1.36.x series of ZoneMinder
User avatar
swolsen
Posts: 31
Joined: Sat Mar 20, 2021 9:39 pm
Location: Schenectady, NY, USA

Unable to delete Zone

Post 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
User avatar
iconnor
Posts: 2880
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Unable to delete Zone

Post 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).
User avatar
swolsen
Posts: 31
Joined: Sat Mar 20, 2021 9:39 pm
Location: Schenectady, NY, USA

Re: Unable to delete Zone

Post by swolsen »

Ok I will give it a try later. Thanks.
karsta62
Posts: 17
Joined: Wed Dec 01, 2010 5:25 am

Re: Unable to delete Zone

Post by karsta62 »

Did not work on v1.36.31 :-(
Last edited by karsta62 on Mon Nov 07, 2022 11:04 am, edited 1 time in total.
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Unable to delete Zone

Post 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
-
karsta62
Posts: 17
Joined: Wed Dec 01, 2010 5:25 am

Re: Unable to delete Zone

Post 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 :-)
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Unable to delete Zone

Post by Magic919 »

It's just a quick edit if you want to 'fix' it. Change one word.
-
jogo
Posts: 46
Joined: Thu Aug 03, 2017 3:00 pm

Re: Unable to delete Zone

Post 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.
karsta62
Posts: 17
Joined: Wed Dec 01, 2010 5:25 am

Re: Unable to delete Zone

Post 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.
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Unable to delete Zone

Post by Magic919 »

It's this file on my system -

Code: Select all

/usr/share/zoneminder/www/skins/classic/views/zones.php
-
karsta62
Posts: 17
Joined: Wed Dec 01, 2010 5:25 am

Re: Unable to delete Zone

Post 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"
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Unable to delete Zone

Post by Magic919 »

You must have done it wrong.
-
karsta62
Posts: 17
Joined: Wed Dec 01, 2010 5:25 am

Re: Unable to delete Zone

Post 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 :(
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Unable to delete Zone

Post 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.
-
karsta62
Posts: 17
Joined: Wed Dec 01, 2010 5:25 am

Re: Unable to delete Zone

Post by karsta62 »

Oh my crap!!
I have eyes made of wood....
Thank you guys. Works now....oh I feel so stupid....
Post Reply