zm_detect.py SSL connection trouble

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
Post Reply
jfqbsm
Posts: 11
Joined: Tue Dec 14, 2021 6:36 pm

zm_detect.py SSL connection trouble

Post by jfqbsm »

Hi,
I just did a fresh install of ZoneMinder 1.36 on ubuntu 20.04 LTS and ES with hook. Every thing works fine on my old installation ZoneMinder 1.34 on ubuntu 18.04 LTS.
On the new one when i try the following sudo -u www-data /var/lib/zmeventnotification/bin/zm_detect.py --eventid <eid> i get the result below:
root@svideo:/# sudo -u www-data /var/lib/zmeventnotification/bin/zm_detect.py --config /etc/zm/objectconfig.ini --eventid 12 --debug
INF [zmesdetect] [Setting up signal handler for logs]
INF [zmesdetect] [Switching global logger to ZMLog]
INF [zmesdetect] [---------| app:6.1.28, pyzm:0.3.56, ES:6.1.28
, OpenCV:4.5.5|------------]
INF [zmesdetect] [Reading config from: /etc/zm/objectconfig.ini]
INF [zmesdetect] [Reading secrets from: /etc/zm/secrets.ini]
DBG2 [zmesdetect] [Secret token found in config: !ZM_PORTAL]
DBG2 [zmesdetect] [Secret token found in config: !ZM_USER]
DBG2 [zmesdetect] [Secret token found in config: !ZM_PASSWORD]
DBG2 [zmesdetect] [Secret token found in config: !ZM_API_PORTAL]
DBG2 [zmesdetect] [Secret token found in config: !ML_USER]
DBG2 [zmesdetect] [Secret token found in config: !ML_PASSWORD]
DBG2 [zmesdetect] [Secret token found in config: !PLATEREC_ALPR_KEY]
DBG1 [zmesdetect] [allowing self-signed certs to work...]
DBG2 [zmesdetect] [Now checking for monitor overrides]
INF [zmesdetect] [Ignoring monitor specific settings, as you did not provide a monitor id]
DBG3 [zmesdetect] [Finally, doing parameter substitution]
INF [zmesdetect] [Importing local classes for Object/Face]
INF [zmesdetect] [Connecting with ZM APIs]
DBG2 [zmesdetect] [API SSL certificate check has been disbled]
DBG1 [zmesdetect] [using username/password for login]
02/01/22 10:11:45 zmesdetect[28531] FAT zm_detect.py:561 [Unrecoverable error:HTTPSConnectionPool(host='192.168.10.179', port=443): Max retries exceeded with url: /zm/api/host/login.json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fc2ebcc3160>: Failed to establish a new connection: [Errno 111] Connection refused')) Traceback:Traceback (most recent call last):
The same on the old one get the result beow:
root@linux:/# sudo -u www-data /var/lib/zmeventnotification/bin/zm_detect.py --config /etc/zm/objectconfig.ini --eventid 856 --debug
INF [zmesdetect] [Setting up signal handler for logs]
INF [zmesdetect] [Switching global logger to ZMLog]
INF [zmesdetect] [---------| app:6.1.28, pyzm:0.3.56, ES:6.1.28
, OpenCV:4.5.5|------------]
INF [zmesdetect] [Reading config from: /etc/zm/objectconfig.ini]
INF [zmesdetect] [Reading secrets from: /etc/zm/secrets.ini]
DBG2 [zmesdetect] [Secret token found in config: !ZM_PORTAL]
DBG2 [zmesdetect] [Secret token found in config: !ZM_USER]
DBG2 [zmesdetect] [Secret token found in config: !ZM_PASSWORD]
DBG2 [zmesdetect] [Secret token found in config: !ZM_API_PORTAL]
DBG2 [zmesdetect] [Secret token found in config: !ML_USER]
DBG2 [zmesdetect] [Secret token found in config: !ML_PASSWORD]
DBG2 [zmesdetect] [Secret token found in config: !PLATEREC_ALPR_KEY]
DBG1 [zmesdetect] [allowing self-signed certs to work...]
DBG2 [zmesdetect] [Now checking for monitor overrides]
INF [zmesdetect] [Ignoring monitor specific settings, as you did not provide a monitor id]
DBG3 [zmesdetect] [Finally, doing parameter substitution]
INF [zmesdetect] [Importing local classes for Object/Face]
INF [zmesdetect] [Connecting with ZM APIs]
DBG2 [zmesdetect] [API SSL certificate check has been disbled]
DBG1 [zmesdetect] [using username/password for login]
DBG2 [zmesdetect] [Using new token API]
DBG1 [zmesdetect] [Access token expires on:2022-02-02 10:15:50.946870 [86400s]]
DBG1 [zmesdetect] [Refresh token expires on:2022-02-02 10:15:50.947525 [86400s]]
Obviously on the new one zm_detect.py try to connect using SSL although it has been disabled. What can cause this behavior? Your help will be welcome
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: zm_detect.py SSL connection trouble

Post by Magic919 »

I can't see this coming from anywhere other than the secrets config file.
-
jfqbsm
Posts: 11
Joined: Tue Dec 14, 2021 6:36 pm

Re: zm_detect.py SSL connection trouble

Post by jfqbsm »

I checked again and there is no difference between booth installations. all ini files are identical.
jfqbsm
Posts: 11
Joined: Tue Dec 14, 2021 6:36 pm

Re: zm_detect.py SSL connection trouble

Post by jfqbsm »

Oups after last checking not the least in secrets.ini file the ZM_PORTAL was https and not http. After replaced https by http it works fine. Thanks for your help
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: zm_detect.py SSL connection trouble

Post by Magic919 »

You're welcome. Glad you got it sorted.
-
Post Reply