Page 1 of 1

Upgrade to 1.37.27 fails with error in post body

Posted: Thu Nov 03, 2022 2:34 pm
by tledford
Hello, all;

There doesn't appear to be a Support topic for 1.37.x, so I'm posting here, let me know if this is the wrong place.

When I attempt to upgrade 1.37.25 to 1.37.27 (more on that confusion later), I receive the following message:
Setting up zoneminder (1.37.27~20221103.0-bullseye) ...
detected systemd
Detected db service is mariadb.service
Checking for db
Db exists.
Updating permissions for user zmuser@localhost

Initiating database upgrade to version 1.37.27 from version 1.37.25

Upgrading database to version 1.37.27
Upgrading DB to 1.37.26 from 1.37.25

Database successfully upgraded to version 1.37.26.
Upgrading DB to 1.37.27 from 1.37.25
ERROR 1051 (42S02) at line 1: Unknown table 'zm.Groups_Permissions'
Output:
Command 'mysql --defaults-file=/etc/mysql/debian.cnf -hlocalhost zm < /usr/share/zoneminder/db/zm_update-1.37.27.sql' exited with status: 1
Error updating db.
My confusion stems from the fact that the first step (upgrade from 1.37.25 to 1.37.26) allegedly succeeds and the second step (1.37.26 to 1.17.27) fails due to the unexpected table; BUT when I attempt the upgrade again, it again starts with 1.37.25, so the first step in the last attempt didn't REALLY succeed? Maybe because the second step fails the whole transaction rolls back?

Anyway, does anyone have any suggestions as to how to work around the zm.Groups_Permissions problem?

Many thanks!

Regards,
TL

Re: Upgrade to 1.37.27 fails with error in post body

Posted: Thu Nov 03, 2022 3:42 pm
by iconnor
There are errors in the update file. Fix has already been pushed and new packages building.

Re: Upgrade to 1.37.27 fails with error in post body

Posted: Thu Nov 03, 2022 4:57 pm
by tledford
iconnor wrote: Thu Nov 03, 2022 3:42 pm There are errors in the update file. Fix has already been pushed and new packages building.
Thank you, sir! I'll give it another shot tomorrow.

Re: Upgrade to 1.37.27 fails with error in post body

Posted: Sat Nov 19, 2022 7:44 am
by codercrack
Hello,
to this day i still have the same problem

Code: Select all

nitiating database upgrade to version 1.37.27 from version 1.37.25

Do you wish to take a backup of your database prior to upgrading?
This may result in a large file in /var/tmp/zm if you have a lot of events.
Press 'y' for a backup or 'n' to continue : y
Creating backup to /var/tmp/zm/zm-1.37.25.dump. This may take several minutes.
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
Database successfully backed up to /var/tmp/zm/zm-1.37.25.dump, proceeding to upgrade.

Upgrading database to version 1.37.27
Upgrading DB to 1.37.26 from 1.37.25
mysql: [Warning] Using a password on the command line interface can be insecure.

Database successfully upgraded to version 1.37.26.
Upgrading DB to 1.37.27 from 1.37.25
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1216 (23000) at line 101: Cannot add or update a child row: a foreign key constraint fails
Output: Groups_Permissions table exists
Groups_Permissions table exists
Groups_Permissions_GroupId_UserId_idx already exists on Groups_Permissions table
Groups_Permissions_GroupId_UserId_idx already exists on Groups_Permissions table
Groups_Permissions_UserId_idx already exists on Groups_Permissions table
Groups_Permissions_UserId_idx already exists on Groups_Permissions table
Monitors_Permissions table exists
Monitors_Permissions table exists
Monitors_Permissions_MonitorId_UserId_idx already exists on Monitors_Permissions table
Monitors_Permissions_MonitorId_UserId_idx already exists on Monitors_Permissions table
Monitors_Permissions_UserId_idx already exists on Monitors_Permissions table
Monitors_Permissions_UserId_idx already exists on Monitors_Permissions table
Command 'mysql -uzmuser -p'zmpass' -hlocalhost zm < /usr/share/zoneminder/db/zm_update-1.37.27.sql' exited with status: 1

Re: Upgrade to 1.37.27 fails with error in post body

Posted: Sat Nov 19, 2022 10:37 pm
by iconnor
I have fixed it this morning. Just started building packages.

The issue is that there is a Monitor Id in the user permissions that no longer exists.

Re: Upgrade to 1.37.27 fails with error in post body

Posted: Sun Nov 20, 2022 2:36 pm
by codercrack
Hello,
It worked, thank you !! :D