Update Debian Jessie to Stretch and Zoneminder from 1.29 via 1.30 to 1.32 and how to fix update issues

Written by - 0 comments

Published on November 12th 2019 - Listed in Zoneminder Surveillance Linux


Zoneminder 1.29 has been running smoothly on a local Debian 8/Jessie Linux container (LXC). Meanwhile a few years have passed by (already!) and there are newer releases of Zoneminder available. Time to upgrade!

Status Quo: 1.29 on Debian Jessie

The LXC container runs on Debian Jessie (8).

root@zoneminder:~# cat /etc/*release*
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

A couple of cameras are configured on Zoneminder and montage and recording work without problem. How will that behave after the upgrade? And will the user interface look differently (honestly, it's about time)?

Zoneminder 1.29 overview on Debian Jessie

When Zoneminder was initially installed the package from jessie-backports was used:

root@zoneminder:~# apt-cache show zoneminder |head -n 2
Package: zoneminder
Version: 1.29.0+dfsg-1~bpo8+1

On the official Debian repositories there are no zoneminder packages available, however in stretch-backports there's version 1.30 available. The Zoneminder project itself offers its own deb repository to install the latest 1.32 version.

The upgrade path

1) First upgrade the OS from Jessie to Stretch

2) Enable stretch-backports and install Zoneminder 1.30 from it, see how this goes

3) Enable the Zoneminder repository and install 1.32 from it; and see how this goes

Debian upgrade

Not much to tell here. Standard Debian upgrade procedure without getting into problems. At least within this Linux Container no problems occurred.

root@zoneminder:~# mv /etc/apt/sources.list.d/backports.list{,.disabled}
root@zoneminder:~# apt-get update
root@zoneminder:~# cp /etc/apt/sources.list{,.jessie}
root@zoneminder:~# sed -i "s/jessie/stretch/g" /etc/apt/sources.list
root@zoneminder:~# apt-get dist-upgrade
root@zoneminder:~# reboot

After the reboot, Debian is now running with the Stretch release.

root@zoneminder:~# cat /etc/*release*
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
VERSION_CODENAME=stretch
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Zoneminder 1.29 to 1.30

Time to upgrade Zoneminder! After enabling the stretch-backports repositories, the version 1.30 can be installed:

root@zoneminder:~# echo "deb http://deb.debian.org/debian stretch-backports main contrib non-free" > /etc/apt/sources.list.d/backports.list
root@zoneminder:~# apt-get update
root@zoneminder:~# apt-cache show zoneminder | grep Version
Version: 1.30.4+dfsg-2~bpo9+1
Version: 1.29.0+dfsg-1~bpo8+1

Let's do this!

root@zoneminder:~# apt-get install zoneminder
[...]
The following packages will be upgraded:
  zoneminder zoneminder-doc
[...]
Do you want to continue? [Y/n] Y

During the upgrade process, apt asked whether or not to replace the existing Apache config. A diff comparison only showed a minor change in it:

--- /etc/apache2/conf-available/zoneminder.conf    2017-02-20 12:20:18.343925742 +0100
+++ /etc/apache2/conf-available/zoneminder.conf.dpkg-new    2017-09-18 10:44:49.000000000 +0200
@@ -8,8 +8,7 @@

 Alias /zm /usr/share/zoneminder/www

-  php_flag register_globals off
-  Options Indexes FollowSymLinks
+  Options -Indexes +FollowSymLinks

     DirectoryIndex index.php

register_globals should in general be off (for a while in PHP) and it makes sense to remove Indexes, too.

*** zoneminder.conf (Y/I/N/O/D/Z) [default=N] ? Y
Installing new version of config file /etc/apache2/conf-available/zoneminder.conf ...
Installing new version of config file /etc/zm/zm.conf ...
I: Generating /etc/zm/core.php from /usr/share/zoneminder/www/api/app/Config/core.php.default ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...

After the apt install finished, the big question pops up: Is everything still working? But unfortunately already a restart of Zoneminder failed:

root@zoneminder:~# systemctl restart zoneminder
Job for zoneminder.service failed because the control process exited with error code.
See "systemctl status zoneminder.service" and "journalctl -xe" for details.

A status revealed a bit more why the start failed:

root@zoneminder:~# systemctl status zoneminder
? zoneminder.service - ZoneMinder CCTV recording and surveillance system
   Loaded: loaded (/lib/systemd/system/zoneminder.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2019-11-12 11:55:24 CET; 16s ago
     Docs: http://zoneminder.readthedocs.org/en/latest/
  Process: 3013 ExecStop=/usr/bin/zmpkg.pl stop (code=exited, status=0/SUCCESS)
  Process: 3065 ExecStart=/usr/bin/zmpkg.pl start (code=exited, status=255)
 Main PID: 502 (code=exited, status=0/SUCCESS)

Nov 12 11:55:24 zoneminder su[3073]: + ??? root:www-data
Nov 12 11:55:24 zoneminder su[3073]: pam_unix(su:session): session opened for user www-data by (uid=0)
Nov 12 11:55:24 zoneminder su[3079]: Successful su for www-data by root
Nov 12 11:55:24 zoneminder su[3079]: + ??? root:www-data
Nov 12 11:55:24 zoneminder su[3079]: pam_unix(su:session): session opened for user www-data by (uid=0)
Nov 12 11:55:24 zoneminder zmpkg[3065]: FAT [Version mismatch, system is version 1.30.4, database is 1.29.0, please run zmupdate.pl to update.]
Nov 12 11:55:24 zoneminder systemd[1]: zoneminder.service: Control process exited, code=exited status=255
Nov 12 11:55:24 zoneminder systemd[1]: Failed to start ZoneMinder CCTV recording and surveillance system.
Nov 12 11:55:24 zoneminder systemd[1]: zoneminder.service: Unit entered failed state.
Nov 12 11:55:24 zoneminder systemd[1]: zoneminder.service: Failed with result 'exit-code'.

So zmpkg seems to have an internal check script validating the database. And it detected that the database still runs with the old 1.29 version and needs to be upgraded with zmupdate.pl (chose y for a backup!):

root@zoneminder:~# zmupdate.pl

Initiating database upgrade to version 1.30.4 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 : y
Creating backup to /tmp/zm/zm-1.29.0.dump. This may take several minutes.
Database successfully backed up to /tmp/zm/zm-1.29.0.dump, proceeding to upgrade.

Upgrading database to version 1.30.4
Loading config from DB
No option 'ZM_EYEZM_DEBUG' found, removing.
No option 'ZM_EYEZM_EVENT_VCODEC' found, removing.
No option 'ZM_EYEZM_FEED_VCODEC' found, removing.
No option 'ZM_EYEZM_H264_DEFAULT_BR' found, removing.
No option 'ZM_EYEZM_H264_DEFAULT_EVBR' found, removing.
No option 'ZM_EYEZM_H264_TIMEOUT' found, removing.
No option 'ZM_EYEZM_LOG_FILE' found, removing.
No option 'ZM_EYEZM_LOG_TO_FILE' found, removing.
No option 'ZM_EYEZM_SEG_DURATION' found, removing.
No option 'ZM_WEB_P_AJAX_TIMEOUT' found, removing.
No option 'ZM_WEB_P_CAN_STREAM' found, removing.
No option 'ZM_WEB_P_DEFAULT_RATE' found, removing.
No option 'ZM_WEB_P_DEFAULT_SCALE' found, removing.
No option 'ZM_WEB_P_SCALE_THUMBS' found, removing.
No option 'ZM_WEB_P_STREAM_METHOD' found, removing.
No option 'ZM_WEB_P_VIDEO_BITRATE' found, removing.
No option 'ZM_WEB_P_VIDEO_MAXFPS' found, removing.
Saving config to DB
Upgrading DB to 1.29.1 from 1.29.0

Database successfully upgraded to version 1.29.1.
Upgrading DB to 1.30.0 from 1.29.0

Database successfully upgraded to version 1.30.0.
Upgrading DB to 1.30.1 from 1.29.0

Database successfully upgraded to version 1.30.1.
Upgrading DB to 1.30.2 from 1.29.0

Database successfully upgraded to version 1.30.2.
Upgrading DB to 1.30.3 from 1.29.0

Database successfully upgraded to version 1.30.3.
Upgrading DB to 1.30.4 from 1.29.0

Database successfully upgraded to version 1.30.4.

Database upgrade to version 1.30.4 successful.

Will the restart now work?

root@zoneminder:~# systemctl start zoneminder
root@zoneminder:~# systemctl status zoneminder
? zoneminder.service - ZoneMinder CCTV recording and surveillance system
   Loaded: loaded (/lib/systemd/system/zoneminder.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2019-11-12 11:59:05 CET; 4s ago
     Docs: http://zoneminder.readthedocs.org/en/latest/
  Process: 3013 ExecStop=/usr/bin/zmpkg.pl stop (code=exited, status=0/SUCCESS)
  Process: 3362 ExecStart=/usr/bin/zmpkg.pl start (code=exited, status=0/SUCCESS)
 Main PID: 3394 (zmdc.pl)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/zoneminder.service
           ? 3394 /usr/bin/perl -wT /usr/bin/zmdc.pl startup

Nov 12 11:59:05 zoneminder su[3492]: Successful su for www-data by root
Nov 12 11:59:05 zoneminder su[3492]: + ??? root:www-data
Nov 12 11:59:05 zoneminder su[3492]: pam_unix(su:session): session opened for user www-data by (uid=0)
Nov 12 11:59:05 zoneminder su[3499]: Successful su for www-data by root
Nov 12 11:59:05 zoneminder su[3499]: + ??? root:www-data
Nov 12 11:59:05 zoneminder su[3499]: pam_unix(su:session): session opened for user www-data by (uid=0)
Nov 12 11:59:05 zoneminder su[3510]: Successful su for www-data by root
Nov 12 11:59:05 zoneminder su[3510]: + ??? root:www-data
Nov 12 11:59:05 zoneminder su[3510]: pam_unix(su:session): session opened for user www-data by (uid=0)
Nov 12 11:59:05 zoneminder systemd[1]: Started ZoneMinder CCTV recording and surveillance system.

Hurray, Zoneminder is working again with the new version 1.30!

Zoneminder 1.30 overview

Discovering Zoneminder 1.30

The first (obvious) change I was interested in was a new user interface, or new style for that matter. I was pretty happy when I tested the "flat" value as "CSS_DEFAULT" setting (in Options -> System). This "flat" style looks much more modern:

Besides this, the "Montage Review" caught my eye: That's new! What it does? I think it is supposed to quickly review the recent events in montage style (multiple cameras at the same time). However it did not work correctly. Another new information is the display of /dev/shm usage. This is (a more or less) helpful indicator if enough shared memory is still available on the machine.

Zoneminder 1.30 to 1.32

The currently newest version of Zoneminder is 1.32 and it can only be installed through the Zoneminder deb repositories. Once they are enabled, the new version can be installed. Note that the deb packages from the Zoneminder repo are signed with a different gpg key. This means the public gpg key should be installed to your Debian keyrings. Also make sure the package apt-transport-https is installed because the Zoneminder repos are only available over https.

root@zoneminder:~# apt-get install apt-transport-https
root@zoneminder:~# echo "deb https://zmrepo.zoneminder.com/debian/release stretch/" > /etc/apt/sources.list.d/zoneminder.list
root@zoneminder:~# wget -O - https://zmrepo.zoneminder.com/debian/archive-keyring.gpg | apt-key add -
root@zoneminder:~# apt-get update

The following Zoneminder versions are now available (across stretch-backports and Zoneminder repositories):

root@zoneminder:~# apt-cache show zoneminder|grep Version
Version: 1.32.3-stretch
Version: 1.32.2-stretch
Version: 1.32.0-stretch
Version: 1.30.4+dfsg-2~bpo9+1

By simply installing "zoneminder", the latest (highest number) available package will be installed:

root@zoneminder:~# apt-get install zoneminder
[...]
The following packages will be upgraded:
  zoneminder zoneminder-doc
[...]
Installing new version of config file /etc/apache2/conf-available/zoneminder.conf ...
Installing new version of config file /etc/logrotate.d/zoneminder ...
Installing new version of config file /etc/zm/zm.conf ...
Detected db service is mariadb.service
Updating permissions

Initiating database upgrade to version 1.32.3 from version 1.30.4

Upgrading database to version 1.32.3
Loading config from DBNo option 'ZM_DIR_EVENTS' found, removing.
No option 'ZM_DIR_IMAGES' found, removing.
No option 'ZM_DIR_SOUNDS' found, removing.
No option 'ZM_FRAME_SOCKET_SIZE' found, removing.
No option 'ZM_OPT_FRAME_SERVER' found, removing.
No option 'ZM_PATH_ARP' found, removing.
No option 'ZM_PATH_LOGS' found, removing.
No option 'ZM_PATH_MAP' found, removing.
No option 'ZM_PATH_SOCKS' found, removing.
No option 'ZM_PATH_SWAP' found, removing.
No option 'ZM_PATH_ZMS' found, removing.
No option 'ZM_SIGNAL_CHECK_POINTS' found, removing.
 206 entries
Saving config to DB 223 entries
Upgrading DB to 1.31.0 from 1.30.4

Database successfully upgraded to version 1.31.0.
Upgrading DB to 1.31.1 from 1.30.4

Database successfully upgraded to version 1.31.1.
Upgrading DB to 1.31.2 from 1.30.4

Database successfully upgraded to version 1.31.2.
Upgrading DB to 1.31.3 from 1.30.4

Database successfully upgraded to version 1.31.3.
Upgrading DB to 1.31.4 from 1.30.4

Database successfully upgraded to version 1.31.4.
Upgrading DB to 1.31.5 from 1.30.4

Database successfully upgraded to version 1.31.5.
Upgrading DB to 1.31.6 from 1.30.4

Database successfully upgraded to version 1.31.6.
Upgrading DB to 1.31.7 from 1.30.4

Database successfully upgraded to version 1.31.7.
Upgrading DB to 1.31.8 from 1.30.4

Database successfully upgraded to version 1.31.8.
Upgrading DB to 1.31.9 from 1.30.4

Database successfully upgraded to version 1.31.9.
Upgrading DB to 1.31.10 from 1.30.4

Database successfully upgraded to version 1.31.10.
Upgrading DB to 1.31.11 from 1.30.4

Database successfully upgraded to version 1.31.11.
Upgrading DB to 1.31.12 from 1.30.4

Database successfully upgraded to version 1.31.12.
Upgrading DB to 1.31.13 from 1.30.4

Database successfully upgraded to version 1.31.13.
Upgrading DB to 1.31.14 from 1.30.4

Database successfully upgraded to version 1.31.14.
Upgrading DB to 1.31.15 from 1.30.4

Database successfully upgraded to version 1.31.15.
Upgrading DB to 1.31.16 from 1.30.4

Database successfully upgraded to version 1.31.16.
Upgrading DB to 1.31.17 from 1.30.4

Database successfully upgraded to version 1.31.17.
Upgrading DB to 1.31.18 from 1.30.4

Database successfully upgraded to version 1.31.18.
Upgrading DB to 1.31.19 from 1.30.4
ERROR 1728 (HY000) at line 1: Cannot load from mysql.proc. The table is probably corrupted
Output:
Command 'mysql -hlocalhost -uzmuser -p"zmpass" zm < /usr/share/zoneminder/db/zm_update-1.31.19.sql' exited with status: 1

Freshening configuration in database

Migrating custom config values from Options -> Paths
to /etc/zm/conf.d/zmcustom.conf.

Please verify these values before starting ZoneMinder.

Loading config from DB 223 entries
Saving config to DB 223 entries
Done Updating; starting ZoneMinder.
Job for zoneminder.service failed because the control process exited with error code.
See "systemctl status zoneminder.service" and "journalctl -xe" for details.
zoneminder.service couldn't restart.
Job for zoneminder.service failed because the control process exited with error code.
See "systemctl status zoneminder.service" and "journalctl -xe" for details.
invoke-rc.d: initscript zoneminder, action "start" failed.
? zoneminder.service - ZoneMinder CCTV recording and surveillance system
   Loaded: loaded (/lib/systemd/system/zoneminder.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Tue 2019-11-12 12:51:09 CET; 9ms ago
  Process: 12118 ExecStart=/usr/bin/zmpkg.pl start (code=exited, status=255)
 Main PID: 3817 (code=exited, status=0/SUCCESS)

Nov 12 12:51:09 zoneminder systemd[1]: zoneminder.service: Unit entered failed state.
Nov 12 12:51:09 zoneminder systemd[1]: zoneminder.service: Failed with result 'exit-code'.
dpkg: error processing package zoneminder (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up sphinx-rtd-theme-common (0.1.9-1) ...
Setting up python-sphinx (1.4.9-2) ...
Setting up python-sphinx-rtd-theme (0.1.9-1) ...
Setting up zoneminder-doc (1.32.3-stretch1) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Errors were encountered while processing:
 zoneminder
E: Sub-process /usr/bin/dpkg returned an error code (1)

Bummer. The apt installation failed because of an error during the database upgrade procedure. Great. NOT!

The postinstall script of the zoneminder package actually tried to run zmupdate.pl automatically but failed at a certain step:

Database successfully upgraded to version 1.31.18.
Upgrading DB to 1.31.19 from 1.30.4
ERROR 1728 (HY000) at line 1: Cannot load from mysql.proc. The table is probably corrupted
Output:
Command 'mysql -hlocalhost -uzmuser -p"zmpass" zm < /usr/share/zoneminder/db/zm_update-1.31.19.sql' exited with status: 1

According to a StackOverflow question, this error can show up, when the MySQL (or MariaDB in this case) server was recently upgraded. Umm wait, we did an upgrade from Debian Jessie to Stretch before! Let's run mysql_upgrade:

root@zoneminder:~# mysql_upgrade -u root -p
Enter password:
MySQL upgrade detected
Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats                                 OK
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.event                                        OK
mysql.func                                         OK
mysql.gtid_slave_pos                               OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.host                                         OK
mysql.index_stats                                  OK
mysql.innodb_index_stats                           OK
mysql.innodb_table_stats                           OK
mysql.ndb_binlog_index                             OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.proxies_priv                                 OK
mysql.roles_mapping                                OK
mysql.servers                                      OK
mysql.table_stats                                  OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.user                                         OK
Phase 2/7: Installing used storage engines
Checking for tables with unknown storage engine
Phase 3/7: Fixing views from mysql
Phase 4/7: Running 'mysql_fix_privilege_tables'
Phase 5/7: Fixing table and database names
Phase 6/7: Checking and upgrading tables
Processing databases
information_schema
performance_schema
zm
zm.Config                                          OK
zm.ControlPresets                                  OK
zm.Controls                                        OK
zm.Devices                                         OK
zm.Events                                          OK
zm.Filters                                         OK
zm.Frames                                          OK
zm.Groups                                          OK
zm.Groups_Monitors                                 OK
zm.Logs                                            OK
zm.Manufacturers                                   OK
zm.Models                                          OK
zm.MonitorPresets                                  OK
zm.Monitors                                        OK
zm.MontageLayouts                                  OK
zm.Servers                                         OK
zm.States                                          OK
zm.Stats                                           OK
zm.Storage                                         OK
zm.TriggersX10                                     OK
zm.Users                                           OK
zm.ZonePresets                                     OK
zm.Zones                                           OK
Phase 7/7: Running 'FLUSH PRIVILEGES'
OK

A manual execution of zmupdate.pl should now (hopefully) work, right?

root@zoneminder:~# zmupdate.pl

Initiating database upgrade to version 1.32.3 from version 1.30.4

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.32.3
Loading config from DB 223 entries
Saving config to DB 223 entries
Upgrading DB to 1.31.0 from 1.30.4

Database successfully upgraded to version 1.31.0.
Upgrading DB to 1.31.1 from 1.30.4

Database successfully upgraded to version 1.31.1.
Upgrading DB to 1.31.2 from 1.30.4

Database successfully upgraded to version 1.31.2.
Upgrading DB to 1.31.3 from 1.30.4

Database successfully upgraded to version 1.31.3.
Upgrading DB to 1.31.4 from 1.30.4

Database successfully upgraded to version 1.31.4.
Upgrading DB to 1.31.5 from 1.30.4

Database successfully upgraded to version 1.31.5.
Upgrading DB to 1.31.6 from 1.30.4

Database successfully upgraded to version 1.31.6.
Upgrading DB to 1.31.7 from 1.30.4

Database successfully upgraded to version 1.31.7.
Upgrading DB to 1.31.8 from 1.30.4

Database successfully upgraded to version 1.31.8.
Upgrading DB to 1.31.9 from 1.30.4

Database successfully upgraded to version 1.31.9.
Upgrading DB to 1.31.10 from 1.30.4

Database successfully upgraded to version 1.31.10.
Upgrading DB to 1.31.11 from 1.30.4

Database successfully upgraded to version 1.31.11.
Upgrading DB to 1.31.12 from 1.30.4

Database successfully upgraded to version 1.31.12.
Upgrading DB to 1.31.13 from 1.30.4

Database successfully upgraded to version 1.31.13.
Upgrading DB to 1.31.14 from 1.30.4

Database successfully upgraded to version 1.31.14.
Upgrading DB to 1.31.15 from 1.30.4

Database successfully upgraded to version 1.31.15.
Upgrading DB to 1.31.16 from 1.30.4

Database successfully upgraded to version 1.31.16.
Upgrading DB to 1.31.17 from 1.30.4

Database successfully upgraded to version 1.31.17.
Upgrading DB to 1.31.18 from 1.30.4

Database successfully upgraded to version 1.31.18.
Upgrading DB to 1.31.19 from 1.30.4

Database successfully upgraded to version 1.31.19.
Upgrading DB to 1.31.20 from 1.30.4

Database successfully upgraded to version 1.31.20.
Upgrading DB to 1.31.21 from 1.30.4

Database successfully upgraded to version 1.31.21.
Upgrading DB to 1.31.22 from 1.30.4

Database successfully upgraded to version 1.31.22.
Upgrading DB to 1.31.23 from 1.30.4

Database successfully upgraded to version 1.31.23.
Upgrading DB to 1.31.24 from 1.30.4

Database successfully upgraded to version 1.31.24.
Upgrading DB to 1.31.25 from 1.30.4

Database successfully upgraded to version 1.31.25.
Upgrading DB to 1.31.26 from 1.30.4

Database successfully upgraded to version 1.31.26.
Upgrading DB to 1.31.27 from 1.30.4

Database successfully upgraded to version 1.31.27.
Upgrading DB to 1.31.28 from 1.30.4

Database successfully upgraded to version 1.31.28.
Upgrading DB to 1.31.29 from 1.30.4

Database successfully upgraded to version 1.31.29.
Upgrading DB to 1.31.30 from 1.30.4

Database successfully upgraded to version 1.31.30.
Upgrading DB to 1.31.31 from 1.30.4

Database successfully upgraded to version 1.31.31.
Upgrading DB to 1.31.32 from 1.30.4

Database successfully upgraded to version 1.31.32.
Upgrading DB to 1.31.33 from 1.30.4

Database successfully upgraded to version 1.31.33.
Upgrading DB to 1.31.34 from 1.30.4

Database successfully upgraded to version 1.31.34.
Upgrading DB to 1.31.35 from 1.30.4

Database successfully upgraded to version 1.31.35.
Upgrading DB to 1.31.36 from 1.30.4

Database successfully upgraded to version 1.31.36.
Upgrading DB to 1.31.37 from 1.30.4

Database successfully upgraded to version 1.31.37.
Upgrading DB to 1.31.38 from 1.30.4

Database successfully upgraded to version 1.31.38.
Upgrading DB to 1.31.39 from 1.30.4

Database successfully upgraded to version 1.31.39.
Upgrading DB to 1.31.40 from 1.30.4

Database successfully upgraded to version 1.31.40.
Upgrading DB to 1.31.41 from 1.30.4

Database successfully upgraded to version 1.31.41.
Upgrading DB to 1.31.42 from 1.30.4

Database successfully upgraded to version 1.31.42.
Upgrading DB to 1.31.43 from 1.30.4

Database successfully upgraded to version 1.31.43.
Upgrading DB to 1.31.44 from 1.30.4

Database successfully upgraded to version 1.31.44.
Upgrading DB to 1.31.45 from 1.30.4

Database successfully upgraded to version 1.31.45.
Upgrading DB to 1.31.46 from 1.30.4

Database successfully upgraded to version 1.31.46.
Upgrading DB to 1.31.47 from 1.30.4

Database successfully upgraded to version 1.31.47.
Upgrading DB to 1.32.0 from 1.30.4

Database successfully upgraded to version 1.32.0.
Upgrading DB to 1.32.1 from 1.30.4

Database successfully upgraded to version 1.32.1.
Upgrading DB to 1.32.2 from 1.30.4

Database successfully upgraded to version 1.32.2.
Upgrading DB to 1.32.3 from 1.30.4

Database successfully upgraded to version 1.32.3.

Database upgrade to version 1.32.3 successful.

Ha! Great! Can Zoneminder be restarted now?

root@zoneminder:~# systemctl restart zoneminder

root@zoneminder:~# systemctl status zoneminder
? zoneminder.service - ZoneMinder CCTV recording and surveillance system
   Loaded: loaded (/lib/systemd/system/zoneminder.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2019-11-12 13:01:59 CET; 6s ago
  Process: 14091 ExecStop=/usr/bin/zmpkg.pl stop (code=exited, status=0/SUCCESS)
  Process: 14113 ExecStart=/usr/bin/zmpkg.pl start (code=exited, status=0/SUCCESS)
 Main PID: 14145 (zmdc.pl)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/zoneminder.service
           ? 14145 /usr/bin/perl -wT /usr/bin/zmdc.pl startup

Nov 12 13:01:58 zoneminder su[14243]: Successful su for www-data by root
Nov 12 13:01:58 zoneminder su[14243]: + ??? root:www-data
Nov 12 13:01:58 zoneminder su[14243]: pam_unix(su:session): session opened for user www-data by (uid=0)
Nov 12 13:01:58 zoneminder su[14253]: Successful su for www-data by root
Nov 12 13:01:58 zoneminder su[14253]: + ??? root:www-data
Nov 12 13:01:58 zoneminder su[14253]: pam_unix(su:session): session opened for user www-data by (uid=0)
Nov 12 13:01:58 zoneminder su[14261]: Successful su for www-data by root
Nov 12 13:01:58 zoneminder su[14261]: + ??? root:www-data
Nov 12 13:01:58 zoneminder su[14261]: pam_unix(su:session): session opened for user www-data by (uid=0)
Nov 12 13:01:59 zoneminder systemd[1]: Started ZoneMinder CCTV recording and surveillance system.

Great, Zoneminder 1.32 is now running on this server!

Discovering Zoneminder 1.32

The first immediate change is the now appearing privacy policy of Zoneminder showing up. This policy must be accepted, otherwise the overview will not be shown. Unfortunately I got disappointed by the new interface:

Zoneminder 1.32 overview

Although I love the additional information (which camera uses up how much disk space per hour/day/week/month?), the new style looks somewhat messy and kinf of "unfinished"? Also the previously praised "flat" css style is gone from the options, leaving only "base", "classic" and "dark" as possibilities.

So not really happy with the UI style, but what about the recordings and camera settings?

The recordings look much smoother now compared to the previous recordings in 1.29. Not sure though if there was a massive improvement of Zoneminder or because the newer libraries (for example ffmpeg) were installed during the Debian upgrade.

Another problem: It seems no buttons work so far. For example a click on the "Add" button (to add a new camera) simply doesn't do anything. So do a lot of other buttons, for example when I try to change the layout in the montage. Not good, 1.30 seemed much better :-(

Back to Zoneminder 1.30

I finally decided to downgrade back to Zoneminder 1.30:

root@zoneminder:~# apt-get install zoneminder=1.30.4+dfsg-2~bpo9+1

followed by a run of zmupdate.pl:

root@zoneminder:~# zmupdate.pl

Now back in 1.30 (and the lovely "flat" css style), all the buttons worked again:


But now to the next problem: The cameras wouldn't show up anymore!

Zoneminder downgrade broke camera view

The same also happens when events want to be viewed. This can be explained easily: Zoneminder was downgraded from 1.32 to 1.30 but the database is still running in version 1.32, therefore schemas, fields are not correct for the application code. Luckly there is still a database dump available. Remember the zmupdate.pl command? At the begin it asks whether or not to create a backup! This backup (basically a mysql dump) can now be restored:

root@zoneminder:~# systemctl stop zoneminder
root@zoneminder:~# mysql zm < /tmp/zm/zm-1.29.0.dump

Now the database is on 1.29 version so we can run zmupdate.pl again to upgrade it to 1.30:

root@zoneminder:~# zmupdate.pl

Initiating database upgrade to version 1.30.4 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.30.4
Loading config from DB
No option 'ZM_EYEZM_DEBUG' found, removing.
No option 'ZM_EYEZM_EVENT_VCODEC' found, removing.
No option 'ZM_EYEZM_FEED_VCODEC' found, removing.
No option 'ZM_EYEZM_H264_DEFAULT_BR' found, removing.
No option 'ZM_EYEZM_H264_DEFAULT_EVBR' found, removing.
No option 'ZM_EYEZM_H264_TIMEOUT' found, removing.
No option 'ZM_EYEZM_LOG_FILE' found, removing.
No option 'ZM_EYEZM_LOG_TO_FILE' found, removing.
No option 'ZM_EYEZM_SEG_DURATION' found, removing.
No option 'ZM_WEB_P_AJAX_TIMEOUT' found, removing.
No option 'ZM_WEB_P_CAN_STREAM' found, removing.
No option 'ZM_WEB_P_DEFAULT_RATE' found, removing.
No option 'ZM_WEB_P_DEFAULT_SCALE' found, removing.
No option 'ZM_WEB_P_SCALE_THUMBS' found, removing.
No option 'ZM_WEB_P_STREAM_METHOD' found, removing.
No option 'ZM_WEB_P_VIDEO_BITRATE' found, removing.
No option 'ZM_WEB_P_VIDEO_MAXFPS' found, removing.
Saving config to DB
Upgrading DB to 1.29.1 from 1.29.0

Database successfully upgraded to version 1.29.1.
Upgrading DB to 1.30.0 from 1.29.0

Database successfully upgraded to version 1.30.0.
Upgrading DB to 1.30.1 from 1.29.0

Database successfully upgraded to version 1.30.1.
Upgrading DB to 1.30.2 from 1.29.0

Database successfully upgraded to version 1.30.2.
Upgrading DB to 1.30.3 from 1.29.0

Database successfully upgraded to version 1.30.3.
Upgrading DB to 1.30.4 from 1.29.0

Database successfully upgraded to version 1.30.4.

Database upgrade to version 1.30.4 successful.

Followed by a Zoneminder start:

root@zoneminder:~# systemctl start zoneminder

And the camera view works again!

Zoneminder camera view fixed again


More recent articles: