Debian 9 1.30.0 ->1.30.4 breaks API

Forum for questions and support relating to the 1.30.x releases only.
Locked
pgrunwald
Posts: 71
Joined: Mon Mar 06, 2017 9:26 pm

Debian 9 1.30.0 ->1.30.4 breaks API

Post by pgrunwald »

Did the normal

Code: Select all

sudo  apt updatate
and

Code: Select all

 sudo apt upgrade
today and was pleased to see Zoneminder 1.30.4 show up out of backports.

Updated the database with

Code: Select all

sudo zmupdate.pl
and Zoneminder console is working fine.

zmNinja is broken.

Code: Select all

http://my_server/zm/api/host/getVersion.json
gives me a blank page.

Searching I found a thread so I

Code: Select all

 sudo apt install php-apcu php-apcu-bc
no effect

https://my_server/zm/api/monitors.json and events.json gives me

Code: Select all

Fatal error: Uncaught FatalErrorException: [MissingPluginException] Plugin Crud could not be found. #0 /usr/share/php/Cake/Core/App.php(227): CakePlugin::path('Crud') #1 /usr/share/php/Cake/Core/App.php(549): App::path('Lib', 'Crud') #2 [internal function]: App::load('CrudControllerT...') #3 /usr/share/zoneminder/www/api/app/Controller/AppController.php(34): spl_autoload_call('CrudControllerT...') #4 /usr/share/php/Cake/Core/App.php(567): include('/usr/share/zone...') #5 [internal function]: App::load('AppController') #6 [internal function]: spl_autoload_call('AppController') #7 /usr/share/php/Cake/Error/ExceptionRenderer.php(152): class_exists('AppController') #8 /usr/share/php/Cake/Error/ExceptionRenderer.php(92): ExceptionRenderer->_getController(Object(MissingPluginException)) #9 /usr/share/php/Cake/Error/ErrorHandler.php(126): ExceptionRenderer->__construct(Object(MissingPluginException)) #10 [internal function]: ErrorHandler::handleException(Object(MissingPluginException)) #11 {main} in /usr/share/php/Cake/Error/Err in /usr/share/php/Cake/Error/ErrorHandler.php on line 138
CakePHP: the rapid development php framework

Fatal Error
Error: Uncaught FatalErrorException: [MissingPluginException] Plugin Crud could not be found. #0 /usr/share/php/Cake/Core/App.php(227): CakePlugin::path('Crud') #1 /usr/share/php/Cake/Core/App.php(549): App::path('Lib', 'Crud') #2 [internal function]: App::load('CrudControllerT...') #3 /usr/share/zoneminder/www/api/app/Controller/AppController.php(34): spl_autoload_call('CrudControllerT...') #4 /usr/share/php/Cake/Core/App.php(567): include('/usr/share/zone...') #5 [internal function]: App::load('AppController') #6 [internal function]: spl_autoload_call('AppController') #7 /usr/share/php/Cake/Error/ExceptionRenderer.php(152): class_exists('AppController') #8 /usr/share/php/Cake/Error/ExceptionRenderer.php(92): ExceptionRenderer->_getController(Object(MissingPluginException)) #9 /usr/share/php/Cake/Error/ErrorHandler.php(126): ExceptionRenderer->__construct(Object(MissingPluginException)) #10 [internal function]: ErrorHandler::handleException(Object(MissingPluginException)) #11 {main} in /usr/share/php/Cake/Error/Err	
File: /usr/share/php/Cake/Error/ErrorHandler.php	
Line: 138

Notice: If you want to customize this error message, create app/View/Errors/fatal_error.ctp

CakePHP: the rapid development php framework
CakePHP 2.8.5

Notice (8): Use of undefined constant ZM_DB_USER - assumed 'ZM_DB_USER' [CORE/Cake/Model/ConnectionManager.php, line 69]
Notice (8): Use of undefined constant ZM_DB_PASS - assumed 'ZM_DB_PASS' [CORE/Cake/Model/ConnectionManager.php, line 69]
Notice (8): Use of undefined constant ZM_DB_NAME - assumed 'ZM_DB_NAME' [CORE/Cake/Model/ConnectionManager.php, line 69]
cakephp version (2.8.5-1) is installed.


I thought I would check here before I really broke something trying to fix this!
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Debian 9 1.30.0 ->1.30.4 breaks API

Post by rockedge »

dumb question....did you restart Apache after installing php-apcu and php-apcu-bc?
pgrunwald
Posts: 71
Joined: Mon Mar 06, 2017 9:26 pm

Re: Debian 9 1.30.0 ->1.30.4 breaks API

Post by pgrunwald »

Yea, I have actually rebooted. I think I need a newer version of Crud/Cake that is not in stable. I can't find the plugin.
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Debian 9 1.30.0 ->1.30.4 breaks API

Post by rockedge »

anything here that helps?
https://github.com/FriendsOfCake/crud
pgrunwald
Posts: 71
Joined: Mon Mar 06, 2017 9:26 pm

Re: Debian 9 1.30.0 ->1.30.4 breaks API

Post by pgrunwald »

I was going to try this: https://tecadmin.net/setup-cakephp-3-on-linux/ (step 2)

then this:
https://crud.readthedocs.io/en/latest/installation.html

When I get some time to mess around.
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: Debian 9 1.30.0 ->1.30.4 breaks API

