Page 1 of 1

Where is the API portal URL stored?

Posted: Thu May 15, 2025 10:57 pm
by BaconButty
I know this is a really basic question, and maybe it's just as I've had a rough week, but I can't find where the API URL is being got for the following failures:
3966 INF |----> FORK:Cam5-RSMF-Back Garden (11), eid:2912365 Not sending event end alarm, as we did not send a start alarm for this, or start hook processing failed zmeventnotification.pl -
5/15/25, 11:52:32 PM GMT+1 zmesdetect_m11 4429 FAT Unrecoverable error:404 Client Error: Not Found for url: http://192.168.178.69/zm/api/host/login.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.8/dist-packages/pyzm/api.py", line 76, in __init__ self._login() File "/usr/local/lib/python3.8/dist-packages/pyzm/api.py", line 225, in _login raise err File "/usr/local/lib/python3.8/dist-packages/pyzm/api.py", line 195, in _login r.raise_for_status() File "/usr/local/lib/python3.8/dist-packages/requests/models.py", line 1024, in raise_for_status raise HTTPError(http_error_msg, response=self)requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://192.168.178.69/zm/api/host/login.json zm_detect.py 561
5/15/25, 11:52:32 PM GMT+1 zmesdetect_m11 4429 ERR Got API login error: 404 Client Error: Not Found for url: http://192.168.178.69/zm/api/host/login.json api.py 223
I've checked all the config files and ensure they're changed, but I'm still getting this error.

For a bit of background, I moved a lot of the stuff hosted on that server to nginx last week and moved apache to a different port, so need to change the zone minder portal to 127.0.0.1:5557 instead of just 127.0.0.1

Thanks in advance.

Re: Where is the API portal URL stored?

Posted: Fri May 16, 2025 12:44 am
by burger
There is an explanation here: https://wiki.zoneminder.com/API#Troubleshooting
What you need to know is that the api is NOT at /usr/share/zoneminder/www/api but in fact is located at

/usr/share/zoneminder/www/api/app/webroot
Maybe the redirect rules in the web server config are broken?

Re: Where is the API portal URL stored?

Posted: Sat May 17, 2025 11:04 am
by BaconButty
I think we're talking about different things.

Somewhere in one of the configs (that I can't find) the api portal is listed as "127.0.0.1/zm". I need to change this to "127.0.0.1:5557/zm", but I can't find where this is configured.

Re: Where is the API portal URL stored?

Posted: Sat May 17, 2025 2:24 pm
by burger
Sorry, I didn't read closely enough. Reading the error again, it looks like a ZMES misconfiguration. Try the ZMES secrets.ini file. That has ZM_PORTAL, ZM_API_PORTAL, and ZMES_PICTURE_URL. On my system that file is in /etc/zm.

Re: Where is the API portal URL stored?

Posted: Tue May 20, 2025 7:42 pm
by BaconButty
Ah you legend!

I was sure I did check the secrets file, and I *did*. I forgot I had a broken install in this that was abandoned and that's the secret ini that I must have been editing. Thanks for the correct lcoation!!! Working now :)