ZoneMinder / zmeventnotification

Machine Learning powered Secure Websocket & MQTT based ZoneMinder event notification server
408 stars 128 forks source link

zmesdetect fails to authenticate with zoneminder API #432

Closed 0n3man closed 4 months ago

0n3man commented 4 months ago

This error is actually an error in PHP library apcu.so distributed with ubuntu 23.10 I'm only posting this here as it would have saved me hours trying to figure out the issue had someone else posted the issue.

Event Server version 6.1.28

Hooks version (if you are using Object Detection) app:6.1.28, pyzm:0.3.64

Are you using MLAPI? (Y/N) N

The version of ZoneMinder you are using: 1.37.59

What is the nature of your issue Informational for others that might hit this error

Details zmesdetect fails to authenticate via zoneminder API to post results from ML object detection. If you check the apache2 log you'll see there is a PHP issue with library apcu.so

Debug Logs (if applicable)

2024-04-26T17:24:40.045008-04:00 myth-backend zm_detect.py[68289]: INF [zmesdetect_m9] [Connecting with ZM APIs]
2024-04-26T17:24:40.076353-04:00 myth-backend zm_detect.py[68289]: ERR [zmesdetect_m9] [Got API login error: 500 Server Error: Internal Server Error for url: https://zm.connectionblocks.com/zm/api/host/login.json]
2024-04-26T17:24:40.083310-04:00 myth-backend zm_detect.py[68289]: FAT [zmesdetect_m9] [Unrecoverable error:500 Server Error: Internal Server Error for url: https://zm.connectionblocks.com/zm/api/host/login.json Traceback:Traceback (most recent call last):#012  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 556, in <module>#012    main_handler()#012  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 335, in main_handler#012    zmapi = zmapi.ZMApi(options=api_options)#012            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#012  File "/usr/local/lib/python3.11/dist-packages/pyzm/api.py", line 76, in __init__#012    self._login()#012  File "/usr/local/lib/python3.11/dist-packages/pyzm/api.py", line 222, in _login#012    raise err#012  File "/usr/local/lib/python3.11/dist-packages/pyzm/api.py", line 191, in _login#012    r.raise_for_status()#012  File "/usr/lib/python3/dist-packages/requests/models.py", line 1021, in raise_for_status#012    raise HTTPError(http_error_msg, response=self)#012requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://zm.connectionblocks.com/zm/api/host/login.json#012]

Fix The following thread provides instructions for updating the library. https://bugs.launchpad.net/ubuntu/+source/php-apcu/+bug/2038916

connortechnology commented 4 months ago

Thanks for documenting this. Funny I never saw it on my box which has been running mantic until last week.. now on noble.