ZoneMinder / zmeventnotification

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

ZMLog (No Attribute) Error after upgrading Ubuntu from 18.04 to 20.04 #402

Closed zymbiosis closed 3 years ago

zymbiosis commented 3 years ago

I recently upgraded my ubuntu version from 18.04 to 20.04, and since then have started getting some errors with ES. My first though was to go through and upgraded ES, as well as re-compiled opencv. However, I am still receiving an error outlined below.

Event Server version 6.1.25

Hooks version (if you are using Object Detection) app:6.1.25, pyzm:0.3.51

Are you using MLAPI? (Y/N) No

The version of ZoneMinder you are using: 1.36.5

What is the nature of your issue Possible Bug

Details In zoneminder, as well as when running zm_detect manually I receive the following error:

INF [zmesdetect_m3] [Setting up signal handler for logs]
INF [zmesdetect_m3] [Switching global logger to ZMLog]
INF [zmesdetect_m3] [---------| app:6.1.25, pyzm:0.3.51, ES:6.1.25
 , OpenCV:4.5.3-dev|------------]
FAT [zmesdetect_m3] [Unrecoverable error:module 'pyzm.ZMLog' has no attribute 'error' Traceback:Traceback (most recent call last):
  File "/var/lib/zmeventnotification/bin/zmes_hook_helpers/utils.py", line 263, in process_config
    g.logger.debug('secret filename: {}'.format(secrets_filename))
AttributeError: module 'pyzm.ZMLog' has no attribute 'debug'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 556, in <module>
    main_handler()
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 298, in main_handler
    utils.process_config(args, g.ctx)
  File "/var/lib/zmeventnotification/bin/zmes_hook_helpers/utils.py", line 323, in process_config
    g.logger.error('Error parsing config:{}'.format(args['config']))
AttributeError: module 'pyzm.ZMLog' has no attribute 'error'
]

Thanks!

pliablepixels commented 3 years ago

Please see the issue template - it tell you how to post debug logs.

zymbiosis commented 3 years ago

Thanks for the quick response, I had been using the --debug flag during the "making sure everything is running" portion of the instructions so thought that would include the info. However, just to make sure after enabling debug I get the same information in the logs:

Traceback (most recent call last):
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 556, in <module>
    main_handler()
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 298, in main_handler
    utils.process_config(args, g.ctx)
  File "/var/lib/zmeventnotification/bin/zmes_hook_helpers/utils.py", line 323, in process_config
    g.logger.error('Error parsing config:{}'.format(args['config']))
AttributeError: module 'pyzm.ZMLog' has no attribute 'error'
]
pliablepixels commented 3 years ago

I feel like you've landed in a situation where your ES install is mixed between old and new. The problem is your version of the code is invoking g.logger.error which is old code. If you look at line 323 of that file, it doesn't contain that logging code at all ref

So I'd recommend a clean re-install of ES and components

zymbiosis commented 3 years ago

Thank you very much, that was exactly it! I wonder if I was on such an older version that upgrading didn't work and I just needed to do a clean install. I ran the following and everything is working as expected.

sudo rm /usr/bin/zmeventnotification.pl
sudo rm -r /var/lib/zmeventnotification

Then went through the normal install process and am back in business.

sudo -H ./install.sh
sudo zmdc.pl start zmeventnotification.pl

Thanks again for your help.