MySQL issue after upgrading to Zoneminder 1.34

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
billaye
Posts: 2
Joined: Sun Feb 09, 2020 3:01 am

MySQL issue after upgrading to Zoneminder 1.34

Post by billaye »

Hello,

I recently upgraded to Zoneminder 1.34. Though it's failing to start due to a migration SQL failing to update the "Logs" table.

Code: Select all

Feb 8 18:32:47 33e80d710a9c /etc/mysql/debian-start[12359]: Checking for insecure root accounts.
Feb 8 18:32:47 33e80d710a9c /etc/mysql/debian-start[12363]: Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables

Initiating database upgrade to version 1.34.2 from version 1.32.3


Upgrading database to version 1.34.2

Loading config from DB 230 entries
Saving config to DB 230 entries
Upgrading DB to 1.33.0 from 1.32.3

Database successfully upgraded to version 1.33.0.

Upgrading DB to 1.33.1 from 1.32.3

Database successfully upgraded to version 1.33.1.

Upgrading DB to 1.33.2 from 1.32.3

Database successfully upgraded to version 1.33.2.

Upgrading DB to 1.33.3 from 1.32.3

Database successfully upgraded to version 1.33.3.

Upgrading DB to 1.33.4 from 1.32.3

Database successfully upgraded to version 1.33.4.

Upgrading DB to 1.33.5 from 1.32.3

Database successfully upgraded to version 1.33.5.

Upgrading DB to 1.33.6 from 1.32.3

Database successfully upgraded to version 1.33.6.

Upgrading DB to 1.33.7 from 1.32.3

Database successfully upgraded to version 1.33.7.

Upgrading DB to 1.33.8 from 1.32.3

Database successfully upgraded to version 1.33.8.

Upgrading DB to 1.33.9 from 1.32.3

Database successfully upgraded to version 1.33.9.

Upgrading DB to 1.33.10 from 1.32.3

Database successfully upgraded to version 1.33.10.

Upgrading DB to 1.33.11 from 1.32.3

Database successfully upgraded to version 1.33.11.

Upgrading DB to 1.33.12 from 1.32.3
ERROR 1034 (HY000) at line 15: Incorrect key file for table 'Logs'; try to repair it

Command 'mysql -hlocalhost -uzmuser -p"zmpass" zm < /usr/share/zoneminder/db/zm_update-1.33.12.sql' exited with status: 1
Output:

Freshening configuration in database
Migratings passwords, if any...
Loading config from DB 230 entries
Saving config to DB 230 entries
* Starting Apache httpd web server apache2
*
Starting ZoneMinder:
Feb 8 18:35:48 33e80d710a9c zmpkg[12462]: INF [Sanity checking States table...]
Feb 8 18:35:48 33e80d710a9c zmpkg[12462]: INF [Command: start]
Feb 8 18:35:49 33e80d710a9c zmpkg[12462]: FAT [Version mismatch, system is version 1.34.
Environment: Using the dockerized version of Zoneminder on Unraid - https://github.com/dlandon/zoneminder, I believe he is using the Ubuntu package.

Any help would be appreciated.

Thanks.
User avatar
iconnor
Posts: 2904
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: MySQL issue after upgrading to Zoneminder 1.34

Post by iconnor »

You might be running out of ram.

These updates alter the table structure for the Logs table, so mysql has to basically duplicate the table. Monitor your disk space.
You may want to just remove all the database log entries before doing the update.

The fastest way is to just drop and recreate the table.
mysql -u zmuser -p zm << EOF
DROP TABLE Logs;

CREATE TABLE `Logs` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`TimeKey` decimal(16,6) NOT NULL,
`Component` varchar(32) NOT NULL,
`ServerId` int(10) unsigned,
`Pid` int(10) DEFAULT NULL,
`Level` tinyint(3) NOT NULL,
`Code` char(3) NOT NULL,
`Message` text NOT NULL,
`File` varchar(255) DEFAULT NULL,
`Line` smallint(5) unsigned DEFAULT NULL,
PRIMARY KEY (`Id`),
KEY `TimeKey` (`TimeKey`)
) ENGINE=@ZM_MYSQL_ENGINE@;

CREATE INDEX `Logs_TimeKey_idx` ON `Logs` (`TimeKey`);
CREATE INDEX `Logs_Level_idx` ON `Logs` (`Level`);

EOF

Then re-run zmupdate.pl
billaye
Posts: 2
Joined: Sun Feb 09, 2020 3:01 am

Re: MySQL issue after upgrading to Zoneminder 1.34

Post by billaye »

That was definitely the issue.

Being a docker newb, running that script on a failing container was painful.

Most of the logs spewing occurred from events being stored in the db tables but not being captured in my nominated storage device ( as I was messing around with this at the time )

I'll keep a watch on the size of the tables this time.

Thanks!
Post Reply