You are not logged in.

#1 2016-02-19 12:31:33

felixita
Member
From: Venezia
Registered: 2016-02-02
Posts: 32

Zoneminder 1.29.0 and API problem

Hi! Maybe someone are using Zoneminder with working API? I'm trying to use ZM-Ninja app (mobile and dasktop) but API are not working correctly. Problem seem to be imputable to PHP7 and API version (2.5.0 RC1).

My http://zmip/zoneminder/api/ don't display any error but my http://zm/zoneminder/api/monitors.json show error:

 {
    "success": false,
    "data": {
        "code": 500,
        "name": "Cannot declare class CakeText, because the name is already in use",
        "message": "Cannot declare class CakeText, because the name is already in use",
        "url": "\/zoneminder\/api\/monitors.json",
        "exception": {
            "class": "FatalErrorException",
            "code": 500,
            "message": "Cannot declare class CakeText, because the name is already in use",
            "trace": [
                "#0 \/srv\/http\/zoneminder\/api\/lib\/Cake\/Error\/ErrorHandler.php(203): ErrorHandler::handleFatalError(64, 'Cannot declare ...', '\/srv\/http\/zonem...', 25)",
                "#1 \/srv\/http\/zoneminder\/api\/lib\/Cake\/Core\/App.php(929): ErrorHandler::handleError(64, 'Cannot declare ...', '\/srv\/http\/zonem...', 25, Array)",
                "#2 \/srv\/http\/zoneminder\/api\/lib\/Cake\/Core\/App.php(902): App::_checkFatalError()",
                "#3 [internal function]: App::shutdown()",
                "#4 {main}"
            ]
        },
        "queryLog": {
            "default": {
                "log": [
                    {
                        "query": "SELECT `Config`.`Id`, `Config`.`Name`, `Config`.`Value`, `Config`.`Type`, `Config`.`DefaultValue`, `Config`.`Hint`, `Config`.`Pattern`, `Config`.`Format`, `Config`.`Prompt`, `Config`.`Help`, `Config`.`Category`, `Config`.`Readonly`, `Config`.`Requires` FROM `zm`.`Config` AS `Config`   WHERE `Config`.`Name` = 'ZM_OPT_USE_API'    LIMIT 1",
                        "params": [],
                        "affected": 1,
                        "numRows": 1,
                        "took": 0
                    },
                    {
                        "query": "SELECT `Config`.`Id`, `Config`.`Name`, `Config`.`Value`, `Config`.`Type`, `Config`.`DefaultValue`, `Config`.`Hint`, `Config`.`Pattern`, `Config`.`Format`, `Config`.`Prompt`, `Config`.`Help`, `Config`.`Category`, `Config`.`Readonly`, `Config`.`Requires` FROM `zm`.`Config` AS `Config`   WHERE `Config`.`Name` = 'ZM_OPT_USE_AUTH'    LIMIT 1",
                        "params": [],
                        "affected": 1,
                        "numRows": 1,
                        "took": 0
                    },
                    {
                        "query": "SELECT `User`.`Id`, `User`.`Username`, `User`.`Password`, `User`.`Language`, `User`.`Enabled`, `User`.`Stream`, `User`.`Events`, `User`.`Control`, `User`.`Monitors`, `User`.`Groups`, `User`.`Devices`, `User`.`System`, `User`.`MaxBandwidth`, `User`.`MonitorIds` FROM `zm`.`Users` AS `User`   WHERE `User`.`Username` = 'admin'    LIMIT 1",
                        "params": [],
                        "affected": 1,
                        "numRows": 1,
                        "took": 0
                    },
                    {
                        "query": "SELECT `Config`.`Id`, `Config`.`Name`, `Config`.`Value`, `Config`.`Type`, `Config`.`DefaultValue`, `Config`.`Hint`, `Config`.`Pattern`, `Config`.`Format`, `Config`.`Prompt`, `Config`.`Help`, `Config`.`Category`, `Config`.`Readonly`, `Config`.`Requires` FROM `zm`.`Config` AS `Config`   WHERE `Config`.`Name` = 'ZM_OPT_USE_API'    LIMIT 1",
                        "params": [],
                        "affected": 1,
                        "numRows": 1,
                        "took": 0
                    },
                    {
                        "query": "SELECT `Config`.`Id`, `Config`.`Name`, `Config`.`Value`, `Config`.`Type`, `Config`.`DefaultValue`, `Config`.`Hint`, `Config`.`Pattern`, `Config`.`Format`, `Config`.`Prompt`, `Config`.`Help`, `Config`.`Category`, `Config`.`Readonly`, `Config`.`Requires` FROM `zm`.`Config` AS `Config`   WHERE `Config`.`Name` = 'ZM_OPT_USE_AUTH'    LIMIT 1",
                        "params": [],
                        "affected": 1,
                        "numRows": 1,
                        "took": 0
                    },
                    {
                        "query": "SELECT `User`.`Id`, `User`.`Username`, `User`.`Password`, `User`.`Language`, `User`.`Enabled`, `User`.`Stream`, `User`.`Events`, `User`.`Control`, `User`.`Monitors`, `User`.`Groups`, `User`.`Devices`, `User`.`System`, `User`.`MaxBandwidth`, `User`.`MonitorIds` FROM `zm`.`Users` AS `User`   WHERE `User`.`Username` = 'admin'    LIMIT 1",
                        "params": [],
                        "affected": 1,
                        "numRows": 1,
                        "took": 0
                    }
                ],
                "count": 6,
                "time": 0
            }
        }
    }
}

