500 error on request-stream

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
ryantm
Posts: 2
Joined: Fri Oct 15, 2021 3:09 pm

500 error on request-stream

Post by ryantm »

Hi.

I'm new to ZoneMinder and I am using it on NixOS. I expect there are probably problems with NixOS's packaging of ZoneMinder, so I have been digging into the details to try to see why I'm getting 500 errors in my browser console while looking at a monitor.

I'm running ZoneMinder v1.36.8 and NixOS is using nginx in front of it.

The error I'm getting is when the monitor webpage requests a URL like

Code: Select all

https://redactedHost/index.php?view=request&request=stream&connkey=redactedConnkey&auth=redactedAuthHash&command=99
The result from the server is HTTP status code 500.

There are a lot of logs so I can't be sure I looked in the right place, but I don't see any website error messages related to this. I do see lots of log messages like

Code: Select all

Oct 15 08:13:00 redactedHost zms_e53[1461]: INF [zms_e53] [Unable to send raw frame 81: Broken pipe]
and

Code: Select all

10/15/21 08:37:07.240718 zms_e53[1461].INF-zm_eventstream.cpp/1087 [Unable to send raw frame 73: Broken pipe]
I looked at the ZoneMinder source code and ran this at my console:

Code: Select all

REMOTE_ADDR=127.0.0.1 HTTP_REFERER=https://redactedHost QUERY_STRING="view=request&request=stream&connkey=redactedConnKey&auth=redactedAuthHash&x=37&y=587&command=8" sudo --preserve-env=HTTP_REFERER,QUERY_STRING,REMOTE_ADDR --preserve-en -u zoneminder /nix/store/p2r3inx7iskwqgnd0n39hmg4dmqi0nv8-zoneminder-1.36.8/libexec/zoneminder//cgi-bin/zms
which returned

Code: Select all

Server: ZoneMinder Video Server/1.36.8
Last-Modified: Fri, 15 Oct 2021 15:16:18 GMT
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0
Pragma: no-cache
10/15/21 08:16:18.220096 zms_e0[15064].ERR-zms.cpp/339 [Neither a monitor or event was specified.]
Then I tried adding "monitor=2" to the QUERY_STRING and it output a bunch of binary data, which made me think the stream was working.

I then tried adding "monitor=2" to the query string in my browser, but it still returned HTTP ERROR 500.

Questions
  • Is there a reason why "monitor=2" is not being included in the query string?
  • Is there some place the 500 error would be logged in more detail?
  • Is there some higher level of debugging I can turn on to see more info in the logs?
Sincerely,
Ryan Mulligan
User avatar
iconnor
Posts: 3181
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: 500 error on request-stream

Post by iconnor »

I don't think I've ever tried to zoom on an event.

I'll look into it. We don't specify monitor for an event because it can get that info from the event record.

Specifying it might actually view the live view of the monitor instead of the event.

I will have to look at the code.
ryantm
Posts: 2
Joined: Fri Oct 15, 2021 3:09 pm

Re: 500 error on request-stream

Post by ryantm »

Thanks for the reply! Sorry, I might be using some wrong terminology. I don't think I'm talking about an event page, just the view of a camera like:

Code: Select all

https://redactedHost/?view=watch&mid=2
Are other people getting 500 errors in their web developer consoles (ctrl + shift +i in Chrome) on the camera view pages?
User avatar
iconnor
Posts: 3181
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: 500 error on request-stream

Post by iconnor »

Your logs are from viewing an event. Notice how the log shows zms_e53 as the process name and log file? If it was a live stream it would be zms_m2

It might be coming from the events list at the bottom of the live view page, when generating the thumbnails... which I now see are totally broken.

I guess I know where to look.
Post Reply