upgrade from 1.36.33 to 1.36.34 failed

Discussions related to the 1.36.x series of ZoneMinder
hmronline
Posts: 5
Joined: Sun Aug 25, 2024 12:43 pm

upgrade from 1.36.33 to 1.36.34 failed

Post by hmronline »

I had a fully operational zoneminder 1.36.33, and just tried to upgrade to 1.36.34 and never went up again.

It is showing several errors while trying to do the upgrade process:

Code: Select all

Setting up zoneminder (1.36.34-bookworm1) ...
chown: cannot dereference '/var/cache/zoneminder/skins_classic_js_jquery-ui-1.12.1_jquery-ui.structure.min-dark-1624386913.css': No such file or directory
detected systemd
Warning: The unit file, source configuration file or drop-ins of zoneminder.service changed on disk. Run 'systemctl daemon-reload' to reload units.
Detected db service is mariadb.service
Checking for db
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
Cannot talk to database. You will have to create the db manually with something like:
cat /usr/share/zoneminder/db/zm_create.sql | mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
/var/lib/dpkg/info/zoneminder.postinst: 29: [: -ne: unexpected operator
Updating permissions for user zmuser@localhost
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Initiating database upgrade to version 1.36.34 from version 1.36.33

Upgrading database to version 1.36.34
Upgrading DB to 1.36.34 from 1.36.33
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Output: 
Command 'mysql --defaults-file=/etc/mysql/debian.cnf -hlocalhost zm < /usr/share/zoneminder/db/zm_update-1.36.34.sql' exited with status: 1
Error updating db.
dpkg: error processing package zoneminder (--configure):
 installed zoneminder package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 zoneminder
E: Sub-process /usr/bin/dpkg returned an error code (1)
I've managed to manually upgrade database version as stated above, and after that new errors appeared:

Code: Select all

Preparing to unpack .../zoneminder-doc_1.36.34-bookworm1_all.deb ...
Unpacking zoneminder-doc (1.36.34-bookworm1) over (2:1.36.33-dmo3) ...
Setting up zoneminder-doc (1.36.34-bookworm1) ...
Setting up zoneminder (1.36.34-bookworm1) ...
chown: cannot dereference '/var/cache/zoneminder/skins_classic_js_jquery-ui-1.12.1_jquery-ui.structure.min-dark-1624386913.css': No such file or directory
detected systemd
Detected db service is mariadb.service
Checking for db
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
Cannot talk to database. You will have to create the db manually with something like:
cat /usr/share/zoneminder/db/zm_create.sql | mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
/var/lib/dpkg/info/zoneminder.postinst: 29: [: -ne: unexpected operator
Updating permissions for user zmuser@localhost
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Please give a valid option
Usage:
    zmupdate.pl -c,--check | -f,--freshen | -v<version>,--version=<version>
    [-u <dbuser> -p <dbpass>]

Options:
    -c, --check - Check for updated versions of ZoneMinder -f, --freshen -
    Freshen the configuration in the database. Equivalent of old zmconfig.pl
    -noi --migrate-events - Update database structures as per
    USE_DEEP_STORAGE setting. -v <version>, --version=<version> - Force
    upgrade to the current version from <version> -u <dbuser>,
    --user=<dbuser> - Alternate DB user with privileges to alter DB -p
    <dbpass>, --pass=<dbpass> - Password of alternate DB user with
    privileges to alter DB -s, --super - Use system maintenance account on
    debian based systems instead of unprivileged account -d <dir>,
    --dir=<dir> - Directory containing update files if not in default build
    location -interactive - interact with the user -nointeractive - do not
    interact with the user

Error updating db.
dpkg: error processing package zoneminder (--configure):
 installed zoneminder package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 zoneminder
E: Sub-process /usr/bin/dpkg returned an error code (1)
Before trying anything else, could somebody let me know if you were able to have a successful upgrade and/or if there are any guidance to help me solve this ?

Thanks in advance
bbunge
Posts: 2951
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: upgrade from 1.36.33 to 1.36.34 failed

Post by bbunge »

I did not have a successful upgrade. Server running Debian 12. I did not mess with trying to figure out and fix the issues as for me it is easier to reinstall everything. I ended up with the development version on Debian 12.

If I have time today I will set up 1.36.33 with a backup copy of my database and try to do an upgrade again.
User avatar
iconnor
Posts: 3197
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: upgrade from 1.36.33 to 1.36.34 failed

Post by iconnor »

The update process is unable to talk to your database.

Normally under debianish systems, root can connect by using credentials in /etc/mysql/debian.cnf

If for some reason you have changed that, then root can no longer connect and everything falls apart.

This is now the second report of this. There havn't been any changes to the update scripts so I have to assume that something has changed in debian or your system since .33.

As a workaround, you can put exit 0 as the second line of /var/lib/dpkg/info/zoneminder.postinst
hmronline
Posts: 5
Joined: Sun Aug 25, 2024 12:43 pm

Re: upgrade from 1.36.33 to 1.36.34 failed

Post by hmronline »

Thanks for the quick reply.

I have not made any changes to/etc/mysqld/debian.cnf, however it shows this warning:

Code: Select all

# THIS FILE IS OBSOLETE. STOP USING IT IF POSSIBLE.
# This file exists only for backwards compatibility for
# tools that run '--defaults-file=/etc/mysql/debian.cnf'
# and have root level access to the local filesystem.
# With those permissions one can run 'mariadb' directly
# anyway thanks to unix socket authentication and hence
# this file is useless. See package README for more info.
After adding credentials there, database connection errores did not appear again, however it is still showing these errors:

Code: Select all

Setting up zoneminder (1.36.34-bookworm1) ...
chown: cannot dereference '/var/cache/zoneminder/skins_classic_js_jquery-ui-1.12.1_jquery-ui.structure.min-dark-1624386913.css': No such file or directory
detected systemd
Detected db service is mariadb.service
Checking for db
Db exists.
Updating permissions for user zmuser@localhost
Please give a valid option
Usage:
    zmupdate.pl -c,--check | -f,--freshen | -v<version>,--version=<version>
    [-u <dbuser> -p <dbpass>]

Options:
    -c, --check - Check for updated versions of ZoneMinder -f, --freshen -
    Freshen the configuration in the database. Equivalent of old zmconfig.pl
    -noi --migrate-events - Update database structures as per
    USE_DEEP_STORAGE setting. -v <version>, --version=<version> - Force
    upgrade to the current version from <version> -u <dbuser>,
    --user=<dbuser> - Alternate DB user with privileges to alter DB -p
    <dbpass>, --pass=<dbpass> - Password of alternate DB user with
    privileges to alter DB -s, --super - Use system maintenance account on
    debian based systems instead of unprivileged account -d <dir>,
    --dir=<dir> - Directory containing update files if not in default build
    location -interactive - interact with the user -nointeractive - do not
    interact with the user

Error updating db.
dpkg: error processing package zoneminder (--configure):
 installed zoneminder package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 zoneminder
E: Sub-process /usr/bin/dpkg returned an error code (1)
Is it missing an argument when calling zmupdate ? I've tested adding -c and it moved forward showing:

Code: Select all

Setting up zoneminder (1.36.34-bookworm1) ...
chown: cannot dereference '/var/cache/zoneminder/skins_classic_js_jquery-ui-1.12.1_jquery-ui.structure.min-dark-1624386913.css': No such file or directory
detected systemd
Detected db service is mariadb.service
Checking for db
Db exists.
Updating permissions for user zmuser@localhost

Freshening configuration in database
Use of uninitialized value $Config{"ZM_DYN_DB_VERSION"} in string lt at /usr/bin/zmupdate.pl line 1066.
Use of uninitialized value $Config{"ZM_DIR_IMAGES"} in string ne at /usr/bin/zmupdate.pl line 1074.

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

Please verify these values before starting ZoneMinder.

Use of uninitialized value $value in concatenation (.) or string at /usr/bin/zmupdate.pl line 1109.
Migratings passwords, if any...
Loading config from DB 0 entries
Saving config to DB 227 entries
Done Updating
Now zoneminder is up, but UI is broken (browser is having 404 errors loading JS and CSS files) and my previously configured monitors are not there.

Could you please let me know what else I can do to have it properly working again ?

Thanks again !
hmronline
Posts: 5
Joined: Sun Aug 25, 2024 12:43 pm

Re: upgrade from 1.36.33 to 1.36.34 failed

Post by hmronline »

I was able to fix the UI not loading CSS & JS, by changing the cache directory configured in the webserver (nginx in my case), as mentioned in viewtopic.php?t=33404

However, it seems this update erased all my previous config, as all database tables are empty.

I'm going to configure everything again, but hope this report helps improve the update process so no other has the same issues.

Best regards!
User avatar
iconnor
Posts: 3197
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: upgrade from 1.36.33 to 1.36.34 failed

Post by iconnor »

So 1.36.33 came from deb.multimedia.org... so I'll have to see what is different about that...
User avatar
iconnor
Posts: 3197
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: upgrade from 1.36.33 to 1.36.34 failed

Post by iconnor »

Ok yeah, that is yet another separately maintained version of zoneminder. Their removal scripts will delete the database if --purge is given.

Shouldn't do it without purge though.
eggenbef
Posts: 21
Joined: Tue Aug 27, 2024 1:13 pm

Re: upgrade from 1.36.33 to 1.36.34 failed

Post by eggenbef »

Was just performing the upgrade on ubuntu 22.04 as part of a dist-upgrade. No errors seem to have occurred and the UI of 1.36.34 is working fine but the login to the API is failing and ES is therefore not working anymore. It seems that a view (login.ctp) is missing as a I get the following back when trying to access the API:
{"success":false,"data":{"name":"An Internal Error Has Occurred.","message":"An Internal Error Has Occurred.","url":"\/zm\/api\/host\/login.json","exception":{"class":"MissingViewException","code":500,"message":"View file \"Host\/json\/login.ctp\" is missing."}}}.

Any suggestions how to fix this?
Thanks and Best Regards !
User avatar
iconnor
Posts: 3197
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: upgrade from 1.36.33 to 1.36.34 failed

Post by iconnor »

Weird. Works fine for me here.

I have to wonder if the api config is wrong but sorta half working. The Host parts don't seem to use view files (we've never had them).

Can you poaste your apache zoneminder.conf here?
eggenbef
Posts: 21
Joined: Tue Aug 27, 2024 1:13 pm

Re: upgrade from 1.36.33 to 1.36.34 failed

Post by eggenbef »

thanks for the prompt reply. the conf file of the 1.36.34 installation is attached. the file is identical with the one which is being used for a fully functional 1.36.33 instance on another ubuntu 22.04 host. i've re-installed 1.36.34 on the upgraded host but the issue with login.json still persists while getVersion.json does not seem to be impacted and returns: {"version":"1.36.34","apiversion":"2.0"}.
Attachments
zoneminder.conf.zip
(1.12 KiB) Downloaded 183 times
User avatar
iconnor
Posts: 3197
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: upgrade from 1.36.33 to 1.36.34 failed

Post by iconnor »

Yeah that looks correct to me.

Is this package from ppa or zmrepo or elsewhere? Can you paste the output of dpkg -s zoneminder
User avatar
iconnor
Posts: 3197
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: upgrade from 1.36.33 to 1.36.34 failed

Post by iconnor »

Ooh... I figured it out... Auth is not turned on.
eggenbef
Posts: 21
Joined: Tue Aug 27, 2024 1:13 pm

Re: upgrade from 1.36.33 to 1.36.34 failed

Post by eggenbef »

the source of the package is ppa.launchpadcontent.net/iconnor/zoneminder-1.36/ubuntu/ jammy main. here's the dpkg output:

Code: Select all

Package: zoneminder
Status: install ok installed
Priority: optional
Section: net
Installed-Size: 32277
Maintainer: Isaac Connor <isaac@zoneminder.com>
Architecture: amd64
Version: 1.36.34-jammy1
Depends: libavcodec58 (>= 7:4.4), libavformat58 (>= 7:4.4), libavutil56 (>= 7:4.4), libc6 (>= 2.34), libgcc-s1 (>= 3.3.1), libgcrypt20 (>= 1.9.0), libgnutls30 (>= 3.7.0), libjpeg8 (>= 8c), libjwt-gnutls0 (>= 1.9.0), libmysqlclient21 (>= 8.0.11), libpcre3, libstdc++6 (>= 12), libswresample3 (>= 7:4.4), libswscale5 (>= 7:4.4), zlib1g (>= 1:1.1.4), perl:any, javascript-common, ffmpeg, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, libdbd-mysql-perl, libphp-serialization-perl, libmodule-load-conditional-perl, libnet-sftp-foreign-perl, libarchive-zip-perl, libdevice-serialport-perl, libimage-info-perl, libio-interface-perl, libjson-maybexs-perl, libsys-mmap-perl, liburi-encode-perl, libwww-perl, liburi-perl, libdata-dump-perl, libdatetime-perl, libclass-std-fast-perl, libsoap-wsdl-perl, libio-socket-multicast-perl, libdigest-sha-perl, libsys-cpu-perl, libsys-meminfo-perl, libdata-uuid-perl, libnumber-bytes-human-perl, libfile-slurp-perl, default-mysql-client | mariadb-client | virtual-mysql-client, php-mysql, php-gd, php-apcu, php-json, php-intl, policykit-1, rsyslog | system-log-daemon, zip, libcrypt-eksblowfish-perl, libdata-entropy-perl, libvncclient1 | libvncclient0
Recommends: apache2 (>= 2.4.6-4~) | nginx | httpd, libapache2-mod-php | php-fpm, default-mysql-server | mariadb-server | virtual-mysql-server, zoneminder-doc (>= 1.36.34-jammy1)
Suggests: fcgiwrap, logrotate
Conffiles:
 /etc/apache2/conf-available/zoneminder.conf 845925cd0e008e93c0850b9f5236db82
 /etc/init.d/zoneminder bb12d862700881828f722c477ef271c1
 /etc/logrotate.d/zoneminder 94a48a435af9434bea71b00802e7a5d9
 /etc/zm/conf.d/01-system-paths.conf 934bbdf926fdc4c9b5167028e134f70a
 /etc/zm/conf.d/02-multiserver.conf af136258d51fdb551b50d39f4f563cd9
 /etc/zm/conf.d/README 15fa271f6d59fd553c7e282ddd502898
 /etc/zm/zm.conf 21d5c0e3b2c2337aae600ffa4429152a
Description: video camera security and surveillance solution
 ZoneMinder is intended for use in single or multi-camera video security
 applications, including commercial or home CCTV, theft prevention and child
 or family member or home monitoring and other care scenarios. It
 supports capture, analysis, recording, and monitoring of video data coming
 from one or more video or network cameras attached to a Linux system.
 ZoneMinder also support web and semi-automatic control of Pan/Tilt/Zoom
 cameras using a variety of protocols. It is suitable for use as a home
 video security system and for commercial or professional video security
 and surveillance. It can also be integrated into a home automation system
 via X.10 or other protocols.
Homepage: https://www.zoneminder.com/
thank you and best regards!
hmronline
Posts: 5
Joined: Sun Aug 25, 2024 12:43 pm

Re: upgrade from 1.36.33 to 1.36.34 failed

Post by hmronline »

iconnor wrote: Mon Aug 26, 2024 4:53 pm So 1.36.33 came from deb.multimedia.org... so I'll have to see what is different about that...
Yes, because I wanted to install FFMPEG with required CUDA support, and I've found it available there.

However, for zoneminder (which is also available in deb.multimedia.org as you stated), I've tried to add a policy like this:

Code: Select all

Package: *
Pin: origin zmrepo.zoneminder.com
Pin-Priority: 1001

Package: zoneminder
Pin: origin www.deb-multimedia.org
Pin-Priority: -1
I'm now having issues with Zones, which are not shown as available en Console and no events are being triggered... so I'm thinking on re-installing everything from the start.
eggenbef
Posts: 21
Joined: Tue Aug 27, 2024 1:13 pm

Re: upgrade from 1.36.33 to 1.36.34 failed

Post by eggenbef »

iconnor wrote: Wed Aug 28, 2024 3:00 pm Ooh... I figured it out... Auth is not turned on.
ok - so will roll back to 1.36.33 and re-upgrade once the respective fix made it into a release or is this issue caused by a misconfiguration that can easily be changed post the installation of the package?
thank you!
Post Reply