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

Upgrade from 1.28 to 1.29, cannot run zmupdate.pl

Post by SpikeyGG »

Hi guys, I'm trying to update my config from 1.28 to 1.29. My 1.28 config was from tarball source (I think), I added the PPA from Issac Connor then purged and installed the 1.29 version. However, when I try to run it I get this:

Code: Select all

$ sudo /etc/init.d/zoneminder start
Starting ZoneMinder: DBD::mysql::st execute failed: Unknown column 'IsActive' in 'field list' at /usr/bin/zmpkg.pl line 334.
failure
$
So I figure the database is out of sync with the program (old 1.28 DB) I tried to run zmupdater.pl:

Code: Select all

$ sudo zmupdate.pl

Database already at version 1.28.0, update aborted.

$
I found a lot of sql files that go to 1.29 so I'm pretty sure that I have all the files I need but wth?

Code: Select all

$ ls /usr/share/zoneminder/db
zm_create.sql         zm_update-0.9.16.sql  zm_update-1.18.1.sql  zm_update-1.20.0.sql  zm_update-1.22.0.sql  zm_update-1.23.3.sql  zm_update-1.26.1.sql     zm_update-1.28.100.sql  zm_update-1.28.107.sql
zm_update-0.0.1.sql   zm_update-0.9.7.sql   zm_update-1.19.0.sql  zm_update-1.20.1.sql  zm_update-1.22.1.sql  zm_update-1.24.0.sql  zm_update-1.26.2.sql     zm_update-1.28.101.sql  zm_update-1.28.108.sql
zm_update-0.9.10.sql  zm_update-0.9.8.sql   zm_update-1.19.1.sql  zm_update-1.21.0.sql  zm_update-1.22.2.sql  zm_update-1.24.1.sql  zm_update-1.26.3.sql     zm_update-1.28.102.sql  zm_update-1.28.109.sql
zm_update-0.9.11.sql  zm_update-0.9.9.sql   zm_update-1.19.2.sql  zm_update-1.21.1.sql  zm_update-1.22.3.sql  zm_update-1.24.2.sql  zm_update-1.26.5.sql     zm_update-1.28.103.sql  zm_update-1.28.110.sql
zm_update-0.9.12.sql  zm_update-1.17.1.sql  zm_update-1.19.3.sql  zm_update-1.21.2.sql  zm_update-1.23.0.sql  zm_update-1.24.3.sql  zm_update-1.27.0.sql     zm_update-1.28.104.sql  zm_update-1.28.1.sql
zm_update-0.9.13.sql  zm_update-1.17.2.sql  zm_update-1.19.4.sql  zm_update-1.21.3.sql  zm_update-1.23.1.sql  zm_update-1.24.4.sql  zm_update-1.27.99.0.sql  zm_update-1.28.105.sql  zm_update-1.28.99.sql
zm_update-0.9.15.sql  zm_update-1.18.0.sql  zm_update-1.19.5.sql  zm_update-1.21.4.sql  zm_update-1.23.2.sql  zm_update-1.26.0.sql  zm_update-1.28.0.sql     zm_update-1.28.106.sql  zm_update-1.29.0.sql
$
It's like the zmupdate.pl file I got isn't updated. Any recommendations for getting this resolved?

Thanks,
-Greg

Code: Select all

$ which zmupdate.pl
/usr/bin/zmupdate.pl
$ ls -la /usr/bin/zmupdate.pl
-rwxr-xr-x 1 root root 44486 Feb  4 10:42 /usr/bin/zmupdate.pl
$
bbunge
Posts: 2932
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

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

Post by bbunge »

See the WIKI. You will have to set permissions on the zm database.
Bb
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 »

Hi Bb, I executed the command:

Code: Select all

mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"
If that's what you're referring to. It doesn't appear to have worked...

Code: Select all

$ sudo zmupdate.pl 

Database already at version 1.28.0, update aborted.

$
It's like the zmupdate.pl script I have is the old version but I'm pretty sure it's being installed because I removed (with purge) and tried to run it but it couldn't find the script so I think it was removed.
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 »

Maybe I need special switches on the zmupdate.pl command to tell it I want to move the DB to 1.29??
PacoLM
Posts: 971
Joined: Wed Dec 02, 2009 9:55 pm
Location: Spain

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

Post by PacoLM »

sudo zmupdate.pl -f

After more than 15 years, no longer using ZM as surveillance system.
Now in the dark side, using a commercial system...
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 »

PacoLM wrote:sudo zmupdate.pl -f
No dice,

Code: Select all

$ sudo zmupdate.pl -f
[sudo] password for spikeygg:

Freshening configuration in database
Loading config from DB
Saving config to DB
$ sudo /etc/init.d/zoneminder start
Starting ZoneMinder: DBD::mysql::st execute failed: Unknown column 'IsActive' in 'field list' at /usr/bin/zmpkg.pl line 334.
failure

$ sudo zmupdate.pl

Database already at version 1.28.0, update aborted.

$
I mean, does it matter that the thing says "version 1.28.0"? It's seems like it matters...
bbunge
Posts: 2932
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

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

Post by bbunge »

My guess is that you are running MySQL 5.7 after you upgraded. There is one file that has a command that needs to be removed:

To allow the database upgrade to work you will need to edit one sql file

nano /usr/share/zoneminder/db/zm_update-1.28.99.sql

Search for [ALTER IGNORE TABLE] (Ctrl + w then type ALTER IGNORE TABLE and press Enter. Remove IGNORE then

Ctrl+o Enter to save

CTRL+x to exit

This was documented in:

https://wiki.zoneminder.com/Common_Issu ... untu_16.04
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:My guess is that you are running MySQL 5.7 after you upgraded.
I'm running 5.5.49:

Code: Select all

$ mysql --version
mysql  Ver 14.14 Distrib 5.5.49, for debian-linux-gnu (x86_64) using readline 6.3
$
I tried removing the IGNORE from the alter statement but it still didn't work. Any other ideas?

Code: Select all

$ sudo zmupdate.pl -f

Freshening configuration in database
Loading config from DB
Saving config to DB
$ sudo zmupdate.pl

Database already at version 1.28.0, update aborted.

$
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

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

Post by asker »

zmupdate has another option called '-v' that you can use to force ZM to think you are at some older version. However, from what you have posted, it looks like your system thinks your latest version is 1.28 whereas you have tried upgrading to 1.29

I think you have an install with residual files from the old install and are in an inconsistent state and ZM therefore is confused. This is typically the case when you install from source and then upgrade using a package. I'd recommend a clean install if that is an option.
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
PacoLM
Posts: 971
Joined: Wed Dec 02, 2009 9:55 pm
Location: Spain

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

Post by PacoLM »

Hi,

Another tip: install phpmyadmin and execute the sql inside the latest update file from phpmyadmin. I did it in a previous version with the same problem as you, it worked.

Hope it helps,

PacoLM

After more than 15 years, no longer using ZM as surveillance system.
Now in the dark side, using a commercial system...
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 »

asker wrote:zmupdate has another option called '-v' that you can use to force ZM to think you are at some older version. However, from what you have posted, it looks like your system thinks your latest version is 1.29 whereas you have tried upgrading to 1.28

I think you have an install with residual files from the old install and are in an inconsistent state and ZM therefore is confused. This is typically the case when you install from source and then upgrade using a package. I'd recommend a clean install if that is an option.
Hah, that's exactly what I was thinking but look at this set of commands:

Code: Select all

$ sudo apt-get purge zoneminder
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libdate-manip-perl libdevice-serialport-perl libjs-mootools libjs-sphinxdoc
  libjs-underscore libnet-sftp-foreign-perl libphp-serialization-perl
  libsys-mmap-perl zoneminder-doc
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  zoneminder*
0 upgraded, 0 newly installed, 1 to remove and 14 not upgraded.
After this operation, 24.4 MB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 256050 files and directories currently installed.)
Removing zoneminder (1.29.0-trusty) ...
Conf zoneminder disabled.
apache2_invoke prerm: Disable configuration zoneminder
 * Reloading web server apache2                                                                                              *
Purging configuration files for zoneminder (1.29.0-trusty) ...

Reminder: to completely remove "zoneminder" it may be necessary
 * to delete database using the following sample command:
        sudo mysqladmin --defaults-file=/etc/mysql/debian.cnf -f drop zm
 * to delete remaining data files in /var/cache/zoneminder.

apache2_invoke postrm: Purging state for zoneminder
dpkg: warning: while removing zoneminder, directory '/usr/share/perl5/ZoneMinder/Control' not empty so not removed
dpkg: warning: while removing zoneminder, directory '/usr/share/zoneminder' not empty so not removed
dpkg: warning: while removing zoneminder, directory '/var/log/zm' not empty so not removed
dpkg: warning: while removing zoneminder, directory '/var/cache/zoneminder/events' not empty so not removed
dpkg: warning: while removing zoneminder, directory '/var/cache/zoneminder/images' not empty so not removed
dpkg: warning: while removing zoneminder, directory '/etc/zm' not empty so not removed
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
$ ls -la /usr/bin/zmupdate.pl
ls: cannot access /usr/bin/zmupdate.pl: No such file or directory
$ 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 14 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 ... 253771 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) ...
$ ls -la /usr/bin/zmupdate.pl
-rwxr-xr-x 1 root root 44486 Feb  4 10:42 /usr/bin/zmupdate.pl
$ sudo /usr/bin/zmupdate.pl
Warning, overriding installed ./zm.conf file with local copy

Database already at version 1.28.0, update aborted.

$
Can you make sense of that? It's clearly removing and reinstalling this zmupdate.pl file so something is amiss elsewhere, I just don't know where.
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 »

PacoLM wrote:Hi,

Another tip: install phpmyadmin and execute the sql inside the latest update file from phpmyadmin. I did it in a previous version with the same problem as you, it worked.

Hope it helps,

PacoLM
Hi PacoLM, thanks for the information. Are you suggesting that I execute the sql within: /usr/share/zoneminder/db/? I ask because it looks like there are several files available in there and I'm not sure exactly which ones I should be running.

Code: Select all

$ls /usr/share/zoneminder/db/
zm_create.sql         zm_update-1.18.0.sql  zm_update-1.21.3.sql  zm_update-1.24.3.sql     zm_update-1.28.103.sql
zm_update-0.0.1.sql   zm_update-1.18.1.sql  zm_update-1.21.4.sql  zm_update-1.24.4.sql     zm_update-1.28.104.sql
zm_update-0.9.10.sql  zm_update-1.19.0.sql  zm_update-1.22.0.sql  zm_update-1.26.0.sql     zm_update-1.28.105.sql
zm_update-0.9.11.sql  zm_update-1.19.1.sql  zm_update-1.22.1.sql  zm_update-1.26.1.sql     zm_update-1.28.106.sql
zm_update-0.9.12.sql  zm_update-1.19.2.sql  zm_update-1.22.2.sql  zm_update-1.26.2.sql     zm_update-1.28.107.sql
zm_update-0.9.13.sql  zm_update-1.19.3.sql  zm_update-1.22.3.sql  zm_update-1.26.3.sql     zm_update-1.28.108.sql
zm_update-0.9.15.sql  zm_update-1.19.4.sql  zm_update-1.23.0.sql  zm_update-1.26.5.sql     zm_update-1.28.109.sql
zm_update-0.9.16.sql  zm_update-1.19.5.sql  zm_update-1.23.1.sql  zm_update-1.27.0.sql     zm_update-1.28.110.sql
zm_update-0.9.7.sql   zm_update-1.20.0.sql  zm_update-1.23.2.sql  zm_update-1.27.99.0.sql  zm_update-1.28.1.sql
zm_update-0.9.8.sql   zm_update-1.20.1.sql  zm_update-1.23.3.sql  zm_update-1.28.0.sql     zm_update-1.28.99.sql
zm_update-0.9.9.sql   zm_update-1.21.0.sql  zm_update-1.24.0.sql  zm_update-1.28.100.sql   zm_update-1.29.0.sql
zm_update-1.17.1.sql  zm_update-1.21.1.sql  zm_update-1.24.1.sql  zm_update-1.28.101.sql
zm_update-1.17.2.sql  zm_update-1.21.2.sql  zm_update-1.24.2.sql  zm_update-1.28.102.sql
$
Should I just execute the zm_update-1.29.0.sql or do I need to run all of them from zm_update-1.28.0.sql to zm_update-1.29.0.sql? Mostly I'm worried about breaking something. I don't really care about my old recordings, ideally I would preserve them but if I have to I'll dump the DB and start over (worst case).

Thanks again.
-Greg
bbunge
Posts: 2932
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

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

Post by bbunge »

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
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
I'm thinking about it more and all my zones and things will be wiped if I drop the DB. So I manually executed the SQL scripts on the zm db instead of dropping it. I ran all the ones after 1.28.0 and now I can start up the zoneminder script but it's giving me lots of errors and my camera source is red but at least the script doesn't bomb out now.

These are the errors I am seeing when I start the zoneminder init.d script. Any ideas where to start here? It looks like it's still complaining about the config table. "Config mismatch". It suggests zmupdate.pl which clearly doesn't work.

Code: Select all

May 16 18:32:15 mythbox undef[4573]: ERR [Config mismatch, expected 224 items, read 215. Try running 'zmupdate.pl -f' to reload config.]
May 16 18:32:15 mythbox zmdc[4547]: ERR ['zmc -d /dev/video0' exited abnormally, exit status 255]
May 16 18:32:15 mythbox undef[4580]: ERR [Config mismatch, expected 224 items, read 215. Try running 'zmupdate.pl -f' to reload config.]
May 16 18:32:15 mythbox undef[4581]: ERR [Config mismatch, expected 224 items, read 215. Try running 'zmupdate.pl -f' to reload config.]
May 16 18:32:15 mythbox zmdc[4547]: ERR ['zmc -d /dev/video0' exited abnormally, exit status 255]
May 16 18:32:15 mythbox zmdc[4547]: ERR ['zma -m 2' exited abnormally, exit status 255]
May 16 18:32:15 mythbox undef[4590]: ERR [Config mismatch, expected 224 items, read 215. Try running 'zmupdate.pl -f' to reload config.]
May 16 18:32:20 mythbox undef[4622]: ERR [Config mismatch, expected 224 items, read 215. Try running 'zmupdate.pl -f' to reload config.]
May 16 18:32:20 mythbox undef[4621]: ERR [Config mismatch, expected 224 items, read 215. Try running 'zmupdate.pl -f' to reload config.]
May 16 18:32:20 mythbox zmdc[4547]: message repeated 2 times: [ ERR ['zma -m 2' exited abnormally, exit status 255]]
May 16 18:32:20 mythbox zmdc[4547]: ERR ['zmc -d /dev/video0' exited abnormally, exit status 255]
May 16 18:32:21 mythbox zmvideo[4631]: ERR [Unable to generate video, check /var/www/zm/events/2/16/04/30/18/49/25/ffmpeg.log for details]
May 16 18:32:21 mythbox zmfilter[4591]: ERR [Video generation '/usr/bin/zmvideo.pl -e 15028 -r 1 -s 1 -f mp4' failed with status: 255]
May 16 18:32:21 mythbox zmvideo[4636]: ERR [Unable to generate video, check /var/www/zm/events/2/16/04/30/18/49/25/ffmpeg.log for details]
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

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

Post by asker »

this is again a sign of mixed files between versions. ZM needs to be re-compiled when # of config items change.

You'll spend more time with this than reconfiguring zones - just dump the Zones DB and re-import
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
Locked