Upgrade from 1.28 to 1.29, cannot run zmupdate.pl

Forum for questions and support relating to the 1.29.x releases only.
SpikeyGG
Posts: 60
Joined: Mon Oct 15, 2012 12:02 am

Re: Upgrade from 1.28 to 1.29, cannot run zmupdate.pl

Post by SpikeyGG »

bbunge wrote:Your best bet would be to dump your current database and start with a fresh one. Yes, you could run each .sql which is what the zmupdate does but you could still have issues. You may be farther ahead to install Ubuntu 16.04 server with ZM 1.29.0

bb
So I tried dumping the DB and then using the instructions found here: https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way
  • mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
  • mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"
  • mysqladmin -uroot -p reload
When I tried to start up the service it showed me this in /var/log/syslog:

Code: Select all

May 24 07:42:28 mythbox zmpkg[29342]: INF [Sanity checking States table...]
May 24 07:42:28 mythbox zmpkg[29342]: INF [Command: start]
May 24 07:42:28 mythbox zmpkg[29342]: FAT [Version mismatch, system is version 1.28.0, database is 1.29.0, please run zmupdate.pl to update.]
So I tried to run the zmupdate.pl again...

Code: Select all

> sudo zmupdate.pl

Initiating database upgrade to version 1.28.0 from version 1.29.0

Please ensure that ZoneMinder is stopped on your system prior to upgrading the database.
Press enter to continue or ctrl-C to stop :

Do you wish to take a backup of your database prior to upgrading?
This may result in a large file in /tmp/zm if you have a lot of events.
Press 'y' for a backup or 'n' to continue : n

Upgrading database to version 1.28.0
Loading config from DB
No option 'ZM_AUDIT_MIN_AGE' found, removing at /usr/local/share/perl/5.18.2/ZoneMinder/ConfigAdmin.pm line 89, <STDIN> line 2.
No option 'ZM_CSS_DEFAULT' found, removing at /usr/local/share/perl/5.18.2/ZoneMinder/ConfigAdmin.pm line 89, <STDIN> line 2.
No option 'ZM_FFMPEG_OPEN_TIMEOUT' found, removing at /usr/local/share/perl/5.18.2/ZoneMinder/ConfigAdmin.pm line 89, <STDIN> line 2.
No option 'ZM_OPT_GOOG_RECAPTCHA_SECRETKEY' found, removing at /usr/local/share/perl/5.18.2/ZoneMinder/ConfigAdmin.pm line 89, <STDIN> line 2.
No option 'ZM_OPT_GOOG_RECAPTCHA_SITEKEY' found, removing at /usr/local/share/perl/5.18.2/ZoneMinder/ConfigAdmin.pm line 89, <STDIN> line 2.
No option 'ZM_OPT_USE_API' found, removing at /usr/local/share/perl/5.18.2/ZoneMinder/ConfigAdmin.pm line 89, <STDIN> line 2.
No option 'ZM_OPT_USE_GOOG_RECAPTCHA' found, removing at /usr/local/share/perl/5.18.2/ZoneMinder/ConfigAdmin.pm line 89, <STDIN> line 2.
No option 'ZM_PATH_ARP' found, removing at /usr/local/share/perl/5.18.2/ZoneMinder/ConfigAdmin.pm line 89, <STDIN> line 2.
No option 'ZM_SKIN_DEFAULT' found, removing at /usr/local/share/perl/5.18.2/ZoneMinder/ConfigAdmin.pm line 89, <STDIN> line 2.
Saving config to DB

Database upgrade to version 1.28.0 successful.

>
It still says 1.28.0. WTH? Anyway, I tried to start it up after that and it starts and runs. However, when I try to create a monitor I get all kinds of errors, including the one that tells me to run zmupdate.pl again -- awesome.

Code: Select all

May 24 07:47:13 mythbox zmdc[29459]: WAR [Can't find process with command of 'zma -m 1']
May 24 07:47:13 mythbox zmdc[29459]: WAR [Can't find process with command of 'zmc -d /dev/video0']
May 24 07:47:13 mythbox zmdc[29459]: INF ['zmc -d /dev/video0' starting at 16/05/24 07:47:13, pid = 29599]
May 24 07:47:13 mythbox zmdc[29599]: INF ['zmc -d /dev/video0' started at 16/05/24 07:47:13]
May 24 07:47:13 mythbox undef[29599]: ERR [Config mismatch, expected 224 items, read 215. Try running 'zmupdate.pl -f' to reload config.]
May 24 07:47:13 mythbox zmdc[29459]: ERR ['zmc -d /dev/video0' exited abnormally, exit status 255]
May 24 07:47:13 mythbox zmdc[29459]: INF [Starting pending process, zmc -d /dev/video0]
May 24 07:47:13 mythbox zmdc[29459]: INF ['zmc -d /dev/video0' starting at 16/05/24 07:47:13, pid = 29607]
May 24 07:47:13 mythbox zmdc[29607]: INF ['zmc -d /dev/video0' started at 16/05/24 07:47:13]
May 24 07:47:13 mythbox zmdc[29459]: WAR [Can't find process with command of 'zma -m 1']
May 24 07:47:14 mythbox undef[29607]: ERR [Config mismatch, expected 224 items, read 215. Try running 'zmupdate.pl -f' to reload config.]
May 24 07:47:14 mythbox zmdc[29459]: ERR ['zmc -d /dev/video0' exited abnormally, exit status 255]
May 24 07:47:15 mythbox zmwatch[29495]: ERR [Memory map file '/dev/shm/zm.mmap.1' does not exist.  zmc might not be running.]
May 24 07:47:15 mythbox zmwatch[29495]: INF [Restarting capture daemon for Backyard, shared data not valid]
May 24 07:47:15 mythbox zmdc[29459]: INF ['zmc -d /dev/video0' starting at 16/05/24 07:47:15, pid = 29626]
May 24 07:47:15 mythbox zmdc[29626]: INF ['zmc -d /dev/video0' started at 16/05/24 07:47:15]
May 24 07:47:16 mythbox undef[29626]: ERR [Config mismatch, expected 224 items, read 215. Try running 'zmupdate.pl -f' to reload config.]
May 24 07:47:16 mythbox zmdc[29459]: ERR ['zmc -d /dev/video0' exited abnormally, exit status 255]
May 24 07:47:26 mythbox zmdc[29459]: INF [Starting pending process, zmc -d /dev/video0]
May 24 07:47:26 mythbox zmdc[29459]: INF ['zmc -d /dev/video0' starting at 16/05/24 07:47:26, pid = 29632]
May 24 07:47:26 mythbox zmdc[29632]: INF ['zmc -d /dev/video0' started at 16/05/24 07:47:26]
May 24 07:47:26 mythbox zmwatch[29495]: ERR [Memory map file '/dev/shm/zm.mmap.1' does not exist.  zmc might not be running.]
May 24 07:47:26 mythbox zmwatch[29495]: INF [Restarting capture daemon for Backyard, shared data not valid]
May 24 07:47:26 mythbox undef[29632]: ERR [Config mismatch, expected 224 items, read 215. Try running 'zmupdate.pl -f' to reload config.]
May 24 07:47:26 mythbox zmdc[29459]: ERR ['zmc -d /dev/video0' exited abnormally, exit status 255]
May 24 07:47:26 mythbox zmdc[29459]: INF ['zmc -d /dev/video0' starting at 16/05/24 07:47:26, pid = 29637]
May 24 07:47:26 mythbox zmdc[29637]: INF ['zmc -d /dev/video0' started at 16/05/24 07:47:26]
May 24 07:47:26 mythbox undef[29637]: ERR [Config mismatch, expected 224 items, read 215. Try running 'zmupdate.pl -f' to reload config.]
May 24 07:47:26 mythbox zmdc[29459]: ERR ['zmc -d /dev/video0' exited abnormally, exit status 255]
Would someone confirm or deny that I have the correct version of zmupdate.pl? Based on my testing this is the only version of the file I can update to using apt-get and the steps defined in the wiki page I listed above.

Code: Select all

> md5sum /usr/bin/zmupdate.pl
931e8cb03ba095d871299e6bbd401232  /usr/bin/zmupdate.pl
>
Any other suggestions?
SpikeyGG
Posts: 60
Joined: Mon Oct 15, 2012 12:02 am

Re: Upgrade from 1.28 to 1.29, cannot run zmupdate.pl

Post by SpikeyGG »

bump, still no dice on this.
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Upgrade from 1.28 to 1.29, cannot run zmupdate.pl

Post by rockedge »

It sounds like your using the web console php code for v1.28 and not v1.29. Check the paths that Apache (or your web server) and ZoneMinder are configured for. I had some mismatch problems when first upgrading from a package manager installed ZM and then to go to 1.30.rc1 I built it from source. Everything eventually worked but I ran across several paths that were different in newer versions of ZM.
SpikeyGG
Posts: 60
Joined: Mon Oct 15, 2012 12:02 am

Re: Upgrade from 1.28 to 1.29, cannot run zmupdate.pl

Post by SpikeyGG »

rockedge wrote:It sounds like your using the web console php code for v1.28 and not v1.29. Check the paths that Apache (or your web server) and ZoneMinder are configured for. I had some mismatch problems when first upgrading from a package manager installed ZM and then to go to 1.30.rc1 I built it from source. Everything eventually worked but I ran across several paths that were different in newer versions of ZM.
When I hit the site it shows me v1.29 in the window:
ZM_1.29.png
ZM_1.29.png (3.62 KiB) Viewed 5423 times
... but maybe this doesn't mean I'm using the console php code for v1.29. If this is the case, is there some way to verify that I have the correct version of web console php code? I'm not real familiar with this but it seems to me like the zmupdate.pl file is the culprit here. I have all the SQL update files and I purged zoneminder such that zmupdate.pl didn't exist on my system anymore:

Code: Select all

$ ls -la /usr/bin/zmupdate.pl
ls: cannot access /usr/bin/zmupdate.pl: No such file or directory
however, on reinstall of the "new version" the zmupdate.pl file still doesn't work. :(
SpikeyGG
Posts: 60
Joined: Mon Oct 15, 2012 12:02 am

Re: Upgrade from 1.28 to 1.29, cannot run zmupdate.pl

Post by SpikeyGG »

Okay, I tried this again today, check out the sequence (previously manually clearing out all files I could find and dropping the zm DB):

Code: Select all

$ sudo apt-get install zoneminder
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  fcgiwrap
The following NEW packages will be installed:
  zoneminder
0 upgraded, 1 newly installed, 0 to remove and 134 not upgraded.
Need to get 0 B/2,948 kB of archives.
After this operation, 24.4 MB of additional disk space will be used.
Selecting previously unselected package zoneminder.
(Reading database ... 253869 files and directories currently installed.)
Preparing to unpack .../zoneminder_1.29.0-trusty_amd64.deb ...
Unpacking zoneminder (1.29.0-trusty) ...
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up zoneminder (1.29.0-trusty) ...
Processing triggers for ureadahead (0.100.0-16) ...
$ sudo mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
Enter password:
$ mysql -uroot -p -e "grant select,insert,update,delete,create,alter,index,lock tables on zm.* to 'zmuser'@localhost identified by 'zmpass';"
Enter password:
$ sudo zmupdate.pl

Initiating database upgrade to version 1.28.0 from version 1.29.0

Please ensure that ZoneMinder is stopped on your system prior to upgrading the database.
Press enter to continue or ctrl-C to stop : ^C$
After a fresh install for some reason zmupdate.pl still thinks my database is version 1.28. I'm not sure where it's getting this information from because when I look for %VERSION% in the DB itself I only see 1.29 values:

Code: Select all

mysql> select Name,Value from Config where Name like '%VERSION%';
+---------------------+--------+
| Name                | Value  |
+---------------------+--------+
| ZM_DYN_CURR_VERSION | 1.29.0 |
| ZM_DYN_DB_VERSION   | 1.29.0 |
| ZM_DYN_LAST_VERSION |        |
| ZM_HTTP_VERSION     | 1.0    |
+---------------------+--------+
4 rows in set (0.00 sec)

mysql>
Something else I noticed is that when I try to start it up the syslog results complain too:

Code: Select all

$ sudo /etc/init.d/zoneminder start
Starting ZoneMinder: failure

$ tail -n 5 /var/log/syslog
Jun  6 15:25:01 mythbox CRON[28455]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Jun 30 06:25:01 mythbox CRON[28455]: (root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ))
Jun 30 06:26:55 mythbox zmpkg[28567]: INF [Sanity checking States table...]
Jun 30 06:26:55 mythbox zmpkg[28567]: INF [Command: start]
Jun 30 06:26:55 mythbox zmpkg[28567]: FAT [Version mismatch, system is version 1.28.0, database is 1.29.0, please run zmupdate.pl to update.]
$
I'm at a loss here as to how to get this to work again. Where the hell is it getting the old version information from if the database is a fresh version that says 1.29? My /etc/zm/zm.conf is completely unmodified stock from package and I have no other zm.conf files.


Where else does ZM look for version information?!?
SpikeyGG
Posts: 60
Joined: Mon Oct 15, 2012 12:02 am

Re: Upgrade from 1.28 to 1.29, cannot run zmupdate.pl

Post by SpikeyGG »

More detail:

I just figured out that my ZM_VERSION is wrong. When I issue zmpkg.pl version it spits out 1.28!

Code: Select all

$ sudo /usr/bin/zmpkg.pl version
1.28.0
$
so I look at the code and the print statement is:

Code: Select all

    print ZoneMinder::Base::ZM_VERSION . "\n";
So where does this ZoneMinder::Base::ZM_VERSION value come from and why isn't it getting updated when I purge and reinstall??
SpikeyGG
Posts: 60
Joined: Mon Oct 15, 2012 12:02 am

Re: Upgrade from 1.28 to 1.29, cannot run zmupdate.pl

Post by SpikeyGG »

OMG, I found it: /usr/local/share/perl/5.18.2/ZoneMinder/Base.pm. presumably left over from source installation:

Code: Select all

$ sudo find /usr -name Base.pm |grep Zone
/usr/share/perl5/ZoneMinder/Base.pm
/usr/src/junk/scripts/ZoneMinder/lib/ZoneMinder/Base.pm
/usr/local/share/perl/5.18.2/ZoneMinder/Base.pm
$
Amazing, everything works now.
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: Upgrade from 1.28 to 1.29, cannot run zmupdate.pl

Post by SteveGilvarry »

That was the problem with source uninstalls not cleaning up Perl and who knows what else.
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: Upgrade from 1.28 to 1.29, cannot run zmupdate.pl

Post by knight-of-ni »

There is an endless list of potential pitfalls when attempting to build from source, and you just experienced one of them.
The authors of the Perl Make::Maker module have decided to no longer support "make uninstall" so Perl modules are left on your system when you build from-source.

Additionally, you cannot switch from a from-source build to a package build without first manually searching for and purging all the ZoneMinder files installed via the from-source build. For those who may not know where to search on the filesystem, it might be easiest to just reinstall the distro.

This is exactly why we highly discourage end users from installing ZoneMinder this way. Installing a package from a repository, or building a package of your own (which we have scripts to do for you), avoids this issue, and many other issues, altogether.

Sometimes learning the hard way is a good way to learn.
Perhaps you could be a witness to others in this forum who chose to ignore our warnings about building from-source.
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