Except API, all other work fine: i can see my cameras from mail page http://zmip/zoneminder.

ZM-Ninja desktop login don't return error but monitors streaming not work. Below is log generated by ZM-Ninja.

version:1.0.7D

Feb 19, 2016 1:22:35 PM ERROR Monitor load failed {"success":false,"data":{"code":500,"name":"Cannot declare class CakeText, because the name is already in use","message":"Cannot declare class CakeText, because the name is already in use","url":"/zoneminder/api/monitors.json","exception":{"class":"FatalErrorException","code":500,"message":"Cannot declare class CakeText, because the name is already in use","trace":["#0 /srv/http/zoneminder/api/lib/Cake/Error/ErrorHandler.php(203): ErrorHandler::handleFatalError(64, 'Cannot declare ...', '/srv/http/zonem...', 25)","#1 /srv/http/zoneminder/api/lib/Cake/Core/App.php(929): ErrorHandler::handleError(64, 'Cannot declare ...', '/srv/http/zonem...', 25, Array)","#2 /srv/http/zoneminder/api/lib/Cake/Core/App.php(902): App::_checkFatalError()","#3 [internal function]: App::shutdown()","#4 {main}"]},"queryLog":{"default":{"log":[{"query":"SELECT `Config`.`Id`, `Config`.`Name`, `Config`.`Value`, `Config`.`Type`, `Config`.`DefaultValue`, `Config`.`Hint`, `Config`.`Pattern`, `Config`.`Format`, `Config`.`Prompt`, `Config`.`Help`, `Config`.`Category`, `Config`.`Readonly`, `Config`.`Requires` FROM `zm`.`Config` AS `Config`   WHERE `Config`.`Name` = 'ZM_OPT_USE_API'    LIMIT 1","params":[],"affected":1,"numRows":1,"took":0},{"query":"SELECT `Config`.`Id`, `Config`.`Name`, `Config`.`Value`, `Config`.`Type`, `Config`.`DefaultValue`, `Config`.`Hint`, `Config`.`Pattern`, `Config`.`Format`, `Config`.`Prompt`, `Config`.`Help`, `Config`.`Category`, `Config`.`Readonly`, `Config`.`Requires` FROM `zm`.`Config` AS `Config`   WHERE `Config`.`Name` = 'ZM_OPT_USE_AUTH'    LIMIT 1","params":[],"affected":1,"numRows":1,"took":0},{"query":"SELECT `User`.`Id`, `User`.`Username`, `User`.`Password`, `User`.`Language`, `User`.`Enabled`, `User`.`Stream`, `User`.`Events`, `User`.`Control`, `User`.`Monitors`, `User`.`Groups`, `User`.`Devices`, `User`.`System`, `User`.`MaxBandwidth`, `User`.`MonitorIds` FROM `zm`.`Users` AS `User`   WHERE `User`.`Username` = 'lele'    LIMIT 1","params":[],"affected":1,"numRows":1,"took":0},{"query":"SELECT `Config`.`Id`, `Config`.`Name`, `Config`.`Value`, `Config`.`Type`, `Config`.`DefaultValue`, `Config`.`Hint`, `Config`.`Pattern`, `Config`.`Format`, `Config`.`Prompt`, `Config`.`Help`, `Config`.`Category`, `Config`.`Readonly`, `Config`.`Requires` FROM `zm`.`Config` AS `Config`   WHERE `Config`.`Name` = 'ZM_OPT_USE_API'    LIMIT 1","params":[],"affected":1,"numRows":1,"took":0},{"query":"SELECT `Config`.`Id`, `Config`.`Name`, `Config`.`Value`, `Config`.`Type`, `Config`.`DefaultValue`, `Config`.`Hint`, `Config`.`Pattern`, `Config`.`Format`, `Config`.`Prompt`, `Config`.`Help`, `Config`.`Category`, `Config`.`Readonly`, `Config`.`Requires` FROM `zm`.`Config` AS `Config`   WHERE `Config`.`Name` = 'ZM_OPT_USE_AUTH'    LIMIT 1","params":[],"affected":1,"numRows":1,"took":0},{"query":"SELECT `User`.`Id`, `User`.`Username`, `User`.`Password`, `User`.`Language`, `User`.`Enabled`, `User`.`Stream`, `User`.`Events`, `User`.`Control`, `User`.`Monitors`, `User`.`Groups`, `User`.`Devices`, `User`.`System`, `User`.`MaxBandwidth`, `User`.`MonitorIds` FROM `zm`.`Users` AS `User`   WHERE `User`.`Username` = 'lele'    LIMIT 1","params":[],"affected":1,"numRows":1,"took":0}],"count":6,"time":0}}}}
Feb 19, 2016 1:22:34 PM INFO getMonitors:Loading all monitors

