Authentication Issues objectconfig.ini

Support for the docker image maintained by dlandon
Post Reply
in-the-zone
Posts: 6
Joined: Tue Dec 31, 2019 8:57 pm

Authentication Issues objectconfig.ini

Post by in-the-zone »

Hello,

If possible I need a little bit of help. I recently updated my dlandon/zoneminder image and I think something in my configuration doesn’t agree with the new image. I previously had person detection working without any issues, but after upgrading to the latest build I’ve been getting parsing errors and HTTP errors.


/var/log/error.log

Jul 22 13:44:29 zoneminder /zm_detect.py[10255]: ERR [zmesdetect_m1] [HTTP Error 401: Unauthorized]
Jul 22 13:44:29 zoneminder /zm_detect.py[10255]: ERR [zmesdetect_m1] [Error parsing config:/etc/zm/objectconfig.ini]
Jul 22 13:44:29 zoneminder /zm_detect.py[10255]: ERR [zmesdetect_m1] [Error was:Python type HTTPError cannot be converted]


Python and api’s are fairly new to me, so since the error log gives me the HTTP Error 401 I checked my credentials. For this I referenced the Zoneminder documentation API section. Using the curl command and my credentials/token I was able to make a successful API call and get monitor/camera data back.


However when I use the “sudo -u www-data /var/lib/zmeventnotification/bin/zm_event_start.sh <eid> <mid>”or “sudo -u www-data /var/lib/zmeventnotification/bin/zm_event_start.sh 10965 1”


When that command is ran I get this in the /var/log/zm/error.log
@zoneminder:/usr/local/lib/python3.6/dist-packages/zmes_hook_helpers# tail /var/log/zm/error.log
2020-07-22 11:46:00 Error: [UnauthorizedException] Not Authenticated
Request URL: /zm/api/zones/forMonitor/1.json?user=<USERNAMEREMOVED>&pass=<PASSWORDREMOVED>
Stack Trace:
#0 /usr/share/zoneminder/www/api/app/Controller/ZonesController.php(18): AppController->beforeFilter()
#1 /usr/share/zoneminder/www/api/lib/Cake/Event/CakeEventManager.php(243): ZonesController->beforeFilter()
#2 /usr/share/zoneminder/www/api/lib/Cake/Controller/Controller.php(677): CakeEventManager->dispatch()
#3 /usr/share/zoneminder/www/api/lib/Cake/Routing/Dispatcher.php(189): Controller->startupProcess()
#4 /usr/share/zoneminder/www/api/lib/Cake/Routing/Dispatcher.php(167): Dispatcher->_invoke()
#5 /usr/share/zoneminder/www/api/app/webroot/index.php(107): Dispatcher->dispatch()
#6 {main}


My debug for the zmesdetect_m1 component looks like this

