Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recording playback fails after upgrade to ZM 1.32.0 #711

Closed
bduerring opened this issue Sep 25, 2018 · 6 comments
Closed

Recording playback fails after upgrade to ZM 1.32.0 #711

bduerring opened this issue Sep 25, 2018 · 6 comments

Comments

@bduerring
Copy link

Platform & OS Version

iOS 11.4.1

The version of zmNinja you are reporting:

zmNinja: 1.3.017

The version of ZoneMinder you are using:

ZoneMinder: 1.32.0, Centos 7

Device details:

iPhone 7

What is the nature of your issue

Recording playback fails after upgrade to ZM 1.32.0

Details

After upgrading ZoneMinder from 1.30.4 to 1.32.0 recorded events fail to play. The issue appears to lie in the EventController.php file included in the build, and reverting to the EventController.php version that you include here: https://raw.githubusercontent.com/ZoneMinder/zoneminder/85b7baa13178a838fe9fae94405c99fe7d2c669c/web/api/app/Controller/EventsController.php does allow playback momentarily before it also fails.

After doing some digging, it appears the eventId it's getting back from the Zoneminder EventController is invalid and results in multiple "web_php 826 ERR Socket does not exist." The PATH variables are correct and valid zms-[eventId]307984w.sock entries exist on the server, it's just trying to play the wrong one.

Debug Logs

web_php 826 ERR Socket does not exist

@pliablepixels
Copy link
Member

Need more info.
I am using 1.32 as well.

  1. You should not have to replace the EventsController - that will result in more inconsistency as the one I linked to is now old

  2. Are these recorded events JPEG or mp4?

  3. Does this happen with zmNinjaDesktop? Its easier to debug there.

  4. I'll need zmNinja debug logs when this occurs

@bduerring
Copy link
Author

Thanks for the reply, response, below inline:

  1. You should not have to replace the EventsController - that will result in more inconsistency as the one I linked to is now old
    -I confirm that the EventController.php is from 1.32.0

  2. Are these recorded events JPEG or mp4?
    -mp4, recorded as h.264 passthrough. However, the issue persists for image recordings a well.

  3. Does this happen with zmNinjaDesktop? Its easier to debug there.
    -Sorry, it's iOS. Will look into desktop version if the logs below do not help address the issue.

  4. I'll need zmNinja debug logs when this occurs
    -Kindly see below and advise if you need anything further:

