Issue - v1.36.34 = "web_php - Unable to load Monitor status record" "web_php - socket_sendto *.sock Connection refused"

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
tr23
Posts: 7
Joined: Mon Aug 19, 2024 5:32 pm

Issue - v1.36.34 = "web_php - Unable to load Monitor status record" "web_php - socket_sendto *.sock Connection refused"

Post by tr23 »

Dear all.

I'm having issues with the frontend since upgrade to 1.36.34. Please help. The issue appeared after the upgrade from 1.36.33.
Tried recreating the Mariadb DB, reconfigured almost everything from scratch, can't seem to find a solution. ZmNinja shows the same status issues.

The monitor starts showing warning "Monitor is not capturing. We will be unable to provide an image" after the first trigger is activated and the first recording finishes.

The whole backend - video recording, streaming everything continues to work flawlessly, meanwhile the frontend shows as if Monitor is not capturing and that modect isn't running. But it is working and it captures on motion detect end everything. It's driving me crazy, already spent 3 days trying to fix the issue but to no avail. Can't seem to figure this one out.

Image

Image

Image

Image

Image

Image

8/19/24, 2:29:39 PM GMT+2.009654 web_php[49618].WAR [*****Client_IP_Censored*****] [Unable to load Monitor status record for Id=1 using SELECT * FROM `Monitor_Status` WHERE `MonitorId`=?] at /usr/share/zoneminder/www/includes/Monitor.php line 208
8/19/24, 2:29:46 PM GMT+2.634108 web_php[49617].ERR [*****Client_IP_Censored*****] [socket_sendto( /run/zm/zms-096908s.sock ) failed: Connection refused] at /usr/share/zoneminder/www/includes/functions.php line 1884

