error when creating the monitor

Forum for questions and support relating to the 1.30.x releases only.
Locked
gamin
Posts: 5
Joined: Sat Feb 10, 2018 9:37 am

error when creating the monitor

Post by gamin »

Hello! I have seen this software and I find it very interesting. I followed the official installation guide in my version of ubuntu 17.04 and Zoneminder 1.30.4 has been installed but I can not add a new monitor since I find the following errors:

Code: Select all

Notice: Undefined index: dupId in /usr/share/zoneminder/www/skins/classic/views/monitor.php on line 60

Notice: Undefined variable: Server in /usr/share/zoneminder/www/skins/classic/views/monitor.php on line 148
Also when I try to access /zm/api/host/getVersion.json I get an error 500

I have installed Mysql and everything is fine but I do not know where to go to fix these errors.

Thank you!!
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: error when creating the monitor

Post by bbunge »

By "official guide" did you use the one in Read the docs? If so have a look at the guide in the WIKI as you may have missed a step:

https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way
gamin
Posts: 5
Joined: Sat Feb 10, 2018 9:37 am

Re: error when creating the monitor

Post by gamin »

Hello, thanks for the help, I had followed another guide, but I have followed that and it is still happening exactly the same: I do not know what may be happening.
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: error when creating the monitor

Post by bbunge »

Are you running a desktop version Of Ubuntu?
gamin
Posts: 5
Joined: Sat Feb 10, 2018 9:37 am

Re: error when creating the monitor

Post by gamin »

No man, server version, Thanks.
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: error when creating the monitor

Post by bbunge »

Some install guides have you installing the database manually. This is needed on a few distros but not Ubuntu 17.04 and Ubuntu 1.30.4. If you did do something like:
mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
mysql -uroot -p -e "grant select,insert,update,delete,create,alter,index,lock tables on zm.* to 'zmuser'@localhost identified by 'zmpass';"

do this to try to fix permissions:
mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"

You will be prompted to enter the password for MySQL.

Otherwise it may be best to start afresh with a new Ubuntu install, use 16.04 Server, and the referenced WIKI instructions. Support for version 17.x of Ubuntu is soon to end so you are better off with a LTS version.
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: error when creating the monitor

Post by rockedge »

as a test could you open /usr/share/zoneminder/www/index.php and comment out the

Code: Select all

//error_reporting( E_ALL );
on or around line 21. Then try again to set a new monitor.
gamin
Posts: 5
Joined: Sat Feb 10, 2018 9:37 am

Re: error when creating the monitor

Post by gamin »

bbunge wrote: Sat Feb 10, 2018 7:56 pm Some install guides have you installing the database manually. This is needed on a few distros but not Ubuntu 17.04 and Ubuntu 1.30.4. If you did do something like:
mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
mysql -uroot -p -e "grant select,insert,update,delete,create,alter,index,lock tables on zm.* to 'zmuser'@localhost identified by 'zmpass';"

do this to try to fix permissions:
mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"

You will be prompted to enter the password for MySQL.

Otherwise it may be best to start afresh with a new Ubuntu install, use 16.04 Server, and the referenced WIKI instructions. Support for version 17.x of Ubuntu is soon to end so you are better off with a LTS version.
I have tried doing this but nothing I keep getting the same error :(
rockedge wrote: Sun Feb 11, 2018 12:41 am as a test could you open /usr/share/zoneminder/www/index.php and comment out the

Code: Select all

//error_reporting( E_ALL );
on or around line 21. Then try again to set a new monitor.
Error keeps comming up :(

Thanks!
Last edited by gamin on Wed Feb 14, 2018 3:47 pm, edited 1 time in total.
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: error when creating the monitor

Post by rockedge »

Using some variants of Puppy Linux with zoneminder I see this error also, but turning off the error reporting would allow the monitor settings window pop up and work. Since it is a new monitor some of these variables are not defined or given a value yet... but I am not sure if this is the case with what you are seeing. Perhaps In this new install on a Puppy Linux Xenial 64 bit will show me the similar error I have seen in the past and I can look more into it!

Could you for the sake of testing........ turn off the error reporting (or set it to fatal errors only) in the php.ini ?? and try it again??
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: error when creating the monitor

Post by rockedge »

I was able to re-create the error...
capture14372.png
capture14372.png (55.43 KiB) Viewed 5952 times
I turned off the error reporting and the add monitor works......
gamin
Posts: 5
Joined: Sat Feb 10, 2018 9:37 am

Re: error when creating the monitor

Post by gamin »

Just turning off the error report works? What a strange thing, no? I'm going to try it and I'll tell you, thank you.
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: error when creating the monitor

Post by rockedge »

these are notices warning of some variables that have no values defined until after the monitor is created. I set my php.ini usually to this:

Code: Select all

error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR
and comment out the error_reporting line in the index.php, to shut off the warnings and notices but not the really bad stuff.
or sometimes I will change line 21 in the /usr/share/zoneminder/www/index.php to this

Code: Select all

error_reporting( E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR );
or just comment out line in the index.php

Code: Select all

//error_reporting( E_ALL );

This is a hack fix.....there shouldn't be warnings for this but there is for now and some others that I have also run across and this seems to bypass the problem by pushing the error reporting to a higher level. I am running this on Puppy Linux Xenial 32bit 7.5 ...it is built with Ubuntu 16.04 binaries but differs from Ubuntu.
Locked