API Problem after update vom 1.30

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
wtfka
Posts: 2
Joined: Sun Feb 11, 2018 10:57 am

API Problem after update vom 1.30

Post by wtfka »

Hi,

I have updated Zoneminder from 1.30 to 1.32 on an Ubuntu 16.04 Server Installation. Everything works fine (monitors, events, capturing, ...) but zmninja cannot connect ("Check your Credentials"). For testing i have disabled authentication, but i think its a problem with the API:

http://server/zm/api/host/getVersion.json

Code: Select all

{
    "version": "1.32.3",
    "apiversion": "1.0"
}

http://server/zm/api/host/monitors.json

Code: Select all

{
    "success": false,
    "data": {
        "code": 404,
        "name": "Action HostController::monitors() could not be found.",
        "message": "Action HostController::monitors() could not be found.",
        "url": "\/zm\/api\/host\/monitors.json",
        "exception": {
            "class": "MissingActionException",
            "code": 404,
            "message": "Action HostController::monitors() could not be found.",
            "trace": [
                "#0 \/usr\/share\/zoneminder\/www\/api\/app\/Plugin\/Crud\/Lib\/CrudControllerTrait.php(31): Controller->invokeAction(Object(CakeRequest))",
                "#1 \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Routing\/Dispatcher.php(193): AppController->invokeAction(Object(CakeRequest))",
                "#2 \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Routing\/Dispatcher.php(167): Dispatcher->_invoke(Object(HostController), Object(CakeRequest))",
                "#3 \/usr\/share\/zoneminder\/www\/api\/app\/webroot\/index.php(107): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))",
                "#4 {main}"
            ]
        },
        "queryLog": []
    }
}
Any Ideas?
sorry for my bad english
k-sudak
Posts: 7
Joined: Thu Apr 23, 2009 8:32 am

Re: API Problem after update vom 1.30

Post by k-sudak »

Have you got this output in your browser?

{
"version": "1.32.3",
"apiversion": "1.0"
}

I have the same problem, read that "http://server/zm/api/host/getVersion.json" should be opened in the same browser where you are already logged in to your ZM server.
k-sudak
Posts: 7
Joined: Thu Apr 23, 2009 8:32 am

Re: API Problem after update vom 1.30

Post by k-sudak »

Actually, I have just an empty page in output :(
Don't know how to fix the permissions.
Already run # chown -R www-data:www-data /usr/share/zoneminder/www/api but the result same.
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: API Problem after update vom 1.30

Post by bbunge »

wtfka wrote: Tue Jan 15, 2019 7:18 am Hi,

I have updated Zoneminder from 1.30 to 1.32 on an Ubuntu 16.04 Server Installation. Everything works fine (monitors, events, capturing, ...) but zmninja cannot connect ("Check your Credentials"). For testing i have disabled authentication, but i think its a problem with the API:

http://server/zm/api/host/getVersion.json

Code: Select all

{
    "version": "1.32.3",
    "apiversion": "1.0"
}

http://server/zm/api/host/monitors.json

Code: Select all

{
    "success": false,
    "data": {
        "code": 404,
        "name": "Action HostController::monitors() could not be found.",
        "message": "Action HostController::monitors() could not be found.",
        "url": "\/zm\/api\/host\/monitors.json",
        "exception": {
            "class": "MissingActionException",
            "code": 404,
            "message": "Action HostController::monitors() could not be found.",
            "trace": [
                "#0 \/usr\/share\/zoneminder\/www\/api\/app\/Plugin\/Crud\/Lib\/CrudControllerTrait.php(31): Controller->invokeAction(Object(CakeRequest))",
                "#1 \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Routing\/Dispatcher.php(193): AppController->invokeAction(Object(CakeRequest))",
                "#2 \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Routing\/Dispatcher.php(167): Dispatcher->_invoke(Object(HostController), Object(CakeRequest))",
                "#3 \/usr\/share\/zoneminder\/www\/api\/app\/webroot\/index.php(107): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))",
                "#4 {main}"
            ]
        },
        "queryLog": []
    }
}
Any Ideas?
sorry for my bad english
Make sure in ZmNinja Settings/path to cgi-bin you have http://serverip/zm/cgi-bin

Just did an upgrade on Ubuntu 16.04 ZM 1.30.4 to 1.32.3 with no issues. ZmNinja works, too.

The upgrade is simple: add the 1.32.x PPA, service zoneminder stop, apt update, apt upgrade, service zoneminder start
k-sudak
Posts: 7
Joined: Thu Apr 23, 2009 8:32 am

Re: API Problem after update vom 1.30

Post by k-sudak »

I can't upgrade so simple, because there is for Raspbian-stretch no any packets with v1.32.3
Any recommendations?
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: API Problem after update vom 1.30

Post by rockedge »

try this: in a browser login to ZM and then open a new tab or window and then run http://server/zm/api/host/monitors.json

what seems to be happening is the authorization for the API response is missing.....not logged in.

the getVersion.json giving a reponse means the API is working okay,
Post Reply