Page 1 of 1

Incorrect Key File

Posted: Mon Sep 27, 2010 8:19 pm
by naschas
Good evening everyone,

I small problem after my ZM server was the victim of a forced power-out. After logging in to the ZM console, I get this error:

"An error has occurred and this operation cannot continue.
For full details check your web logs for the code '4BAEF0'"

After checking the log, I see this error:

(4BAEF0): select count(if(1 and ( E.MonitorId = 1 ),1,NULL)) as EventCount0, count(if(1 and ( E.Archived = 0 and E.StartTime >= '2010-09-27 08:24:34' and E.MonitorId = 1 ),1,NULL)) as EventCount1, count(if(1 and ( E.Archived = 0 and E.StartTime >= '2010-09-26 09:24:34' and E.MonitorId = 1 ),1,NULL)) as EventCount2, count(if(1 and ( E.Archived = 0 and E.StartTime >= '2010-09-20 09:24:34' and E.MonitorId = 1 ),1,NULL)) as EventCount3, count(if(1 and ( E.Archived = 0 and E.StartTime >= '2010-08-27 09:24:34' and E.MonitorId = 1 ),1,NULL)) as EventCount4, count(if(1 and ( E.Archived = 1 and E.MonitorId = 1 ),1,NULL)) as EventCount5 from Events as E where MonitorId = '1'
[Mon Sep 27 09:24:34 2010] [error] [client 196.210.146.209] SQL-ERROR(4BAEF0): Incorrect key file for table './zm/Events.MYI'; try to repair it

Any suggestions on how to fix this?

Thanks in advance!

Posted: Mon Sep 27, 2010 8:36 pm
by hengst

Posted: Tue Sep 28, 2010 6:53 am
by naschas
Thanks for the reply,

When I try to repair the database I get the following from the MySQL terminal:

"ERROR 1046 (3D000): No database selected"

"I used the REPAIR TABLE zm;" command.

Posted: Tue Sep 28, 2010 8:06 am
by hengst
your answer is in the error, it tells you whats missing.

you told mysql to repair the table "zm" but not in what database.

from what i remember , command line :
something like :

mysqlcheck --auto-repair dbname tablename

should do the trick.

Posted: Tue Sep 28, 2010 8:29 am
by naschas
Ok from the error in the log, it seems to relate to the Events.MYI table, but when I run "mysqlcheck --auto-repair zm Events.MYI;" I get the same error:

"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysqlcheck --auto-repair zm Events.MYI' at line 1"

Posted: Tue Sep 28, 2010 8:46 am
by hengst
yep, i didnt put it up right.

but he', google is your friend.

look what i found :
http://beginlinux.com/blog/2009/12/main ... databases/

Posted: Tue Sep 28, 2010 8:50 am
by hengst
also, i think the database you want to repair is " zm " and i think the table " Events " is the one giving problems.

but ofcourse i don know for sure,

Posted: Wed Sep 29, 2010 7:16 am
by naschas
Thanks for the help, but after trying all of the repair commands, I get this error:

"mysqlcheck: Got error: 1049: Unknown database '–repair' when selecting the database"

Any ideas?

Posted: Wed Sep 29, 2010 7:23 am
by hengst
hmmm looks like it wnat to check the database "–repair" .

what does the following command do :

mysqlcheck -p -u root –repair zm

Posted: Wed Sep 29, 2010 7:27 am
by naschas
that gives me the same error:

"mysqlcheck: Got error: 1049: Unknown database '–repair' when selecting the database"

Posted: Wed Sep 29, 2010 7:33 am
by hengst
nasty problem,

what does an

fsck

say

Posted: Wed Sep 29, 2010 7:38 am
by naschas
The result of fsck:

Clearing orphaned inode 6765 (uid=1000, gid=1000, mode=0100600, size=240)
Clearing orphaned inode 6764 (uid=1000, gid=1000, mode=0100600, size=1067)
Clearing orphaned inode 519 (uid=1000, gid=1000, mode=0140755, size=0)
Clearing orphaned inode 109 (uid=113, gid=121, mode=0100600, size=0)
Clearing orphaned inode 80 (uid=113, gid=121, mode=0100600, size=0)
Clearing orphaned inode 73 (uid=113, gid=121, mode=0100600, size=0)
Clearing orphaned inode 70 (uid=113, gid=121, mode=0100600, size=0)
Clearing orphaned inode 49 (uid=113, gid=121, mode=0100600, size=0)
/dev/sda1: clean, 8857472/15081472 files, 53982572/60310010 blocks (check after next mount)

Posted: Wed Sep 29, 2010 7:48 am
by hengst
do once again fsck , reboot. and try to acces your zm database