I'm also geting quite a few alarms regarding the warning below, but this doesn't seem to actually have any impact from as far as I can tell:
08/19/24 18:39:50.091109 zmc_m1[448].WAR-zm_packetqueue.cpp/259 [Found iterator at beginning of queue. Some thread isn't keeping up]

Code: Select all

$ zmupdate.pl 
Database already at version 1.36.34, update skipped.

Code: Select all

Linux zoneminder 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux


Server version: Apache/2.4.52 (Ubuntu)
Server built:   2024-07-17T18:57:26

PHP 8.1.2-1ubuntu2.18 (fpm-fcgi) (built: Jun 14 2024 15:52:55)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.2-1ubuntu2.18, Copyright (c), by Zend Technologies

Welcome to the MariaDB monitor. Your MariaDB connection id is 196
Server version: 10.6.18-MariaDB-0ubuntu0.22.04.1 Ubuntu 22.04Linux zoneminder 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

ffmpeg version 4.4.2-0ubuntu0.22.04.1+esm1 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 11 (Ubuntu 11.3.0-1ubuntu1~22.04)
configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1+esm1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil      56. 70.100 / 56. 70.100
libavcodec     58.134.100 / 58.134.100
libavformat    58. 76.100 / 58. 76.100
libavdevice    58. 13.100 / 58. 13.100
libavfilter     7.110.100 /  7.110.100
libswscale      5.  9.100 /  5.  9.100
libswresample   3.  9.100 /  3.  9.100
libpostproc    55.  9.100 / 55.  9.100

FFMPEG_OUTPUT_OPTIONS = -vf 'format=nv12|vaapi,hwupload'

Any advice would be appreciated. If any additional information is needed please ask and I'll be happy to provide. Thanks guys, I'm lost at this one.
User avatar
iconnor
Posts: 3266
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Issue - v1.36.34 = "web_php - Unable to load Monitor status record" "web_php - socket_sendto *.sock Connection refu

Post by iconnor »

Maybe the db didn't get updated... let's try doing it manually.

mysql -u zmuser -p zm < /usr/share/zoneminder/db/zm_update-1.36.34.sql

What it does is add an UpdatedOn field to the Monitor_Status table.
tr23
Posts: 7
Joined: Mon Aug 19, 2024 5:32 pm

Re: Issue - v1.36.34 = "web_php - Unable to load Monitor status record" "web_php - socket_sendto *.sock Connection refu

Post by tr23 »

I recreated the DB from scratch (from /usr/share/zoneminder/db/zm_create.sql) in my initial attemt to fix the issue myself.

Executed your code with following result (no change to db it seems):

Code: Select all

mysql -h x.x.x.x -u zoneminder -p zm < /usr/share/zoneminder/db/zm_update-1.36.34.sql

mysql: [Warning] Using a password on the command line interface can be insecure.
Column UpdatedOn already exists in Monitor_Status
Column UpdatedOn already exists in Monitor_Status
This does not fix the issue.
Thanks.
tr23
Posts: 7
Joined: Mon Aug 19, 2024 5:32 pm

Re: Issue - v1.36.34 = "web_php - Unable to load Monitor status record" "web_php - socket_sendto *.sock Connection refu

Post by tr23 »

Manual SQL querry:

Fresh start of zoneminder service:

Code: Select all

mysql> SELECT * FROM `Monitor_Status` WHERE `MonitorId`=1;
+-----------+-----------+------------+-------------+------------------+---------------------+
| MonitorId | Status    | CaptureFPS | AnalysisFPS | CaptureBandwidth | UpdatedOn           |
+-----------+-----------+------------+-------------+------------------+---------------------+
|         1 | Connected |      11.92 |       12.51 |           306016 | 2024-08-19 22:24:36 |
+-----------+-----------+------------+-------------+------------------+---------------------+
1 row in set (0.00 sec)
After an alarm is triggered and recording finishes:

Code: Select all

mysql> SELECT * FROM `Monitor_Status` WHERE `MonitorId`=1;
Empty set (0.00 sec)

I did notice that sometimes it takes 2 or in rare cases even three seperate alarmed recordings to trigger this issue.
But it does happen in 100% of tests.
User avatar
iconnor
Posts: 3266
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Issue - v1.36.34 = "web_php - Unable to load Monitor status record" "web_php - socket_sendto *.sock Connection refu

Post by iconnor »

You have your FPS report interval set high don't you.

I've got a patch incoming that should fix this.
JariR
Posts: 29
Joined: Wed Sep 25, 2013 10:22 am

Re: Issue - v1.36.34 = "web_php - Unable to load Monitor status record" "web_php - socket_sendto *.sock Connection refu

Post by JariR »

iconnor wrote: Mon Aug 19, 2024 11:28 pm You have your FPS report interval set high don't you.

I've got a patch incoming that should fix this.
What is the effect of the FPS Report Interval setting? I've it set to 1000 which is default and most of my monitors are displayed with "Not capturing"-status even those are working normally. If I decrease FPS Report Interval to 100 those monitors are changing to view "green"-status on console-view.
tr23
Posts: 7
Joined: Mon Aug 19, 2024 5:32 pm

Re: Issue - v1.36.34 = "web_php - Unable to load Monitor status record" "web_php - socket_sendto *.sock Connection refu

Post by tr23 »

I have always set it as high as possible since its only function to my knowledge was to spam the logs.
Please advise on its optimal value and if you could explain its function.

Will perform testing with the value of 720 today (that means reporting every 1m for my camera setup).
Will post results later.

Thank you.
tr23
Posts: 7
Joined: Mon Aug 19, 2024 5:32 pm

Re: Issue - v1.36.34 = "web_php - Unable to load Monitor status record" "web_php - socket_sendto *.sock Connection refu

Post by tr23 »

10 alarmed events later - the FPS Report Interval value of "720" @ "12fps" camera setup seems to have resolved my issue - but additional testing is still required. Will keep an eye out throughout this week for any inconsistencies and will post final conclusion in the start of next week. :D

@iconnor - Thanks for the tip (possible solution) and all the work you put in the Zoneminder software as whole. You have my respect and gratitude. Can't thank you enough - love you man. Keep it up! Good work! :wink:
tr23
Posts: 7
Joined: Mon Aug 19, 2024 5:32 pm

Re: Issue - v1.36.34 = "web_php - Unable to load Monitor status record" "web_php - socket_sendto *.sock Connection refu

Post by tr23 »

Everything works fine now.
FPS Report Interval was the culprit.

Issue is resolved.
tr23
Posts: 7
Joined: Mon Aug 19, 2024 5:32 pm

Re: Issue - v1.36.34 = "web_php - Unable to load Monitor status record" "web_php - socket_sendto *.sock Connection refu

Post by tr23 »

Issue reappeared for some reason - out of nowhere.
Testing the stability again with FPS Report Interval of "360" frames...
Robert28
Posts: 2
Joined: Wed Aug 28, 2024 6:44 pm

Re: Issue - v1.36.34 = "web_php - Unable to load Monitor status record" "web_php - socket_sendto *.sock Connection refu

Post by Robert28 »

LS.

the same issue appeared here after upgrading to 1.36.34. Zoneminder itself works still fine (cams are recording, detecting triggers, etc), but on the Console page all cams are 'not running' :shock:

Best regards,
Robert

===
System: Fedora 40
Max FPS: 4 (only)
alextuning
Posts: 1
Joined: Tue Sep 17, 2024 4:48 am

Re: Issue - v1.36.34 = "web_php - Unable to load Monitor status record" "web_php - socket_sendto *.sock Connection refu

Post by alextuning »

iconnor wrote: Mon Aug 19, 2024 11:28 pm You have your FPS report interval set high don't you.

I've got a patch incoming that should fix this.
@iconnor, I faced the same issue after recent OS Ubuntu 22.04 update but not sure how it's connected.
ZM had default 1000 for FPS Report Interval and all cams set to Monitor mode. Column UpdatedOn exists in Monitor_Status.
Decreasing FPS Report Interval to 100 fixed the the behavior but seems it is kind a workaround.

Do you have any ETA for the patch mentioned above?
User avatar
iconnor
Posts: 3266
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Issue - v1.36.34 = "web_php - Unable to load Monitor status record" "web_php - socket_sendto *.sock Connection refu

Post by iconnor »

It is already in my proposed ppa. Should be released in 1.36.15 maybe by week end.
faginbagin
Posts: 6
Joined: Fri Mar 01, 2019 9:45 pm

Re: Issue - v1.36.34 = "web_php - Unable to load Monitor status record" "web_php - socket_sendto *.sock Connection refu

Post by faginbagin »

@iconnor, did you mean 1.36.35 when you said 1.36.15? It's been about 3 weeks since you said it would be about a week and the 1.36 PPA is still showing 1.36.34 from August 13th?

I came here because I'm seeing the same problem. I've got 4 cameras and only two show as capturing, the other two show as not running in the console. I can change that by changing their function from Modect to None and then back. One thing I saw when I looked at the Monitor_Status table is that there are no records for the cameras shown as not running. Could it be that some piece of code is failing to insert those records after deleting them? Can't help but wonder if they should be deleted/inserted as opposed to being updated? There are no errors in the log about DB writes, only the select warnings.

Update: I changed the FPS report intervals for the two problem cameras from 1000 to 500. Seems to do the trick. The others that were showing as capturing were set to 100. Not sure I like the idea of more frequent reporting and presumably more CPU demand when I don't look at the console that often and my zoneminder system serves other functions, too. That's why I only cut the number in half from 1000 to 500. Or, have I got that backwards?
Post Reply