Unrecoverable error:Invalid URL '/host/getVersion.json': No schema supplied. Perhaps you meant http:///host/getVersion.j
-
- Posts: 2
- Joined: Sat Jul 02, 2022 10:32 pm
Unrecoverable error:Invalid URL '/host/getVersion.json': No schema supplied. Perhaps you meant http:///host/getVersion.j
HI guys
I am most of the way through my setup of the event server bur for the life of me I can't figure out where the zm_detect.py is trying to pull the host url from. In the code (zmpy scripts) it appears to be ml_gateway or apiurl I think. Some config somewhere is missing and it doesn't seem to pull through the https://someip/zm/api into the config when I try to test if the object detection is working on an event from zone minder. Anyone know what config I am missing?
I am most of the way through my setup of the event server bur for the life of me I can't figure out where the zm_detect.py is trying to pull the host url from. In the code (zmpy scripts) it appears to be ml_gateway or apiurl I think. Some config somewhere is missing and it doesn't seem to pull through the https://someip/zm/api into the config when I try to test if the object detection is working on an event from zone minder. Anyone know what config I am missing?
- Attachments
-
- logs.PNG (280.77 KiB) Viewed 15614 times
Re: Unrecoverable error:Invalid URL '/host/getVersion.json': No schema supplied. Perhaps you meant http:///host/getVersi
Objectconfig.ini
'api_portal' and 'portal' options which are set as secrets by default (secrets are configured as !<secret name>)
So either remove the default options of
portal=!ZM_PORTAL
api_portal=!ZM_API_PORTAL
and hardcore the url there or you can leave the secret token there and edit secrets.ini and to set the value of the secret tokens.
ZM_PORTAL=<zm portal url>
ZM_API_PORTAL=<zm API portal>
'api_portal' and 'portal' options which are set as secrets by default (secrets are configured as !<secret name>)
So either remove the default options of
portal=!ZM_PORTAL
api_portal=!ZM_API_PORTAL
and hardcore the url there or you can leave the secret token there and edit secrets.ini and to set the value of the secret tokens.
ZM_PORTAL=<zm portal url>
ZM_API_PORTAL=<zm API portal>
-
- Posts: 2
- Joined: Sat Jul 02, 2022 10:32 pm
Re: Unrecoverable error:Invalid URL '/host/getVersion.json': No schema supplied. Perhaps you meant http:///host/getVersi
I am afraid this is not it. Is it perhaps an apache2 problem? Here are my secrets and objectconfig.ini to reference.
- Attachments
-
- objectconfig.PNG (852.07 KiB) Viewed 15583 times
-
- secrets.PNG (188.71 KiB) Viewed 15583 times
Re: Unrecoverable error:Invalid URL '/host/getVersion.json': No schema supplied. Perhaps you meant http:///host/getVersi
Sorry for bumping an old thread up, but did you ever resolve this issue ?
Like yourself I am getting the following error running zm_detect.py
I have double checked that I have changed the secrets.ini file to include my URL's and can confirm that zm_detect is reading from the config files.
04/16/23 16:20:39 zmesdetect_m4[4383] INF utils.py:405 [Reading config from: /etc/zm/zmeventnotification.ini]
04/16/23 16:20:39 zmesdetect_m4[4383] INF utils.py:410 [Reading secrets from: /etc/zm/secrets.ini]
But now at a loss to where to troubleshoot.
Thanks
Like yourself I am getting the following error running zm_detect.py
Code: Select all
04/16/23 16:20:40 zmesdetect_m4[4383] FAT zm_detect.py:561 [Unrecoverable error:Invalid URL '/host/getVersion.json': No schema supplied. Perhaps you meant http:///host/getVersion.json? 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 335, in main_handler
zmapi = zmapi.ZMApi(options=api_options)
File "/usr/local/lib/python3.10/dist-packages/pyzm/api.py", line 76, in __init__
self._login()
File "/usr/local/lib/python3.10/dist-packages/pyzm/api.py", line 185, in _login
r = self.session.post(url, data=data)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 590, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 528, in request
prep = self.prepare_request(req)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 456, in prepare_request
p.prepare(
File "/usr/lib/python3/dist-packages/requests/models.py", line 316, in prepare
self.prepare_url(url, params)
File "/usr/lib/python3/dist-packages/requests/models.py", line 390, in prepare_url
raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL '/host/getVersion.json': No schema supplied. Perhaps you meant http:///host/getVersion.json?
]
04/16/23 16:20:39 zmesdetect_m4[4383] INF utils.py:405 [Reading config from: /etc/zm/zmeventnotification.ini]
04/16/23 16:20:39 zmesdetect_m4[4383] INF utils.py:410 [Reading secrets from: /etc/zm/secrets.ini]
But now at a loss to where to troubleshoot.
Thanks
Re: Unrecoverable error:Invalid URL '/host/getVersion.json': No schema supplied. Perhaps you meant http:///host/getVersi
Does your ZM API work when you test it?
-
Re: Unrecoverable error:Invalid URL '/host/getVersion.json': No schema supplied. Perhaps you meant http:///host/getVersi
Yes,
Code: Select all
curl -X POST -d "user=****&pass=********" http://localhost/zm/api/host/getVersion.json
{"version":"1.36.33","apiversion":"2.0"}
Re: Unrecoverable error:Invalid URL '/host/getVersion.json': No schema supplied. Perhaps you meant http:///host/getVersi
Ok. So there's something in your ZMES that is failing to pass on the http/https part of your ZM API URL. Whether it's specific to your version or environment, I don't know.
-
Re: Unrecoverable error:Invalid URL '/host/getVersion.json': No schema supplied. Perhaps you meant http:///host/getVersi
Can't think of anything. Haven't ever seen the solution for it. I can only suggest trying different version to see what happens.
You could try the Slack channel.
You could try the Slack channel.
-
Re: Unrecoverable error:Invalid URL '/host/getVersion.json': No schema supplied. Perhaps you meant http:///host/getVersi
I'm not an expert with zmes yet, but post the output of
and that might give more information. Also check the config files as mentioned above by tsp.
Just by looking at the error, you can tell it's still seeing the default host/api url somewhere, so look around to see where it is pulling that from. Obviously it's not reading the secrets or objectconfig.ini for some reason (cache? misplaced config file? path? etc)
Code: Select all
sudo -u www-data /var/lib/zmeventnotification/bin/zm_detect.py --config /etc/zm/objectconfig.ini --eventid # --monitorid # --debug
Just by looking at the error, you can tell it's still seeing the default host/api url somewhere, so look around to see where it is pulling that from. Obviously it's not reading the secrets or objectconfig.ini for some reason (cache? misplaced config file? path? etc)
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl
If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl
If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide