/zm/Logs is marked as crashed and last repair failed

Forum for questions and support relating to the 1.25.x releases only.
Locked
eandwal
Posts: 5
Joined: Sun Jul 28, 2013 6:19 am

/zm/Logs is marked as crashed and last repair failed

Post by eandwal »

Can anyone provide any pointers on how I could fix this error.

Web interface now shows this error and nothing else:-

V1.25.0

Options / Can't write log entry 'insert into Logs ( TimeKey, Component, Pid, Level, Code, Message, File, Line ) values ( 1390727348.044826, 'web_php', 2256, -3, 'FAT', 'SQL-ERR \'Table \'./zm/Logs\' is marked as crashed and last (automatic?) repair failed\',

statement was \'select Level, count(Level) as LevelCount from Logs where Level < 0 and from_unixtime(TimeKey) + interval 900 second > now() group by Level order by Level asc\'', '/usr/share/zoneminder/includes/database.php', 78 )': Table './zm/Logs' is marked as crashed and last (automatic?) repair failed


A google search suggested I type into mysql " USE zm; REPAIR TABLE Events; card=23 for bt787" but this did not work.
mikb
Posts: 585
Joined: Mon Mar 25, 2013 12:34 pm

Re: /zm/Logs is marked as crashed and last repair failed

Post by mikb »

eandwal wrote:A google search suggested I type into mysql " USE zm; REPAIR TABLE Events; card=23 for bt787" but this did not work.
I'd hold off typing any more random SQL statements until someone here addresses YOUR problem.

I know too little about the internals of ZM to comment further, but YOU have a problem with the Logs table, and your found fix is something very specific for someone else fiddling with the Events table!

That doesn't sound like a plan to me.

Take care :)
eandwal
Posts: 5
Joined: Sun Jul 28, 2013 6:19 am

Re: /zm/Logs is marked as crashed and last repair failed

Post by eandwal »

I do not mind losing my recording history so a solution which resets the log file would be good.
felixr
Posts: 21
Joined: Tue Aug 13, 2013 2:14 pm

Re: /zm/Logs is marked as crashed and last repair failed

Post by felixr »

It happened to me also (zm v1.29.0 on Debian Jessie) and this solution worked for me

It's a good idea to backup your database before doing the recovery.

As root user:
Stop zoneminder
#systemctl stop zoneminder.service

Stop mysql
#systemctl stop mysql.service

Run the following command (if the database name is different than zm, make appropriate changes):
myisamchk -r -f -o /var/lib/mysql/zm/Logs

Start mysql
#systemctl start mysql.service
and run
#systemctl status mysql.service - it should not report any error.

Start zoneminder and that's all.
Locked