git - ZM database not consistent with code

Forum for questions and support relating to the 1.30.x releases only.
User avatar
zd59
Posts: 102
Joined: Wed Jan 18, 2017 1:39 pm
Location: EU - Slovenia

git - ZM database not consistent with code

Post by zd59 »

Hi!

Slackware64-14.2 build script from git source.
Compiled today 24.5.2017 at 14:34 GMT+2.
Upgraded from 1.30.4
Issues with nonconsistent database compared to program (data types complains)
So i executed zmupdate.pl --version=1.30.4, the result is "already 1.30.4"
and after suggestions in logs also "zmupdate.pl -f"
The complains in log remains:

2017-05-24 14:55:58.516260 zmwatch 8877 INF Restarting capture daemon for Monitor-1, shared data not valid zmwatch.pl
2017-05-24 14:55:58.606740 zmdc 8833 INF 'zmc -d /dev/video0' starting at 17/05/24 14:55:58, pid = 9074 zmdc.pl
2017-05-24 14:55:58.606740 zmdc 9074 INF 'zmc -d /dev/video0' started at 17/05/24 14:55:58 zmdc.pl
2017-05-24 14:55:58.635781 undef 9074 ERR Attempt to fetch string value for ZM_COLOUR_JPEG_FILES, actual type is boolean. Try running 'zmupdate.pl -f' to reload config. zm_config.cpp 218
2017-05-24 14:55:58.639270 zmdc 8833 ERR 'zmc -d /dev/video0' exited abnormally, exit status 255 zmdc.pl
2017-05-24 14:56:08.617720 zmwatch 8877 ERR Memory map file '/dev/shm/zm.mmap.1' does not exist. zmc might not be running. zmwatch.pl
2017-05-24 14:56:08.622770 zmwatch 8877 INF Restarting capture daemon for Monitor-1, shared data not valid zmwatch.pl
2017-05-24 14:56:08.743040 zmdc 8833 INF 'zmc -d /dev/video0' starting at 17/05/24 14:56:08, pid = 9083 zmdc.pl
2017-05-24 14:56:08.743050 zmdc 9083 INF 'zmc -d /dev/video0' started at 17/05/24 14:56:08 zmdc.pl
2017-05-24 14:56:08.771540 undef 9083 ERR Attempt to fetch string value for ZM_COLOUR_JPEG_FILES, actual type is boolean. Try running 'zmupdate.pl -f' to reload config. zm_config.cpp 218
2017-05-24 14:56:08.775000 zmdc 8833 ERR 'zmc -d /dev/video0' exited abnormally, exit status 255 zmdc.pl
2017-05-24 14:56:18.752960 zmwatch 8877 ERR Memory map file '/dev/shm/zm.mmap.1' does not exist. zmc might not be running. zmwatch.pl
2017-05-24 14:56:18.758180 zmwatch 8877 INF Restarting capture daemon for Monitor-1, shared data not valid zmwatch.pl
2017-05-24 14:56:18.882450 zmdc 9091 INF 'zmc -d /dev/video0' started at 17/05/24 14:56:18 zmdc.pl
User avatar
iconnor
Posts: 2900
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: git - ZM database not consistent with code

Post by iconnor »

Try zmupdate.pl -f
User avatar
zd59
Posts: 102
Joined: Wed Jan 18, 2017 1:39 pm
Location: EU - Slovenia

Re: git - ZM database not consistent with code

Post by zd59 »

Hi Iconnor!

In my previous post: and after suggestions in logs also "zmupdate.pl -f"
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: git - ZM database not consistent with code

Post by bbunge »

Per chance did you upgrade MySQL to something newer than 5.5?
User avatar
zd59
Posts: 102
Joined: Wed Jan 18, 2017 1:39 pm
Location: EU - Slovenia

Re: git - ZM database not consistent with code

Post by zd59 »

Testing machine:
slackware-VBOX ~ # mysql -V
mysql Ver 15.1 Distrib 10.0.30-MariaDB, for Linux (x86_64) using readline 5.1

Production machine: Lenovo T430 8GB RAM + 1TB HD
1 3MP, 1 4MP camera
Distributor ID: Debian
Description: Debian GNU/Linux 9.0 (stretch)
Release: 9.0
Codename: stretch
Zoneminder-1.30.0
mysql Ver 15.1 Distrib 10.1.21-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
uptime: 82 days

As my production machine is notebook, and located in attic, spring is coming:
Notebook is not build for 24/7/365 in dirty hot environment.
So I'm planing to buy Intel NUC7I3BNH with 8 GB RAM (for start), and install Slackware with ZM (later adding two 3MP cameras, to two current, to cover place around my house)
So I'm currently testing latest ZM with Slackware.

Mysql was years ago replaced by Mariadb in most distributions, so...