Someone can help me to solve this problem?

Thanks.

Offline

#2 2016-02-24 02:59:04

paivaric
Member
Registered: 2016-02-24
Posts: 1

Re: Zoneminder 1.29.0 and API problem

+1

same problem sad

Offline

#3 2016-02-24 13:23:00

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: Zoneminder 1.29.0 and API problem

@paivaric, welcome to the forums.

Please note that we don't encourage posts that don't add any value to a thread, such as +1s.

https://wiki.archlinux.org/index.php/Fo … mpty_posts

If it is just for the sake of following a thread, you can subscribe to that thread instead.

Offline

#4 2016-03-01 05:12:32

undrwater
Member
Registered: 2016-03-01
Posts: 1

Re: Zoneminder 1.29.0 and API problem

I got a little bit further. I discovered the api directory was not owned by http. You can also check the log of zmninja for errors why it's not working.  That helped a bit for me.

Why not post your zmninja log here.

Offline

#5 2016-11-24 14:15:23

davidm
Member
Registered: 2009-04-25
Posts: 371

Re: Zoneminder 1.29.0 and API problem

Just to provide some more information for those searching.  There is also a problem with the version of cake zoneminder 1.29 uses and php 7.  They fixed it in later versions by updating the version of cake bundled.  Though I haven't had a chance to try it yet myself, zoneminder 1.30 ought to work fine with php 7.

Offline

Board footer

Powered by FluxBB