Sep 30, 2018 07:18:40 PM DEBUG sendCmd response:{"data":{"result":"Error","message":"Socket /var/lib/zoneminder/sock/zms-244799s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/latest/faq.html#why-can-t-i-see-streamed-images-when-i-can-see-stills-in-the-zone-window-etc for more information."},"status":200,"config":{"method":"POST","transformResponse":[null],"url":"https:///index.php","headers":{"Content-Type":"application/x-www-form-urlencoded","Accept":"application/json, text/plain, */*"},"data":{"view":"request","request":"stream","connkey”:”xxxx”,”command":17,"auth”:”xxxxxxxxxxxxxx”}},”statusText":"OK"}
Sep 30, 2018 07:18:39 PM DEBUG Modal removed - killing connkey
Sep 30, 2018 07:18:39 PM DEBUG Deregistering broadcast handles
Sep 30, 2018 07:18:39 PM DEBUG Setting up carousel watchers
Sep 30, 2018 07:18:39 PM DEBUG Rebinding watchers of eventCtrl
Sep 30, 2018 07:18:39 PM DEBUG >>>EventCtrl:Close & Destroy Modal
Sep 30, 2018 07:18:38 PM DEBUG Hmm I found an error {"result":"Error","message":"Socket /var/lib/zoneminder/sock/zms-244799s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/latest/faq.html#why-can-t-i-see-streamed-images-when-i-can-see-stills-in-the-zone-window-etc for more information."}
Sep 30, 2018 07:18:35 PM DEBUG Hmm I found an error {"result":"Error","message":"Socket /var/lib/zoneminder/sock/zms-244799s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/latest/faq.html#why-can-t-i-see-streamed-images-when-i-can-see-stills-in-the-zone-window-etc for more information."}
Sep 30, 2018 07:18:35 PM INFO >>>Starting checkAllEvents interval...
Sep 30, 2018 07:18:33 PM DEBUG **EXCEPTION**TypeError: undefined is not an object (evaluating 'data.event.Frame') caused by undefined
Sep 30, 2018 07:18:33 PM INFO *** Constructed API for detailed events: https:///zm/api/events/39088.json
Sep 30, 2018 07:18:33 PM DEBUG Generated Connkey:244799
Sep 30, 2018 07:18:33 PM DEBUG If recording is in progress, live feed will be shown
Sep 30, 2018 07:18:33 PM DEBUG EventCtrl: recompute thumbnails
Sep 30, 2018 07:18:32 PM DEBUG Setting playback to undefined
Sep 30, 2018 07:18:32 PM DEBUG EventModalCtrl called from app.events
Sep 30, 2018 07:18:32 PM INFO Using stream mode single
Sep 30, 2018 07:18:32 PM INFO ZM_EVENT_IMAGE_DIGITS is already configured for 5
Sep 30, 2018 07:18:32 PM DEBUG unbinding eventCtrl watchers as modal has its own
Sep 30, 2018 07:18:29 PM DEBUG EventCtrl:loading one more page just in case we don't have enough to display
Sep 30, 2018 07:18:29 PM DEBUG EventCtrl: success, got 17 events

@pliablepixels
Copy link
Member

pliablepixels commented Sep 30, 2018

It looks like you have an API corruption

  1. Open a browser, log into ZM
  2. Open a new tab
  3. Type in <your server>/zm/api/events.json - does it work?
  4. Take any event ID from the pervious API and type in <your server>/zm/api/events/<selected event id>.json - does it work? What does it show?

@bduerring
Copy link
Author

Kindly find the output requested below:

From events.json
{"events":[{"Event":{"Id":"36061","MonitorId":"5","StorageId":"0","Name":"Deck-36061","Cause":"Deck Motion","StartTime":"2018-09-20 19:55:59","EndTime":"2018-09-20 19:56:08","Width":"854","Height":"480","Length":"8.94","Frames":"268","AlarmFrames":"196","DefaultVideo":"","SaveJPEGs":null,"TotScore":"196","AvgScore":"1","MaxScore":"1","Archived":"0","Videoed":"0","Uploaded":"0","Emailed":"0","Messaged":"0","Executed":"0","Notes":"Deck Motion: Deck Motion","Orientation":"0","DiskSpace":"23724970","Scheme":"Deep","Locked":false,"StateId":null,"MaxScoreFrameId":"16428859"}}

Excerpt from the event json:
{ "event": { "Event": { "Id": "36061", "MonitorId": "5", "StorageId": "0", "Name": "Deck-36061", "Cause": "Deck Motion", "StartTime": "2018-09-20 19:55:59", "EndTime": "2018-09-20 19:56:08", "Width": "854", "Height": "480", "Length": "8.94", "Frames": "268", "AlarmFrames": "196", "DefaultVideo": "", "SaveJPEGs": null, "TotScore": "196", "AvgScore": "1", "MaxScore": "1", "Archived": "0", "Videoed": "0", "Uploaded": "0", "Emailed": "0", "Messaged": "0", "Executed": "0", "Notes": "Deck Motion: Deck Motion", "Orientation": "0", "DiskSpace": "23724970", "Scheme": "Deep", "Locked": false, "StateId": null, "Next": "36062", "Prev": null, "fileExists": 0, "fileSize": false, "NextOfMonitor": "36068", "PrevOfMonitor": null }, "Monitor": { "Id": "5", "Name": "Deck", "ServerId": null, "StorageId": "0", "Type": "Ffmpeg", "Function": "Nodect", "Enabled": "1", "LinkedMonitors": "", "Triggers": "", "Device": "\/dev\/video0", "Channel": "0", "Format": "255", "V4LMultiBuffer": false, "V4LCapturesPerFrame": "1", "Protocol": "", "Method": "rtpRtsp", "Host": "", "Port": "80", "SubPath": "", "Path": "rtmp:\/\/localhost:1935\/deck\/live", "Options": "", "User": "", "Pass": "", "Width": "1280", "Height": "720", "Colours": "4", "Palette": "0", "Orientation": "0", "Deinterlacing": "0", "SaveJPEGs": "1", "VideoWriter": "2", "OutputCodec": null, "OutputContainer": null, "EncoderParameters":

One item that may be worth considering is that the .sock "not found" error references sock "Id" that doesn't correspond with the eventId (ie. Socket /var/lib/zoneminder/sock/zms-573378s.sock does not exist log entry for eventId "39121"). Not sure if the two are related, but thought I'd include.

Thanks again for the help.

@pliablepixels
Copy link
Member

Is there a chance I can get access to your zm web portal for a day with a test account? If so please email access details to me. Pliablepixels @ Gmail

@bduerring
Copy link
Author

Thanks for the offer. Fortunately, I found a resolution. It appears that after the upgrade to ZM 1.32.0, they added the ability to specify different storage locations for each source. By default, the storage location is set to "default". When I update to the actual name of the location, the issue was resolved (see screenshot below). It is important to note that it only resolves the issue for any items after the change is made, previous items still fail to play.
screen shot 2018-09-30 at 10 46 38 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants