Incorrect Key File

Forum for questions and support relating to the 1.24.x releases only.
Locked
naschas
Posts: 26
Joined: Thu Apr 01, 2010 7:19 pm

Incorrect Key File

Post 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!
hengst
Posts: 28
Joined: Sun Sep 26, 2010 7:15 am
Location: Netherlands

Post by hengst »

naschas
Posts: 26
Joined: Thu Apr 01, 2010 7:19 pm

Post 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.
hengst
Posts: 28
Joined: Sun Sep 26, 2010 7:15 am
Location: Netherlands

Post 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.
naschas
Posts: 26
Joined: Thu Apr 01, 2010 7:19 pm

Post 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"
hengst
Posts: 28
Joined: Sun Sep 26, 2010 7:15 am
Location: Netherlands

Post 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/
hengst
Posts: 28
Joined: Sun Sep 26, 2010 7:15 am
Location: Netherlands

Post 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,
naschas
Posts: 26
Joined: Thu Apr 01, 2010 7:19 pm

Post 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?
hengst
Posts: 28
Joined: Sun Sep 26, 2010 7:15 am
Location: Netherlands

Post by hengst »

hmmm looks like it wnat to check the database "–repair" .

what does the following command do :

mysqlcheck -p -u root –repair zm
naschas
Posts: 26
Joined: Thu Apr 01, 2010 7:19 pm

Post by naschas »

that gives me the same error:

"mysqlcheck: Got error: 1049: Unknown database '–repair' when selecting the database"
hengst
Posts: 28
Joined: Sun Sep 26, 2010 7:15 am
Location: Netherlands

Post by hengst »

nasty problem,

what does an

fsck

say
naschas
Posts: 26
Joined: Thu Apr 01, 2010 7:19 pm

Post 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)
hengst
Posts: 28
Joined: Sun Sep 26, 2010 7:15 am
Location: Netherlands

Post by hengst »

do once again fsck , reboot. and try to acces your zm database
Locked