API not working correctly

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
Figge71
Posts: 13
Joined: Sun Nov 25, 2018 6:12 pm

API not working correctly

Post by Figge71 »

I badly need your help, I’ve tried to find a solution for a long time.

I have installed Zoneminde 1.32 on Centos 7.
And it seams to work fine, I get som error messages, but they seam to come because of the cameras.

When trying to start up ZMninja I can see everything except for the live view.

When reading
https://zmninja.readthedocs.io/en/lates ... s/FAQ.html

I get stuck on the part where I’m suppose to test that the api is working, see below. I can’t find a solution.

I’ve tried to reinstall everything a few times, but I get the same result. Am I missing something when installing, shouldn’t it work on a clean installation?

I appreciate all surgeries that could help me 😊

————-
You think your APIs are working, but they are really not. If you open a browser and type in https://yourserver/zm/api/monitors.jsonand you see some text on top followed by monitor data, your APIs are not working. You need to search the forums and figure out how to get rid of that text.
————-
magarity
Posts: 13
Joined: Sat Dec 21, 2019 9:50 pm

Re: API not working correctly

Post by magarity »

I am getting the same with 1.32.3 on Raspian Buster on a Pi 3B. The console is working and zmNinja can find the portal but not the API. http://(myserver)/zm/api/events.json just gets: The requested URL was not found on this server. Apache/2.4.38 (Raspbian) Server at pi3one Port 80

Console options has opt_use_api checked on.

If anyone has suggestions what to check figge71 and I would greatly appreciate!
magarity
Posts: 13
Joined: Sat Dec 21, 2019 9:50 pm

Re: API not working correctly

Post by magarity »

I confirmed the APCu is enabled in PHP server but haven't figured out what next to check...

APCu Support Enabled
Version 5.1.17
APCu Debugging Disabled
MMAP Support Enabled
MMAP File Mask no value
Serialization Support php
Build Date Feb 8 2019 16:18:59
Figge71
Posts: 13
Joined: Sun Nov 25, 2018 6:12 pm

Re: API not working correctly

Post by Figge71 »

Hi!

Unfortunately I haven’t hade the time to continue digging in the problem, but I’m still having it.

I would really appreciate if I get a push in the right direction.

I wish you a happy 2020
alabamatoy
Posts: 349
Joined: Sun Jun 05, 2016 2:53 pm

Re: API not working correctly

Post by alabamatoy »

If you are running apache, I would look at the logs for errors there. I bet you have either some path issues (the webserver cannot get to the files) or else the permissions are not allowing it to read the files. On Debian-based systems, the logs should be in /var/log/apache2 There are access logs and error logs and CGI logs etc.
Figge71
Posts: 13
Joined: Sun Nov 25, 2018 6:12 pm

Re: API not working correctly

Post by Figge71 »

Thank you!
I really appreciate the suggestions. It sounds likely, especially sins I have hade problems with permissions before.

I’ll try it when I get som spare time :)
magarity
Posts: 13
Joined: Sat Dec 21, 2019 9:50 pm

Re: API not working correctly

Post by magarity »

All of my error logs are mostly harmless :(
After rebooting, it's just:

cat error.log
[Tue Jan 07 00:00:13.432287 2020] [mpm_prefork:notice] [pid 600] AH00163: Apache/2.4.38 (Raspbian) configured -- resuming normal operations
[Tue Jan 07 00:00:13.432412 2020] [core:notice] [pid 600] AH00094: Command line: '/usr/sbin/apache2'
[Tue Jan 07 20:54:25.484179 2020] [mpm_prefork:notice] [pid 600] AH00169: caught SIGTERM, shutting down
[Tue Jan 07 20:54:40.767568 2020] [mpm_prefork:notice] [pid 615] AH00163: Apache/2.4.38 (Raspbian) configured -- resuming normal operations
[Tue Jan 07 20:54:40.768550 2020] [core:notice] [pid 615] AH00094: Command line: '/usr/sbin/apache2'
alabamatoy
Posts: 349
Joined: Sun Jun 05, 2016 2:53 pm

Re: API not working correctly

Post by alabamatoy »

Is there anything occurring in syslog at the same time?

I have recently had to correlate between Apache logs and syslog and Zoneminder to figure out what's happening. If that doesnt help, I am pretty out of suggestions.
magarity
Posts: 13
Joined: Sat Dec 21, 2019 9:50 pm

Re: API not working correctly

Post by magarity »

After the update to 1.34.6 the APIs suddenly started working without needing to do anything. I installed the update then checked zmNinja and it was able to connected and show the cameras. Several other things that were not working also are now fine.
Thanks to the dev team!
I have sent some paypal donation funds. Keep up the great work!
Post Reply