API - Not Authenticated after upgrade

Current Development version likely to have breaking changes
Post Reply
tippers
Posts: 13
Joined: Wed Nov 04, 2015 10:44 pm

API - Not Authenticated after upgrade

Post by tippers »

Hi,

I've upgraded from 1.36.33 to 1.37.47 and the system is working but zmNinja isn't. I've checked the API settings from here: https://zmninja.readthedocs.io/en/lates ... g-api.html but the monitors.json returns the following:

{
"success": false,
"data": {
"name": "Not Authenticated",
"message": "Not Authenticated",
"url": "/zm/api/monitors.json",
"exception": {
"class": "UnauthorizedException",
"code": 401,
"message": "Not Authenticated"
}
}
}

This is from a second tab in my browser with the first tab logged in to Zoneminder.
The settings were all correct except for AUTH_HASH_IPS which I had to disable. Not sure if this got changed during the upgrade but still get Not Authenticated. Restarted the Zoneminder service too.
zmNinja seems to suggest it authenticates but can't load the events list.
tippers
Posts: 13
Joined: Wed Nov 04, 2015 10:44 pm

Re: API - Not Authenticated after upgrade

Post by tippers »

Reading this https://zmninja.readthedocs.io/en/lates ... ort-errors some of the event log is below.
The email button in the app doesn't work so I had to copy/paste what looks to be the log entry where the error occurs into an email.

Nov 23, 2023 05:26:31:667 PM ERROR Error fetching events for page 2 Err: {"status":500,"headers":{"strict-transport-security":"max-age=15552000; includeSubDomains","server":"Apache/2.4.52 (Ubuntu)","content-type":"application/json; charset=UTF-8","content-length":"551","connection":"close","date":"Thu, 23 Nov 2023 17:26:31 GMT"},"url":"https://<<url removed>>/zm/api/events/index/AlarmFrames%20%3E=:1.json?&sort=StartTime&direction=desc&page=2&token=<removed>&amp;direction=desc&amp;page=2&amp;token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNzAwNzUzOTI3LCJleHAiOjE3MDA3NjExMjcsInVzZXIiOiJhZG1pbiIsInR5cGUiOiJhY2Nlc3MifQ.Y4qjzj6F2JMVH4RBddG8Wjor1ItDCNrbWM1PgnYx9I8\",\"exception\":{\"class\":\"TypeError\",\"code\":0,\"message\":\"count(): Argument #1 ($value) must be of type Countable|array, null given\"}}}"}
tippers
Posts: 13
Joined: Wed Nov 04, 2015 10:44 pm

Re: API - Not Authenticated after upgrade

Post by tippers »

Other functions in zmNinja (Live view, Status etc) seem to be working ok just the retrieving of events using Events List.
User avatar
iconnor
Posts: 3197
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: API - Not Authenticated after upgrade

Post by iconnor »

I actually fixed that last night but hadn't pushed it yet.

Packages building now.
tippers
Posts: 13
Joined: Wed Nov 04, 2015 10:44 pm

Re: API - Not Authenticated after upgrade

Post by tippers »

Perfect, updated and fixed.

Many thanks
Post Reply