ZoneMinder / zmeventnotification

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

raise ValueError(f'malformed node or string: {node!r}') #408

Closed rajil closed 2 years ago

rajil commented 2 years ago

Event Server version

You can get the version by doing:

/usr/bin/zmeventnotification.pl --version
6.1.27

Hooks version (if you are using Object Detection)

You can get the version by doing:

sudo -u www-data /var/lib/zmeventnotification/bin/zm_detect.py --version
app:6.1.27, pyzm:0.3.54

Are you using MLAPI? (Y/N) N

The version of ZoneMinder you are using:

1.36.7-focal1

What is the nature of your issue

Bug

Details

Hook is failing to run.

10/03/21 13:35:55 zmesdetect_m24[97076] INF ZMLog.py:292 [Setting up signal handler for logs]
10/03/21 13:35:55 zmesdetect_m24[97076] INF ZMLog.py:301 [Switching global logger to ZMLog]
10/03/21 13:35:55 zmesdetect_m24[97076] INF zm_detect.py:284 [---------| app:6.1.27, pyzm:0.3.54, ES:6.1.27
 , OpenCV:4.5.3|------------]
10/03/21 13:35:55 zmesdetect_m24[97076] INF utils.py:405 [Reading config from: /etc/zm/objectconfig.ini]
10/03/21 13:35:55 zmesdetect_m24[97076] INF utils.py:410 [Reading secrets from: /etc/zm/secrets.ini]
10/03/21 13:35:55 zmesdetect_m24[97076] INF zm_detect.py:309 [Importing local classes for Object/Face]
10/03/21 13:35:56 zmesdetect_m24[97076] INF zm_detect.py:334 [Connecting with ZM APIs]
10/03/21 13:35:56 zmesdetect_m24[97076] FAT zm_detect.py:561 [Unrecoverable error:malformed node or string: <_ast.Name object at 0x7f65763c2d00> Traceback: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 346, in main_handler
    ml_options = ast.literal_eval(ml_options)
  File "/usr/lib/python3.8/ast.py", line 99, in literal_eval
    return _convert(node_or_string)
  File "/usr/lib/python3.8/ast.py", line 88, in _convert
    return dict(zip(map(_convert, node.keys),
  File "/usr/lib/python3.8/ast.py", line 88, in _convert
    return dict(zip(map(_convert, node.keys),
  File "/usr/lib/python3.8/ast.py", line 82, in _convert
    return list(map(_convert, node.elts))
  File "/usr/lib/python3.8/ast.py", line 88, in _convert
    return dict(zip(map(_convert, node.keys),
  File "/usr/lib/python3.8/ast.py", line 84, in _convert
    return set(map(_convert, node.elts))
  File "/usr/lib/python3.8/ast.py", line 84, in _convert
    return set(map(_convert, node.elts))
  File "/usr/lib/python3.8/ast.py", line 98, in _convert
    return _convert_signed_num(node)
  File "/usr/lib/python3.8/ast.py", line 75, in _convert_signed_num
    return _convert_num(node)
  File "/usr/lib/python3.8/ast.py", line 66, in _convert_num
    _raise_malformed_node(node)
  File "/usr/lib/python3.8/ast.py", line 63, in _raise_malformed_node
    raise ValueError(f'malformed node or string: {node!r}')
ValueError: malformed node or string: <_ast.Name object at 0x7f65763c2d00>

]

baudneo commented 2 years ago

You have a formatting error in your config file inside of ml-sequence. Sanitize your config, post it on a gist and post the link to the gist.

rajil commented 2 years ago

Thanks. I edit the file and now it works, https://gist.github.com/rajil/7b2bae5c5d3de4064493f396e8eb5f4a