And I must congratulate you (developers) for excellent product.
With first camera bought, I made a mistake and bought a NVR from the same manufacturer. Limited functionality, motion detection limited to connected cameras from the same manufacturer etc.
So I'm here and very happy.
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: git - ZM database not consistent with code

Post by knight-of-ni »

I'm sitting in a hotel room on vacation so I have not read everything that has been said. There is a chance I missed something.

What I did read sounds like a problem applying "zmupdate.pl -f". This command needs to lock the sql database table in order to successfully make changes. In order for that to happen, you've got to make sure zoneminder is stopped and nothing else is trying to access the zoneminder database (the Config table in particular). You also need to verify the zoneminder sql account has the Lock tables permission.

If either of those conditions are not true then zmupdate.pl -f will not apply any changes, and you get the symptoms which you have described.
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/
User avatar
zd59
Posts: 102
Joined: Wed Jan 18, 2017 1:39 pm
Location: EU - Slovenia

Re: git - ZM database not consistent with code

Post by zd59 »

Installed ZoneMinder-1.30.4.git-x86_64-20170524
No application running to use zm database, zoneminder stopped.

MariaDB [(none)]> show grants for 'zmuser'@'localhost';
+---------------------------------------------------------------------------------------------------------------+
| Grants for zmuser@localhost |
+---------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'zmuser'@'localhost' IDENTIFIED BY PASSWORD '*C1D2D6FC5C596AFB19FFC4331DF6DAA287749A3E' |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, LOCK TABLES ON `zm`.* TO 'zmuser'@'localhost' |
+---------------------------------------------------------------------------------------------------------------+
2 rows in set (0.01 sec)

MariaDB [(none)]> quit
Bye
slackware-VBOX ~ # zmupdate.pl -f

Freshening configuration in database
Loading config from DB 217 entries
Saving config to DB 217 entries
slackware-VBOX ~ #

Zoneminder, local USB camera RED.


Load: 0.14 - Disk: 50% - /dev/shm: 0%

/dev/shm - no fies created regarding installed local camera (640 X 480 32 bit 20FPS)

See below error: Unknown column 'SaveJPEGs' in 'field list'


2017-05-26 13:23:29.902380 zmdc 1949 ERR 'zmc -d /dev/video0' exited abnormally, exit status 30 zmdc.pl
2017-05-26 13:23:29.899644 zmc_dvideo0 2604 ERR Can't load local monitors: Unknown column 'SaveJPEGs' in 'field list' zm_monitor.cpp 1812
2017-05-26 13:23:29.897068 zmc_dvideo0 2604 ERR Can't run query: Unknown column 'SaveJPEGs' in 'field list' zm_db.cpp 98
2017-05-26 13:23:29.869540 zmdc 2604 INF 'zmc -d /dev/video0' started at 17/05/26 13:23:29 zmdc.pl
2017-05-26 13:23:29.869530 zmdc 1949 INF 'zmc -d /dev/video0' starting at 17/05/26 13:23:29, pid = 2604 zmdc.pl
2017-05-26 13:23:29.767330 zmwatch 2032 INF Restarting capture daemon for Local-, shared data not valid zmwatch.pl
2017-05-26 13:23:29.764530 zmwatch 2032 ERR Memory map file '/dev/shm/zm.mmap.1' does not exist. zmc might not be running. zmwatch.pl
2017-05-26 13:23:19.787940 zmdc 1949 ERR 'zmc -d /dev/video0' exited abnormally, exit status 30 zmdc.pl
2017-05-26 13:23:19.785528 zmc_dvideo0 2591 ERR Can't load local monitors: Unknown column 'SaveJPEGs' in 'field list' zm_monitor.cpp 1812
2017-05-26 13:23:19.783623 zmc_dvideo0 2591 ERR Can't run query: Unknown column 'SaveJPEGs' in 'field list' zm_db.cpp 98
2017-05-26 13:23:19.757100 zmdc 2591 INF 'zmc -d /dev/video0' started at 17/05/26 13:23:19 zmdc.pl
2017-05-26 13:23:19.757100 zmdc 1949 INF 'zmc -d /dev/video0' starting at 17/05/26 13:23:19, pid = 2591 zmdc.pl
2017-05-26 13:23:19.633660 zmwatch 2032 INF Restarting capture daemon for Local-, shared data not valid zmwatch.pl
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: git - ZM database not consistent with code

Post by knight-of-ni »

Welcome to the bleeding edge. You need to run the update script called zm_update-1.31.0.sql.

On my system, that would be under /usr/share/zoneminder/db
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/
User avatar
zd59
Posts: 102
Joined: Wed Jan 18, 2017 1:39 pm
Location: EU - Slovenia

Re: git - ZM database not consistent with code

Post by zd59 »

Sorry, but already tried zm_update-1.31.0.sql, but forget to mention.
The result was:
"Database already at version 1.30.4, update aborted"

And web interface show 1.30.4 and not 1.31.0!
So I checked, and version file in root of sources show 1.30.4

sources:
git clone https://github.com/ZoneMinder/ZoneMinder.git
get at 24. 5. 2017, 14:35 GMT-2
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: git - ZM database not consistent with code

Post by knight-of-ni »

No, that is not what I meant. Today, you have to run the sql script manually yourself, using mysql from the command line.
See the mysql dcoumentation if you don't already know how to do that:
https://dev.mysql.com/doc/refman/5.7/en ... mands.html

Your web console is going to say 1.30.4 because ZoneMinder 1.31.0 doesn't exist yet and you are attempting to build from the master branch, which is an incomplete, bleeding edge copy of zoneminder. Note that there may be other problems as well, which will get fixed in time. We appreciate those willing to help us test the master branch, but keep in mind that we do not want anyone trying to use this on a production system.

If you still have issues then show us how you called zm_update-1.31.0.sql and what the output was.
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/
User avatar
zd59
Posts: 102
Joined: Wed Jan 18, 2017 1:39 pm
Location: EU - Slovenia

Re: git - ZM database not consistent with code

Post by zd59 »

Hi knnniggett!

Thank's for the tip. Error regarding database/variable difference solved.
I compiled git sources from today at 11:43 GMT-2.

I think, it would be propriate to add a new place beside stable versions (1.30.X, 1.29.X ..) named development, to receive informations regarding tests on developement branch from nondevelopment users. Or I'm wrong and this is already elewhere.
For now, I will continue here.

As now I can deal with local camera (/dev/video0), new issues arise.
The camera settings were accepted, and I can watch live video & change zones in "change zones" window, when mouse click on number of zones in root web page of ZM. So ZM accepted camera settings and live video in zome changes works. Also works events recording triggered by zone settings.

When click on the name of a monitor to watch live video, there is only a blank screen, NOTHING on it. I use dark theme, but blank screen of live video is white. The log page of ZM do not show any info about opening live view, as opposed to web console view, where info & errors are reported.
When want to watch recorded event, I've got black window with all info and commands as on working 1.30 version, but there is no video.
I set up all setting as is on my working system I use (on ZM 1.30.0) and also worked on that system when tested 1.30.4.

I set up "Info" log type on all four first upper options in Logging options page, but get no usefull logs.
Would you please suggest me, how to setup logging to be able to get reports about not working live view etc?
User avatar
zd59
Posts: 102
Joined: Wed Jan 18, 2017 1:39 pm
Location: EU - Slovenia

Re: git - ZM database not consistent with code

Post by zd59 »

can be closed, works with git-20170606 :D
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: git - ZM database not consistent with code

Post by knight-of-ni »

zd59 wrote: Tue Jun 06, 2017 12:55 pm can be closed, works with git-20170606 :D
Since you seem willing to be a guinea pig :-) , just yesterday I merged support for a conf.d folder.
However, you need to set a new cmake parameter ZM_CONFIG_SUBDIR when you build zoneminder.
On my system I set it to "/etc/zm/conf.d".

Please test this subfolder by adding any customized variables into that subfolder, rather than edit zm.conf directly.
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/
User avatar
zd59
Posts: 102
Joined: Wed Jan 18, 2017 1:39 pm
Location: EU - Slovenia

Re: git - ZM database not consistent with code

Post by zd59 »

Ha Ha
guinea pig :-) - very warm metaphor, I like it. Just hope, not become so dirty :lol:

In our country we say "pig at feeding trough" for someone near feeding trough - some people allowed taking from budget without control at the expense of others not so "powerfull".

Could you be so kind, to give me a sample of:
Please test this subfolder by adding any customized variables into that subfolder, rather than edit zm.conf directly.
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: git - ZM database not consistent with code

Post by knight-of-ni »

Oh, I like that. I'll have to use the phrase "pig from feeding trough" sometime.

The following example assumes you have built the latest master branch, you have a folder called /etc/zm, and you have a subfolder called "/etc/zm/conf.d". /etc/zm/conf.d/README contains instructions ....the folders may be in other locations on your system depending on how the system was built.

To verify the conf.d folder is being processed, look at the variables in zm.conf. Any of these variables can be changed by placing a new config file under the conf.d folder.

You could create conf.d/zm-db-user.conf with the contents:
ZM_DB_USER=myuser
ZM_DB_PASS=mypass

This would override the value set in zm.conf, but unlike zm.conf it will not get overwritten during the next upgrade.

In the near future the list of variables in zm.conf is going to grow, to include all the variables you currently see under Options -> Paths.
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/
Locked