error updating the db 1.37.59 from 1.37.57

Current Development version likely to have breaking changes
Post Reply
KTownKnerd
Posts: 8
Joined: Sat Oct 31, 2020 1:41 am

error updating the db 1.37.59 from 1.37.57

Post by KTownKnerd »

Went to upgrade Zoenminder tonight and I am unable to continue as it's throwing an error.

Setting up zoneminder (1.37.59~20240417.31-bookworm) ...
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.59 from version 1.37.57

Upgrading database to version 1.37.59
Upgrading DB to 1.37.58 from 1.37.57

Database successfully upgraded to version 1.37.58.
Upgrading DB to 1.37.59 from 1.37.57
ERROR 1050 (42S01) at line 17: Table 'Snapshots_Events' already exists
Output: Checking For Snapshot_Events Table which should be Snapshots_Events
Checking For Snapshot_Events Table which should be Snapshots_Events
Command 'mysql --defaults-file=/etc/mysql/debian.cnf -hlocalhost zm < /usr/share/zoneminder/db/zm_update-1.37.59.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)

Debian 12.5
MariaDB 10.11.6-0+deb12u1
Zoneminder: 1.37.59~20240417.31-bookworm
dougmccrary
Posts: 1218
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: error updating the db 1.37.59 from 1.37.57

Post by dougmccrary »

Checking For Snapshot_Events Table which should be Snapshots_Events

Workaround - rename Snapshots_Events to Snapshot_Events

This has happened once or twice before.
User avatar
iconnor
Posts: 2912
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: error updating the db 1.37.59 from 1.37.57

Post by iconnor »

It sounds like maybe both tables exist, which just makes this a huge mess.

If you actually have any snapshots, you might want to look in those tables and see if there is anything in them.

I am pushing an update to make it check for existence of both.
KTownKnerd
Posts: 8
Joined: Sat Oct 31, 2020 1:41 am

Re: error updating the db 1.37.59 from 1.37.57

Post by KTownKnerd »

I do have both tables, and they both are empty. Should I delete Snapshot_Events table?
dougmccrary
Posts: 1218
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: error updating the db 1.37.59 from 1.37.57

Post by dougmccrary »

You could try the newest build to see if it works automatically....
Otherwise you can delete either or both since they are empty. Then run zmupdate.pl -That should (re)add the correct table.
KTownKnerd
Posts: 8
Joined: Sat Oct 31, 2020 1:41 am

Re: error updating the db 1.37.59 from 1.37.57

Post by KTownKnerd »

dougmccrary wrote: Fri Apr 26, 2024 3:49 am You could try the newest build to see if it works automatically....
Otherwise you can delete either or both since they are empty. Then run zmupdate.pl -That should (re)add the correct table.
I already have the newest build.

I did try deleting both and then running zmupdate.pl, but that just told me I was already at the latest database version update skipped.

What i ended up doing was restoring from a backup, and then just manually deleted the Snapshot_Events table.

Thanks for everyone's help with this.
Post Reply