ZM 1.30.4 API issue on ubuntu 17.10
ZM 1.30.4 API issue on ubuntu 17.10
I have an issue with zoneminder API after upgrading ubuntu to 17.10 distributive.
It looks like the is a problem with CakePHP:
[Fri Oct 20 16:09:04.536516 2017] [php7:error] [pid 13476] [client xx.xx.xx.xx] PHP Fatal error: Uncaught InternalErrorException: Internal Serv
er Error in /usr/share/php/Cake/Error/ErrorHandler.php:261\nStack trace:\n#0 /usr/share/php/Cake/Error/ErrorHandler.php(212): ErrorHandler::handleFatalError(256, '[MissingPluginE...', '/usr/share/php/...', 138)\n#1 [internal function]: ErrorHandler::handleError(256, '[MissingPluginE...', '/usr/share/php/...', 138, Array)\n#2 /usr/share/php/Cake/Error /ErrorHandler.php(138): trigger_error('[MissingPluginE...', 256)\n#3 [internal function]: ErrorHandler::handleException(Object(MissingPluginException))\n#4 {main}\n thrown in
/usr/share/php/Cake/Error/ErrorHandler.php on line 261
In web interface, while trying to get access to API, I've got the message on the picture attached.
Does somebody have experience of upgrading to 17.10 with ZM 1.30.4+dfsg-2 installed?
Thanks!
It looks like the is a problem with CakePHP:
[Fri Oct 20 16:09:04.536516 2017] [php7:error] [pid 13476] [client xx.xx.xx.xx] PHP Fatal error: Uncaught InternalErrorException: Internal Serv
er Error in /usr/share/php/Cake/Error/ErrorHandler.php:261\nStack trace:\n#0 /usr/share/php/Cake/Error/ErrorHandler.php(212): ErrorHandler::handleFatalError(256, '[MissingPluginE...', '/usr/share/php/...', 138)\n#1 [internal function]: ErrorHandler::handleError(256, '[MissingPluginE...', '/usr/share/php/...', 138, Array)\n#2 /usr/share/php/Cake/Error /ErrorHandler.php(138): trigger_error('[MissingPluginE...', 256)\n#3 [internal function]: ErrorHandler::handleException(Object(MissingPluginException))\n#4 {main}\n thrown in
/usr/share/php/Cake/Error/ErrorHandler.php on line 261
In web interface, while trying to get access to API, I've got the message on the picture attached.
Does somebody have experience of upgrading to 17.10 with ZM 1.30.4+dfsg-2 installed?
Thanks!
Re: ZM 1.30.4 API issue on ubuntu 17.10
Looks like the problem is with cakephp not working. I did a fresh install of 17.10 with Zoneminder and the API's do not work either.
Still looking for a fix...
Still looking for a fix...
Re: ZM 1.30.4 API issue on ubuntu 17.10
I've tried to upgrade cakephp from github ( version 2.10 instead of 2.8 ), but still not results...
-
- Posts: 494
- Joined: Sun Jun 29, 2014 1:12 pm
- Location: Melbourne, AU
Re: ZM 1.30.4 API issue on ubuntu 17.10
I believe you will be missing the crud plugin from /api/app/plugin it is a specific version of friendsofcake crud. Best bet would be clone zm, init submodules and get the folder.
Or iconnor ppa which won’t be missing critical components.
Or iconnor ppa which won’t be missing critical components.
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
Random Selection of Cameras (Dahua and Hikvision)
Re: ZM 1.30.4 API issue on ubuntu 17.10
/Plugin is missing from /usr/share/zoneminder/www/api (as compared to a working Ubuntu 16.04 zm system)SteveGilvarry wrote: ↑Sat Oct 21, 2017 11:40 am I believe you will be missing the crud plugin from /api/app/plugin it is a specific version of friendsofcake crud. Best bet would be clone zm, init submodules and get the folder.
Or iconnor ppa which won’t be missing critical components.
Re: ZM 1.30.4 API issue on ubuntu 17.10
I was able to get the API working.
Fresh install of 17.10 with just LAMP and Webmin
Downloaded the Zesty .deb from the iconnor PPA and copied to my home directory. Shortened the name to zoneminder.deb
installed Zoneminder .deb with: apt install /home/bill/zoneminder.deb
used the WIKI instructions for 16.04 -zm 1.30.4 except used PHP 7.1 in one spot.
Suspect the vlc-plugins did not make it as I got one error at the end of the install.
Will try it again later. Lawn work calls on a beautiful day in Pennsylvania!
Fresh install of 17.10 with just LAMP and Webmin
Downloaded the Zesty .deb from the iconnor PPA and copied to my home directory. Shortened the name to zoneminder.deb
installed Zoneminder .deb with: apt install /home/bill/zoneminder.deb
used the WIKI instructions for 16.04 -zm 1.30.4 except used PHP 7.1 in one spot.
Suspect the vlc-plugins did not make it as I got one error at the end of the install.
Will try it again later. Lawn work calls on a beautiful day in Pennsylvania!
Re: ZM 1.30.4 API issue on ubuntu 17.10
Here is an interim install procedure for ZM on Ubuntu 17.10. Am working to get it on the WIKI
Install Zoneminder 1.30.4 on Ubuntu 17.10
There are some issues with the Zoneminder package provided with Ubuntu 17.10. This is an alternate install procedure that uses the install package from the iconnor PPA for Zesty (Ubuntu 17.04)
You will need to make a settings change to MySQL as follows:
This removes the current symbolic link
rm /etc/mysql/my.cnf
This moves the MYSQL Configuration file
cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf
To change MySQL settings:
nano /etc/mysql/my.cnf
In the [mysqld] section add the following
sql_mode = NO_ENGINE_SUBSTITUTION
Ctrl+o Enter to save
CTRL+x to exit
Restart MySQL
systemctl restart mysql
Download the Zoneminder install package from the iconnor PPA. Note this is for the 64 bit version.
wget https://launchpad.net/~iconnor/+archive ... _amd64.deb
Install Zoneminder - Note: Change (user) to the user in the home directory on your system
apt install vlc-plugin-base /home/(user)/zoneminder_1.30.4-zesty1_amd64.deb
Create a new user
adduser www-data video
Enable CGI, Zoneminder and rewrite configuration in Apache.
a2enmod cgi
a2enconf zoneminder
a2enmod rewrite
Fix Permissions
chown -R www-data:www-data /usr/share/zoneminder/
Enable and start Zoneminder
systemctl enable zoneminder
service zoneminder start
Add timezone to PHP
nano /etc/php/7.1/apache2/php.ini
Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone. Make sure to remove the ; from the front of date.timezone
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = America/New_York
Ctrl+o Enter to save
CTRL+x to exit
Restart Apache
service apache2 reload
IMPORTANT FINAL STEP: Open Zoneminder in a web browser (http://server-ip/zm). Click on Options - Paths and change PATH_ZMS to /zm/cgi-bin/nph-zms
Install Zoneminder 1.30.4 on Ubuntu 17.10
There are some issues with the Zoneminder package provided with Ubuntu 17.10. This is an alternate install procedure that uses the install package from the iconnor PPA for Zesty (Ubuntu 17.04)
You will need to make a settings change to MySQL as follows:
This removes the current symbolic link
rm /etc/mysql/my.cnf
This moves the MYSQL Configuration file
cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf
To change MySQL settings:
nano /etc/mysql/my.cnf
In the [mysqld] section add the following
sql_mode = NO_ENGINE_SUBSTITUTION
Ctrl+o Enter to save
CTRL+x to exit
Restart MySQL
systemctl restart mysql
Download the Zoneminder install package from the iconnor PPA. Note this is for the 64 bit version.
wget https://launchpad.net/~iconnor/+archive ... _amd64.deb
Install Zoneminder - Note: Change (user) to the user in the home directory on your system
apt install vlc-plugin-base /home/(user)/zoneminder_1.30.4-zesty1_amd64.deb
Create a new user
adduser www-data video
Enable CGI, Zoneminder and rewrite configuration in Apache.
a2enmod cgi
a2enconf zoneminder
a2enmod rewrite
Fix Permissions
chown -R www-data:www-data /usr/share/zoneminder/
Enable and start Zoneminder
systemctl enable zoneminder
service zoneminder start
Add timezone to PHP
nano /etc/php/7.1/apache2/php.ini
Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone. Make sure to remove the ; from the front of date.timezone
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = America/New_York
Ctrl+o Enter to save
CTRL+x to exit
Restart Apache
service apache2 reload
IMPORTANT FINAL STEP: Open Zoneminder in a web browser (http://server-ip/zm). Click on Options - Paths and change PATH_ZMS to /zm/cgi-bin/nph-zms
-
- Posts: 494
- Joined: Sun Jun 29, 2014 1:12 pm
- Location: Melbourne, AU
Re: ZM 1.30.4 API issue on ubuntu 17.10
Bbunge,
Caught iconnor today and he had time to spin up a 17.10 PPA now to hopefully save you some steps.
Thanks iconnor.
EDIT might still need the vlc package, need to check when I get home as Iconnor said he had issues with it building.
Caught iconnor today and he had time to spin up a 17.10 PPA now to hopefully save you some steps.
Thanks iconnor.
EDIT might still need the vlc package, need to check when I get home as Iconnor said he had issues with it building.
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
Random Selection of Cameras (Dahua and Hikvision)
-
- Posts: 494
- Joined: Sun Jun 29, 2014 1:12 pm
- Location: Melbourne, AU
Re: ZM 1.30.4 API issue on ubuntu 17.10
Nope issues with getting a new PPA for 17.10, version related and Iconnor is a little busy. Revert to bbunge workaround using 17.04
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
Random Selection of Cameras (Dahua and Hikvision)
Re: ZM 1.30.4 API issue on ubuntu 17.10
Having the same issue with the API not working. I'm assuming as long as I leave the DB in place I can remove the zoneminder package and install the .deb in its' place? I have cameras configured and working and did some tweaking etc so I'd prefer to not have to redo all my config. Worst case I could dump the DB and import later.
Re: ZM 1.30.4 API issue on ubuntu 17.10
Short answer is yes.lselinger wrote: ↑Mon Oct 30, 2017 8:37 pm Having the same issue with the API not working. I'm assuming as long as I leave the DB in place I can remove the zoneminder package and install the .deb in its' place? I have cameras configured and working and did some tweaking etc so I'd prefer to not have to redo all my config. Worst case I could dump the DB and import later.
With that said it would be a great idea to take a dump of the ZM database. Not sure if doing an uninstall will remove the zm database or not but it is best to be safe.
With a dump of the database you can go back to Ubuntu 16.04 and keep all your settings. Am still not sure about Ubuntu 17.10....
bb
Re: ZM 1.30.4 API issue on ubuntu 17.10
Ok this was bugging me and I probably didn't do this the right way, but I grabbed an older install's api/app/Plugin directory and copied it over just to see if it would work ... it did I now have zmninja working and the zm api functioning with an older (I'm assuming) version of Crud
CORRECTION: I 'kind of' have it working. From a fresh install of zmninja I can see everything and work with events/cameras etc (very cool app) however after I exit and try to start the app again, all I ever see is:
... on my phone although this may be something specific to zmninja
CORRECTION: I 'kind of' have it working. From a fresh install of zmninja I can see everything and work with events/cameras etc (very cool app) however after I exit and try to start the app again, all I ever see is:
Code: Select all
Application Error
The connection to the server was unsuccessful.
(file:///android_asset/www/index.html)
Re: ZM 1.30.4 API issue on ubuntu 17.10
lselinger wrote: ↑Tue Oct 31, 2017 4:57 pm... on my phone although this may be something specific to zmninjaCode: Select all
Application Error The connection to the server was unsuccessful. (file:///android_asset/www/index.html)
Yup, that was a zmNinja bug which you've been helping resolve (thanks )
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.
Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Re: ZM 1.30.4 API issue on ubuntu 17.10
hi guys, i try bbunge guide, all ok for one days then after invalid api in zmninja, api access failed.
log:
Logs for version:1.2.507D (desktop)
Nov 14, 2017 04:16 PM DEBUG 2nd auth API failed, going to login
Nov 14, 2017 04:16 PM DEBUG getAPIversion error handler {"data":"","status":500,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"url":"http://xxx.xxx.x.x/zm/api/host/getVersi ... ation/json, text/plain, */*"}},"statusText":"Internal Server Error"}
Nov 14, 2017 04:16 PM DEBUG getAPIversion called
Nov 14, 2017 04:16 PM DEBUG 2nd auth login worked
Nov 14, 2017 04:16 PM INFO Stream authentication construction:
Nov 14, 2017 04:16 PM DEBUG Storing login time as Tue Nov 14 2017 16:16:02 GMT+0100
Nov 14, 2017 04:16 PM INFO Deferring auth key, as monitorId unknown
Nov 14, 2017 04:16 PM DEBUG auth-success emit:Successful
Nov 14, 2017 04:16 PM INFO zmAutologin successfully logged into Zoneminder
Nov 14, 2017 04:16 PM INFO ZM has recaptcha disabled - good
Nov 14, 2017 04:16 PM INFO Checking if reCaptcha is enabled in ZM...
Nov 14, 2017 04:16 PM INFO zmAutologin called
Nov 14, 2017 04:16 PM DEBUG Resetting zmCookie...
Nov 14, 2017 04:16 PM DEBUG Doing the Aaron Hack after 1 sec....
Nov 14, 2017 04:16 PM INFO API Error handler: going to login getAPI returned error: "-1.-1.-1"
Nov 14, 2017 04:16 PM DEBUG getAPIversion error handler {"data":"","status":500,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"url":"http://xxx.xxx.x.x/zm/api/host/getVersi ... ation/json, text/plain, */*"}},"statusText":"Internal Server Error"}
Nov 14, 2017 04:16 PM INFO ZM has recaptcha disabled - good
Nov 14, 2017 04:16 PM DEBUG getAPIversion called
Nov 14, 2017 04:16 PM DEBUG PortalLogin: auth success
Nov 14, 2017 04:16 PM INFO Stream authentication construction:
Nov 14, 2017 04:16 PM DEBUG Storing login time as Tue Nov 14 2017 16:16:01 GMT+0100
Nov 14, 2017 04:16 PM INFO Deferring auth key, as monitorId unknown
Nov 14, 2017 04:16 PM DEBUG auth-success emit:Successful
Nov 14, 2017 04:16 PM INFO zmAutologin successfully logged into Zoneminder
Nov 14, 2017 04:16 PM DEBUG current version: 1.2.507D & available version 1.2.507D
Nov 14, 2017 04:16 PM DEBUG Latest post dated 2017-02-25 14:54:24 but you read 2017-11-02 00:37:54
Nov 14, 2017 04:16 PM INFO Checking if reCaptcha is enabled in ZM...
Nov 14, 2017 04:16 PM INFO zmAutologin called
Nov 14, 2017 04:16 PM DEBUG Resetting zmCookie...
Nov 14, 2017 04:16 PM INFO Cancelling zmAutologin timer
Nov 14, 2017 04:16 PM DEBUG PIN code entered is correct, or there is no PIN set
Nov 14, 2017 04:16 PM DEBUG unlock called with check PIN=true
Nov 14, 2017 04:16 PM INFO not checking for touchID
Nov 14, 2017 04:16 PM INFO User credentials are provided
Nov 14, 2017 04:16 PM DEBUG Inside Portal login Enter handler
Nov 14, 2017 04:16 PM INFO Entering Portal Main
can you help me to solve it?
thanks
log:
Logs for version:1.2.507D (desktop)
Nov 14, 2017 04:16 PM DEBUG 2nd auth API failed, going to login
Nov 14, 2017 04:16 PM DEBUG getAPIversion error handler {"data":"","status":500,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"url":"http://xxx.xxx.x.x/zm/api/host/getVersi ... ation/json, text/plain, */*"}},"statusText":"Internal Server Error"}
Nov 14, 2017 04:16 PM DEBUG getAPIversion called
Nov 14, 2017 04:16 PM DEBUG 2nd auth login worked
Nov 14, 2017 04:16 PM INFO Stream authentication construction:
Nov 14, 2017 04:16 PM DEBUG Storing login time as Tue Nov 14 2017 16:16:02 GMT+0100
Nov 14, 2017 04:16 PM INFO Deferring auth key, as monitorId unknown
Nov 14, 2017 04:16 PM DEBUG auth-success emit:Successful
Nov 14, 2017 04:16 PM INFO zmAutologin successfully logged into Zoneminder
Nov 14, 2017 04:16 PM INFO ZM has recaptcha disabled - good
Nov 14, 2017 04:16 PM INFO Checking if reCaptcha is enabled in ZM...
Nov 14, 2017 04:16 PM INFO zmAutologin called
Nov 14, 2017 04:16 PM DEBUG Resetting zmCookie...
Nov 14, 2017 04:16 PM DEBUG Doing the Aaron Hack after 1 sec....
Nov 14, 2017 04:16 PM INFO API Error handler: going to login getAPI returned error: "-1.-1.-1"
Nov 14, 2017 04:16 PM DEBUG getAPIversion error handler {"data":"","status":500,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"url":"http://xxx.xxx.x.x/zm/api/host/getVersi ... ation/json, text/plain, */*"}},"statusText":"Internal Server Error"}
Nov 14, 2017 04:16 PM INFO ZM has recaptcha disabled - good
Nov 14, 2017 04:16 PM DEBUG getAPIversion called
Nov 14, 2017 04:16 PM DEBUG PortalLogin: auth success
Nov 14, 2017 04:16 PM INFO Stream authentication construction:
Nov 14, 2017 04:16 PM DEBUG Storing login time as Tue Nov 14 2017 16:16:01 GMT+0100
Nov 14, 2017 04:16 PM INFO Deferring auth key, as monitorId unknown
Nov 14, 2017 04:16 PM DEBUG auth-success emit:Successful
Nov 14, 2017 04:16 PM INFO zmAutologin successfully logged into Zoneminder
Nov 14, 2017 04:16 PM DEBUG current version: 1.2.507D & available version 1.2.507D
Nov 14, 2017 04:16 PM DEBUG Latest post dated 2017-02-25 14:54:24 but you read 2017-11-02 00:37:54
Nov 14, 2017 04:16 PM INFO Checking if reCaptcha is enabled in ZM...
Nov 14, 2017 04:16 PM INFO zmAutologin called
Nov 14, 2017 04:16 PM DEBUG Resetting zmCookie...
Nov 14, 2017 04:16 PM INFO Cancelling zmAutologin timer
Nov 14, 2017 04:16 PM DEBUG PIN code entered is correct, or there is no PIN set
Nov 14, 2017 04:16 PM DEBUG unlock called with check PIN=true
Nov 14, 2017 04:16 PM INFO not checking for touchID
Nov 14, 2017 04:16 PM INFO User credentials are provided
Nov 14, 2017 04:16 PM DEBUG Inside Portal login Enter handler
Nov 14, 2017 04:16 PM INFO Entering Portal Main
can you help me to solve it?
thanks
Re: ZM 1.30.4 API issue on ubuntu 17.10
I downloaded the .zeb file with firefox and let Ubuntu install it. I was on 1.30.4 and this .zeb is the updated to Zesty 1.31.1 x64bbunge wrote: ↑Sat Oct 21, 2017 5:10 pm I was able to get the API working.
Fresh install of 17.10 with just LAMP and Webmin
Downloaded the Zesty .deb from the iconnor PPA and copied to my home directory. Shortened the name to zoneminder.deb
installed Zoneminder .deb with: apt install /home/bill/zoneminder.deb
used the WIKI instructions for 16.04 -zm 1.30.4 except used PHP 7.1 in one spot.
Suspect the vlc-plugins did not make it as I got one error at the end of the install.
Will try it again later. Lawn work calls on a beautiful day in Pennsylvania!
That being said I did not have any loss in settings. I do have my install on a VM and I took a snapshot before incase it messed it up.
For the easy steps we all love to have
1. Load Firefox and go to https://launchpad.net/~iconnor/+archive ... /+packages
2. Locate your flavor x86 or x64
2a. x64 file = https://launchpad.net/~iconnor/+archive ... _amd64.deb
3. Let Ubuntu install
4. Reboot your VM or Computer
4a. If you cant reboot
4b. sudo service apache2 restart
4c. sudo service zoneminder restart
After i did this zmNinja worked and no API errors.
ENJOY!