Post by SteveGilvarry »

The cake 2 and 3 are not compatible. Generally that missing crud error comes when the git submodule was not included in the source.
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Debian 9 1.30.0 ->1.30.4 breaks API

Post by rockedge »

yes the only time I saw this error is when I built ZM from source and forgot the

Code: Select all

git submodule update --init --recursive
so zoneminder would build but API was not operational. With the submodule update ZM builds correctly and the API works.
This I discovered while working with Puppy Linux and ZM.
pgrunwald
Posts: 71
Joined: Mon Mar 06, 2017 9:26 pm

Re: Debian 9 1.30.0 ->1.30.4 breaks API

Post by pgrunwald »

Who did the backport? Should I file a bug report?
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: Debian 9 1.30.0 ->1.30.4 breaks API

Post by SteveGilvarry »

If you are missing web/api/app/plugin/crud then I suspect best option is a bug report. I can even see where they have patched the cake build to ignore the submodule check, one would assume they put some other process in place to drop the submodule in. Submodules are more grief than they are worth.
https://anonscm.debian.org/cgit/collab- ... b4785ba49e
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Debian 9 1.30.0 ->1.30.4 breaks API

Post by knight-of-ni »

I saw this a few weeks ago in our IRC channel. There is a new zoneminder 1.30.4 deb in the unstable repos.

Rather than use the cake & crud libraries bundled with ZoneMinder, the package maintainer took this code out, and attempted to get ZoneMinder to use cakephp installed as a separate package. Unfortunately, it does not look like they were successful because ZoneMinder can't find the Crud module.

One can see this is the case because the paths in the error message(s) look like:

Code: Select all

/usr/share/php/Cake/Core
rather than:

Code: Select all

/usr/share/zoneminder/api/lib/Cake/Core
The unfortunate thing about this is we aren't going to be of much help since this is something a third party has done.

tldr: yes, you should file a bug report against this pacakge on the debian site if one has not already been created

Oh look at you... you already created it:
https://bugs.debian.org/cgi-bin/bugrepo ... bug=877452

Someone gets a Gold Star!
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
nimoy
Posts: 2
Joined: Fri Oct 13, 2017 10:21 am

Re: Debian 9 1.30.0 ->1.30.4 breaks API

Post by nimoy »

Hi guys ! I am using ZM for about one year and am quite happy with it. Got about 20 cam's running on debian(9.1).

Trying to solve why I have no thumbnails in my event-list after upgarding to 1.30.4 ( clean new install ) i found this thread.

The http://my_server/zm/api/host/getVersion.json shows errors like :

Warning: mkdir(): Permission denied in /usr/share/php/Cake/Cache/Engine/FileEngine.php on line 380
Warning: _cake_core_ cache was unable to write 'cake_dev_de-de' to File cache in /usr/share/php/Cake/Cache/Cache.php on line 327
Warning: /usr/share/zoneminder/www/api/app/tmp/cache/persistent/ is not writable in /usr/share/php/Cake/Cache/Engine/FileEngine.php on line 385
Fatal error: Uncaught CacheException: Cache engine "_cake_core_" is not properly configured. Ensure required extensions are installed, and credentials/permissions are correct in /usr/share/php/Cake/Cache/Cache.php on line 186
CacheException: Cache engine "_cake_core_" is not properly configured. Ensure required extensions are installed, and credentials/permissions are correct in /usr/share/php/Cake/Cache/Cache.php on line 186

Can I assume this is related to the .deb package and cake & crud stuff mentioned above ?
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Debian 9 1.30.0 ->1.30.4 breaks API

Post by bbunge »

nimoy wrote: Fri Oct 13, 2017 1:08 pm Hi guys ! I am using ZM for about one year and am quite happy with it. Got about 20 cam's running on debian(9.1).

Trying to solve why I have no thumbnails in my event-list after upgarding to 1.30.4 ( clean new install ) i found this thread.

The http://my_server/zm/api/host/getVersion.json shows errors like :

Warning: mkdir(): Permission denied in /usr/share/php/Cake/Cache/Engine/FileEngine.php on line 380
Warning: _cake_core_ cache was unable to write 'cake_dev_de-de' to File cache in /usr/share/php/Cake/Cache/Cache.php on line 327
Warning: /usr/share/zoneminder/www/api/app/tmp/cache/persistent/ is not writable in /usr/share/php/Cake/Cache/Engine/FileEngine.php on line 385
Fatal error: Uncaught CacheException: Cache engine "_cake_core_" is not properly configured. Ensure required extensions are installed, and credentials/permissions are correct in /usr/share/php/Cake/Cache/Cache.php on line 186
CacheException: Cache engine "_cake_core_" is not properly configured. Ensure required extensions are installed, and credentials/permissions are correct in /usr/share/php/Cake/Cache/Cache.php on line 186

Can I assume this is related to the .deb package and cake & crud stuff mentioned above ?
Install the php7-gd. See the wiki for the full Debian 9 install procedure.
nimoy
Posts: 2
Joined: Fri Oct 13, 2017 10:21 am

Re: Debian 9 1.30.0 ->1.30.4 breaks API

Post by nimoy »

Thanks for your help !

In Debian the package is called php7.0-gd.

"apt-get install php7.0-gd" and "dpkg-reconfigure zoneminder" did the job !

Thanks again !
Locked