Page 1 of 2

API changed in .23 or broken?

Posted: Thu Jan 18, 2018 2:38 pm
by geraldbrandt
Hi,

I use the API to change a couple of cameras from Modect to Monitor and back at specific times during the day. It was working in .20, but doesn't work anymore.

Has there been a change, or is there something I can trace to help?

Code: Select all

/usr/bin/curl  -XPOST http://localhost/zm/api/monitors/3.json -d "Monitor[Function]=Modect&Monitor[Enabled]=1"
{"message":"Error"}
Gerald

Re: API changed in .23 or broken?

Posted: Fri Jan 19, 2018 3:14 pm
by geraldbrandt
Still bad in .24

Any help I can give in tracking this down?

Re: API changed in .23 or broken?

Posted: Fri Jan 19, 2018 3:56 pm
by iconnor
weird... I use this heavily. you can look in /var/log/zm/cake*.log

Re: API changed in .23 or broken?

Posted: Fri Jan 19, 2018 10:00 pm
by geraldbrandt
Here it is:

Code: Select all

2018-01-19 08:15:02 Notice: Notice (8): Use of undefined constant ZM_SERVER_ID - assumed 'ZM_SERVER_ID' in [/usr
Trace:
MonitorsController::edit() - APP/Controller/MonitorsController.php, line 172
ReflectionMethod::invokeArgs() - [internal], line ??
Controller::invokeAction() - CORE/Cake/Controller/Controller.php, line 491
AppController::invokeAction() - APP/Plugin/Crud/Lib/CrudControllerTrait.php, line 31
Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 193
Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 167
[main] - APP/webroot/index.php, line 107

Re: API changed in .23 or broken?

Posted: Sat Jan 20, 2018 2:08 am
by iconnor
Ah.. I understand the problem. I'll push a fixed version tonight.

Re: API changed in .23 or broken?

Posted: Sat Jan 20, 2018 6:00 pm
by geraldbrandt
Awesome, thank you!

Re: API changed in .23 or broken?

Posted: Sat Jan 20, 2018 6:09 pm
by geraldbrandt
Still no go, but this may be due to a failed(ish) upgrade (in another post)

Code: Select all

2018-01-20 12:06:52 Error: [ParseError] syntax error, unexpected ']', expecting ',' or ')'
Request URL: /zm/api/monitors/3.json
Stack Trace:
#0 [internal function]: App::load('MonitorsControl...')
#1 [internal function]: spl_autoload_call('MonitorsControl...')
#2 /usr/share/zoneminder/www/api/lib/Cake/Routing/Dispatcher.php(266): class_exists('MonitorsControl...')
#3 /usr/share/zoneminder/www/api/lib/Cake/Routing/Dispatcher.php(235): Dispatcher->_loadController(Object(CakeRequest))
#4 /usr/share/zoneminder/www/api/lib/Cake/Routing/Dispatcher.php(158): Dispatcher->_getController(Object(CakeRequest), Object(CakeResponse))
#5 /usr/share/zoneminder/www/api/app/webroot/index.php(107): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#6 {main}

Re: API changed in .23 or broken?

Posted: Tue Jan 23, 2018 10:51 pm
by iconnor
Latest packages should fix this.

Re: API changed in .23 or broken? Still .28

Posted: Fri Jan 26, 2018 2:06 pm
by geraldbrandt
I'm still having issues in .28:

Code: Select all

/usr/bin/curl  -XPOST http://localhost/zm/api/monitors/4.json -d "Monitor[Function]=Modect&Monitor[Enabled]=1"
{"message":"Error"}
There was nothing written to any of the cake logs.

Gerald

Re: API changed in .23 or broken?

Posted: Mon Jan 29, 2018 11:17 pm
by geraldbrandt
Okay, .29 changed it up again!

Code: Select all

root@zoneminder2:~# /usr/bin/curl  -XPOST http://localhost/zm/api/monitors/3.json -d "Monitor[Function]=Monitor&Monitor[Enabled]=1"
{"message":"Error Array\n(\n    [Function] => Array\n        (\n            [0] => Please choose one of the following values : None, Monitor, Modect, Record, Mocord, Nodect\n            [1] => Please choose one of the following values : None, Monitor, Modect, Record, Mocord, Nodect\n        )\n\n)\n"}
The cake logfile is empty (has been since the 20th), so maybe logging got turned off somehow?

Gerald

Re: API changed in .23 or broken?

Posted: Tue Jan 30, 2018 2:19 am
by iconnor
Uh... .29 was supposed to fix it... where are you getting your packages from?

Re: API changed in .23 or broken?

Posted: Tue Jan 30, 2018 2:26 am
by iconnor
Sigh.. I hate git submodules. New packages building.

Re: API changed in .23 or broken?

Posted: Tue Jan 30, 2018 3:28 am
by geraldbrandt
iconnor wrote: Tue Jan 30, 2018 2:19 am Uh... .29 was supposed to fix it... where are you getting your packages from?
From your repo.deb http://ppa.launchpad.net/iconnor/zonemi ... eas/ubuntu xenial main

Gerald

Re: API changed in .23 or broken?

Posted: Tue Jan 30, 2018 3:29 am
by geraldbrandt
iconnor wrote: Tue Jan 30, 2018 2:26 am Sigh.. I hate git submodules. New packages building.
No worries. I know this is alpha/beta code. I'm using it hoping my testing and feedback will help.

Gerald

Re: API changed in .23 or broken?

Posted: Tue Jan 30, 2018 3:40 am
by iconnor
I feel like I'm quashing some of the really hard long-standing wierd bugs. I'm going to lay off any new features for a while and just put polish on it.
Thanks for your patience.