API broken when upgraded from 1.30 to 1.32

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
timf
Posts: 132
Joined: Mon Mar 21, 2005 4:07 pm
Location: Lytham St.Annes Lancs.

API broken when upgraded from 1.30 to 1.32

Post by timf »

Hi guys,

been a while since I've posted here as everything was working great.

I followed the instructions on how to up grade my Ubuntu 18.04 Zoneminder 1.30 to 1.32 and it all went smoothly or so I thought!

I've found that when I access ZM using ZM Ninja on the LAN using wifi it all works nicely - but when I try externally from the WAN side I get authenticated failed followed by API access arror.

Error log on ZM ninja reports amongst other things:

the requested URL /api/host/getversion.json was not found on this server

status 3 The internet connection appears to be offline

Inside native HTTP error

I'm using IOS and get all the correct responses when using a browser (Chrome) on the lan side.

Settings are the same for LAN and WAN side apart from the IP address but only the LAN side works.

I can access ZM from the wan side but only if I use a browser - Ninja complains as per above.

Any idea as to what I've screwed up ?

Posted this question in the mobile forum but was advised this would be a better forum.

Regards Tim
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: API broken when upgraded from 1.30 to 1.32

Post by asker »

Let's simplify your problem statement and leave zmNinja aside.

Questions:
a) Are you able to access ZM console via LAN ? (I suppose yes)
b) Are you able to access ZM console via WAN? (I think you said yes)
c) Are you able to access ZM console via WAN using the same mobile device that zmNinja is installed on?
d) Does accessing APIs using a browser via LAN work ? (see this)
e) Does accessing APIs using a browser via WAN work? (same test as above)
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
timf
Posts: 132
Joined: Mon Mar 21, 2005 4:07 pm
Location: Lytham St.Annes Lancs.

Re: API broken when upgraded from 1.30 to 1.32

Post by timf »

Here's the results of your Questions:
a) Are you able to access ZM console via LAN ? (I suppose yes) Correct, yes using Chrome browser
b) Are you able to access ZM console via WAN? (I think you said yes) Correct yes but only by using a Chrome Browser
c) Are you able to access ZM console via WAN using the same mobile device that zmNinja is installed on? Correct yes but only using a browser Safari
d) Does accessing APIs using a browser via LAN work ? (see this) NO - I get a bunch of messages about cake

"success": false,
"data": {
"name": "Not Authenticated",
"message": "Not Authenticated",
"url": "\/zm\/api\/host\/getVersion.json",
"exception": {
"class": "UnauthorizedException",
"code": 401,
"message": "Not Authenticated",
"trace": [
"#0 \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Event\/CakeEventManager.php(243): AppController->beforeFilter(Object(CakeEvent))",
"#1 \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Controller\/Controller.php(677): CakeEventManager->dispatch(Object(CakeEvent))",
"#2 \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Routing\/Dispatcher.php(189): Controller->startupProcess()",
"#3 \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Routing\/Dispatcher.php(167): Dispatcher->_invoke(Object(HostController), Object(CakeRequest))",
"#4 \/usr\/share\/zoneminder\/www\/api\/app\/webroot\/index.php(107): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))",
"#5 {main}"


e) Does accessing APIs using a browser via WAN work? (same test as above) yes I get this
{
"version": "1.32.3",
"apiversion": "1.0"
}

Regards Tim
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: API broken when upgraded from 1.30 to 1.32

Post by asker »

Now I am totally confused. Your last response seems to be the opposite of what you said before. API via browser works on LAN but not WAN.

Is it possible for me to get access to your ZM console with a test account? If so, please send it to pliablepixels@gmail.com
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
timf
Posts: 132
Joined: Mon Mar 21, 2005 4:07 pm
Location: Lytham St.Annes Lancs.

Re: API broken when upgraded from 1.30 to 1.32

Post by timf »

sorry for confusing you, I've sent you a message with log in details.

FYI things seems to have 'flipped over' to the situation before - I know not why....

Regards Tim
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: API broken when upgraded from 1.30 to 1.32

Post by asker »

Responded via email too. Works fine for me using WAN.
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Post Reply