@zoneminder:/var/log/zm# tail zmesdetect_m1.log
07/22/20 14:05:47 zmesdetect_m1[11562] DBG1 utils.py:254 [Section [alpr] missing in config file, using key:openalpr_country default: us]
07/22/20 14:05:47 zmesdetect_m1[11562] DBG1 utils.py:254 [Section [alpr] missing in config file, using key:openalpr_state default: None]
07/22/20 14:05:47 zmesdetect_m1[11562] DBG1 utils.py:254 [Section [alpr] missing in config file, using key:openalpr_min_confidence default: 0.3]
07/22/20 14:05:47 zmesdetect_m1[11562] DBG1 utils.py:254 [Section [alpr] missing in config file, using key:openalpr_cmdline_binary default: alpr]
07/22/20 14:05:47 zmesdetect_m1[11562] DBG1 utils.py:254 [Section [alpr] missing in config file, using key:openalpr_cmdline_params default: -j]
07/22/20 14:05:47 zmesdetect_m1[11562] DBG1 utils.py:254 [Section [alpr] missing in config file, using key:openalpr_cmdline_min_confidence default: 0.3]
07/22/20 14:05:47 zmesdetect_m1[11562] DBG1 utils.py:307 [allowing self-signed certs to work...]
07/22/20 14:05:47 zmesdetect_m1[11562] DBG2 utils.py:61 [Getting ZM zones using https://192.168.1.101:8443/zm/api/zones ... x&pass=yyy]
07/22/20 14:05:47 zmesdetect_m1[11562] ERR utils.py:348 [Error parsing config:/etc/zm/objectconfig.ini]
07/22/20 14:05:47 zmesdetect_m1[11562] ERR utils.py:349 [Error was:Python type HTTPError cannot be converted]


I’ve browsed thru the breaking changes for Event servers version 5.7.7 => 5.15.5 and the changelog for zmeventnotification on the docker image GitHub page, but so far I’m at a loss. Incase its needed my system information is

Docker image: dlandon/zoneminder:latest
Event Server version: 5.15-Docker OpenCV version 4.2.0

Thank You for any help or guidance you can provide.
in-the-zone
Posts: 6
Joined: Tue Dec 31, 2019 8:57 pm

Re: Authentication Issues objectconfig.ini

Post by in-the-zone »

Also here is the full log event from zmesdetect_m1.log

07/22/20 14:23:10 zmesdetect_m1[1185] INF zm_detect.py:181 [---------| hook version: 5.15.5, ES version: 5.15-Docker , OpenCV version: 4.2.0|------------]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:284 [secret filename: /etc/zm/secrets.ini]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG2 utils.py:257 [Secret token found in config: !ZM_PORTAL]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG2 utils.py:257 [Secret token found in config: !ZM_API_PORTAL]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG2 utils.py:257 [Secret token found in config: !ZM_USER]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG2 utils.py:257 [Secret token found in config: !ZM_PASSWORD]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:254 [Section [ml] missing in config file, using key:use_opencv_dnn_cuda default: no]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:254 [Section [ml] missing in config file, using key:ml_gateway default: None]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:254 [Section [ml] missing in config file, using key:ml_fallback_local default: no]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:254 [Section [ml] missing in config file, using key:ml_user default: None]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:254 [Section [ml] missing in config file, using key:ml_password default: None]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:254 [Section [alpr] missing in config file, using key:alpr_service default: plate_recognizer]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:254 [Section [alpr] missing in config file, using key:alpr_url default: None]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:254 [Section [alpr] missing in config file, using key:alpr_key default: ]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:254 [Section [alpr] missing in config file, using key:alpr_use_after_detection_only default: yes]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:254 [Section [alpr] missing in config file, using key:alpr_api_type default: cloud]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:254 [Section [alpr] missing in config file, using key:platerec_stats default: no]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:254 [Section [alpr] missing in config file, using key:platerec_regions default: None]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:254 [Section [alpr] missing in config file, using key:platerec_min_dscore default: 0.3]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:254 [Section [alpr] missing in config file, using key:platerec_min_score default: 0.5]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:254 [Section [alpr] missing in config file, using key:openalpr_recognize_vehicle default: 0]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:254 [Section [alpr] missing in config file, using key:openalpr_country default: us]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:254 [Section [alpr] missing in config file, using key:openalpr_state default: None]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:254 [Section [alpr] missing in config file, using key:openalpr_min_confidence default: 0.3]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:254 [Section [alpr] missing in config file, using key:openalpr_cmdline_binary default: alpr]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:254 [Section [alpr] missing in config file, using key:openalpr_cmdline_params default: -j]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:254 [Section [alpr] missing in config file, using key:openalpr_cmdline_min_confidence default: 0.3]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG1 utils.py:307 [allowing self-signed certs to work...]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG2 utils.py:326 [[monitor-1] overrides key:wait with value:5]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG2 utils.py:326 [[monitor-1] overrides key:detect_pattern with value:(person)]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG2 utils.py:326 [[monitor-1] overrides key:frame_id with value:bestmatch]
07/22/20 14:23:10 zmesdetect_m1[1185] DBG2 utils.py:61 [Getting ZM zones using https://192.168.1.101:8443/zm/api/zones ... x&pass=yyy]
07/22/20 14:23:10 zmesdetect_m1[1185] ERR utils.py:348 [Error parsing config:/etc/zm/objectconfig.ini]
07/22/20 14:23:10 zmesdetect_m1[1185] ERR utils.py:349 [Error was:Python type HTTPError cannot be converted]
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Authentication Issues objectconfig.ini

Post by asker »

You should be on 5.15.6 of ES. There was an issue with the zones API that was fixed
See https://github.com/pliablepixels/zmeven ... n/pull/279
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
in-the-zone
Posts: 6
Joined: Tue Dec 31, 2019 8:57 pm

Re: Authentication Issues objectconfig.ini

Post by in-the-zone »

Ahhh Thank You. Since I'm running a docker image is it safe to say I have to wait until the container maintainer implements 5.15.6? If so no biggie. I appreciate the work that the team has done with this project.
in-the-zone
Posts: 6
Joined: Tue Dec 31, 2019 8:57 pm

Re: Authentication Issues objectconfig.ini

Post by in-the-zone »

Thanks for your guidance in posting the github issue. I used the resolution that "cornercase" used and modified my utils.py to match what he did. I'm back to detecting objects again. Thank You.
Post Reply