News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Forum Dead - Corrupt tables , unable to repair or restore.... HELP!

Started by ModelBoatMayhem, March 14, 2012, 07:07:45 AM

Previous topic - Next topic

ModelBoatMayhem

Evening all!

I've just updated my MySQL from 4.1 to MySQL 5.1 via cpanel.... something went badly wrong.

The forum has crashed with
"Incorrect key file for table 'nnnnn_members'; try to repair it"


( I have a full back - 67Mb uncompressed   -   (forum ver 1.1.9)


Any help / guidance would be gratefully appreciated.



Martin
That's my firm opinion.... but what do I know?!

kat

First off, have you tried repairing, from Forum Maintenance?

Tried repairing from CPanel>Databases?

ModelBoatMayhem

#2
Hi K@

Yes ran the Cpanel & MyPHPadmin repair tools most past OK but errors in four areas...


_forum.backup_mbmf_members
Error    : Incorrect key file for table 'backup_mbmf_members'; try to repair it
error    : Corrupt

_forum.mbmf_members
Error    : Incorrect key file for table 'mbmf_members'; try to repair it
error    : Corrupt

_forum.mboards
Error    : Incorrect key file for table 'mboards'; try to repair it
error    : Corrupt


_forum.mmembers
Error    : Incorrect key file for table 'mmembers'; try to repair it
error    : Corrupt
That's my firm opinion.... but what do I know?!

kat


ModelBoatMayhem

No, same report every time I run it.

Just ran it again from MyPHPadmin Repair:


_forum.backup_mbmf_members    check    Error    Incorrect key file for table 'backup_mbmf_members'...
_forum.backup_mbmf_members    check    error    Corrupt

_forum.mbmf_members    check    Error    Incorrect key file for table 'mbmf_members'; try t...
_forum.mbmf_members    check    error    Corrupt

_forum.mboards    check    Error    Incorrect key file for table 'mboards'; try to rep...
_forum.mboards    check    error    Corrupt

_forum.mmembers    check    Error    Incorrect key file for table 'mmembers'; try to re...
_forum.mmembers    check    error    Corrupt
That's my firm opinion.... but what do I know?!

kat

You repair it, but it doesn't repair... Weird.

Might be best to give your host a wave, then, I'm afraid.

ModelBoatMayhem

That's my firm opinion.... but what do I know?!

kat


ModelBoatMayhem

Hi K,

there's nothing there....
The backup i have is the .sql back from - Forum Maintenance
That's my firm opinion.... but what do I know?!

kat

Oh, ******.

I don't know why they still have that, coz it's crap and always has been.

Have a word with your host, mate.

MrPhil

backup_mbmf_members -- this is a backup from a conversion... nice to fix, but not mandatory (unless you need to restore that backup)

mbmf_members -- mbmf_ is your SMF database prefix? the usual default is smf_ (Model Boat Mayhem Forum?)

mboards -- no prefix? or the prefix is just 'm'?  or is this a custom/mod table with no prefix? unusual, in any case
mmembers -- ditto

I'm wondering if the lack of prefix (or inconsistent prefix) is conflicting with something somewhere...

ModelBoatMayhem

Hi Mr Phill,

The actual tables are:


mbmayhem_forum.backup_mbmf_members
Error    : Incorrect key file for table 'backup_mbmf_members'; try to repair it
error    : Corrupt

mbmayhem_forum.mbmf_members
Error    : Incorrect key file for table 'mbmf_members'; try to repair it
error    : Corrupt

mbmayhem_forum.mboards
Error    : Incorrect key file for table 'mboards'; try to repair it
error    : Corrupt

mbmayhem_forum.mmembers
Error    : Incorrect key file for table 'mmembers'; try to repair it
error    : Corrupt

... as the forum is dead, I hope there's no security risk...
That's my firm opinion.... but what do I know?!

ModelBoatMayhem


Is there any way I can just import those (corrupt) tables from the backup?
That's my firm opinion.... but what do I know?!

ModelBoatMayhem

That's my firm opinion.... but what do I know?!

Illori

ModelBoatMayhem please do not bump within 24 hours we are all volunteers and reply if and when we know the answer

MrPhil

My point is "where the hell did mboards and mmembers tables come from?" Those are not standard SMF tables -- were they added by a mod? <prefix>boards and <prefix>members are standard tables... did you have an installation with a <prefix> of "m" before you had an installation with a <prefix> of "mbmf_"? Or, no <prefix> at all and new tables named "mboards" and "mmembers"? It's possible that those two tables are junk and can be removed, if they're from an old installation.

If the "backup" and two "m" tables are in your backup file, and you know that the "m" tables are not in use by any mod, just DROP them from your database. That will clear up 3 out of the 4 problems reported. If the mbmf_members board is still corrupted, we'll have to deal with that separately. Worst case, we'll have to DROP the members table and restore (just) it from the backup. Let's see if other measures work first.

ModelBoatMayhem

Thanks for you help Phil,
(my inbox is about to exploded soon with messages from my forum members!)

I've deleted the "m" prfix table and run the repair tool again.

SQL result
Host: localhost
Database: mbmayhem_forum
Generation Time: Mar 15, 2012 at 10:06 PM
Generated by: phpMyAdmin 3.4.9 / MySQL 5.1.61
SQL query:

Rows: 93
Table    Op    Msg_type    Msg_text
mbmayhem_forum.backup_mbmf_ads    repair    status    OK
mbmayhem_forum.backup_mbmf_attachments    repair    status    OK
mbmayhem_forum.backup_mbmf_banned    repair    status    OK
mbmayhem_forum.backup_mbmf_ban_groups    repair    status    OK
mbmayhem_forum.backup_mbmf_ban_items    repair    status    OK
mbmayhem_forum.backup_mbmf_boards    repair    status    OK
mbmayhem_forum.backup_mbmf_board_permissions    repair    status    OK
mbmayhem_forum.backup_mbmf_calendar    repair    status    OK
mbmayhem_forum.backup_mbmf_calendar_holidays    repair    status    OK
mbmayhem_forum.backup_mbmf_categories    repair    status    OK
mbmayhem_forum.backup_mbmf_collapsed_categories    repair    status    OK
mbmayhem_forum.backup_mbmf_im_recipients    repair    status    OK
mbmayhem_forum.backup_mbmf_instant_messages    repair    status    OK
mbmayhem_forum.backup_mbmf_log_actions    repair    status    OK
mbmayhem_forum.backup_mbmf_log_activity    repair    status    OK
mbmayhem_forum.backup_mbmf_log_banned    repair    status    OK
mbmayhem_forum.backup_mbmf_log_boards    repair    status    OK
mbmayhem_forum.backup_mbmf_log_errors    repair    status    OK
mbmayhem_forum.backup_mbmf_log_floodcontrol    repair    status    OK
mbmayhem_forum.backup_mbmf_log_karma    repair    status    OK
mbmayhem_forum.backup_mbmf_log_mark_read    repair    status    OK
mbmayhem_forum.backup_mbmf_log_notify    repair    status    OK
mbmayhem_forum.backup_mbmf_log_online    repair    status    OK
mbmayhem_forum.backup_mbmf_log_polls    repair    status    OK
mbmayhem_forum.backup_mbmf_log_search    repair    status    OK
mbmayhem_forum.backup_mbmf_log_search_messages    repair    status    OK
mbmayhem_forum.backup_mbmf_log_search_results    repair    status    OK
mbmayhem_forum.backup_mbmf_log_search_subjects    repair    status    OK
mbmayhem_forum.backup_mbmf_log_search_topics    repair    status    OK
mbmayhem_forum.backup_mbmf_log_topics    repair    status    OK
mbmayhem_forum.backup_mbmf_membergroups    repair    status    OK
mbmayhem_forum.backup_mbmf_members    repair    Error    Incorrect key file for table 'backup_mbmf_members'...
mbmayhem_forum.backup_mbmf_members    repair    error    Corrupt

mbmayhem_forum.backup_mbmf_messages    repair    status    OK
mbmayhem_forum.backup_mbmf_message_icons    repair    status    OK
mbmayhem_forum.backup_mbmf_moderators    repair    status    OK
mbmayhem_forum.backup_mbmf_package_servers    repair    status    OK
mbmayhem_forum.backup_mbmf_permissions    repair    status    OK
mbmayhem_forum.backup_mbmf_personal_messages    repair    status    OK
mbmayhem_forum.backup_mbmf_pm_recipients    repair    status    OK
mbmayhem_forum.backup_mbmf_polls    repair    status    OK
mbmayhem_forum.backup_mbmf_poll_choices    repair    status    OK
mbmayhem_forum.backup_mbmf_sessions    repair    status    OK
mbmayhem_forum.backup_mbmf_settings    repair    status    OK
mbmayhem_forum.backup_mbmf_smileys    repair    status    OK
mbmayhem_forum.backup_mbmf_themes    repair    status    OK
mbmayhem_forum.backup_mbmf_topics    repair    status    OK
mbmayhem_forum.mattachments    repair    status    OK
mbmayhem_forum.mban_groups    repair    status    OK
mbmayhem_forum.mban_items    repair    status    OK
mbmayhem_forum.mbmf_ads    repair    status    OK
mbmayhem_forum.mbmf_attachments    repair    status    OK
mbmayhem_forum.mbmf_ban_groups    repair    status    OK
mbmayhem_forum.mbmf_ban_items    repair    status    OK
mbmayhem_forum.mbmf_boards    repair    status    OK
mbmayhem_forum.mbmf_board_permissions    repair    status    OK
mbmayhem_forum.mbmf_calendar    repair    status    OK
mbmayhem_forum.mbmf_calendar_holidays    repair    status    OK
mbmayhem_forum.mbmf_categories    repair    status    OK
mbmayhem_forum.mbmf_collapsed_categories    repair    status    OK
mbmayhem_forum.mbmf_log_actions    repair    status    OK
mbmayhem_forum.mbmf_log_activity    repair    status    OK
mbmayhem_forum.mbmf_log_banned    repair    status    OK
mbmayhem_forum.mbmf_log_boards    repair    status    OK
mbmayhem_forum.mbmf_log_errors    repair    status    OK
mbmayhem_forum.mbmf_log_floodcontrol    repair    status    OK
mbmayhem_forum.mbmf_log_karma    repair    status    OK
mbmayhem_forum.mbmf_log_mark_read    repair    status    OK
mbmayhem_forum.mbmf_log_notify    repair    status    OK
mbmayhem_forum.mbmf_log_online    repair    status    OK
mbmayhem_forum.mbmf_log_polls    repair    status    OK
mbmayhem_forum.mbmf_log_search_messages    repair    status    OK
mbmayhem_forum.mbmf_log_search_results    repair    status    OK
mbmayhem_forum.mbmf_log_search_subjects    repair    status    OK
mbmayhem_forum.mbmf_log_search_topics    repair    status    OK
mbmayhem_forum.mbmf_log_topics    repair    status    OK
mbmayhem_forum.mbmf_membergroups    repair    status    OK
mbmayhem_forum.mbmf_members    repair    Error    Incorrect key file for table 'mbmf_members'; try t...
mbmayhem_forum.mbmf_members    repair    error    Corrupt

mbmayhem_forum.mbmf_messages    repair    status    OK
mbmayhem_forum.mbmf_message_icons    repair    status    OK
mbmayhem_forum.mbmf_moderators    repair    status    OK
mbmayhem_forum.mbmf_package_servers    repair    status    OK
mbmayhem_forum.mbmf_permissions    repair    status    OK
mbmayhem_forum.mbmf_personal_messages    repair    status    OK
mbmayhem_forum.mbmf_pm_recipients    repair    status    OK
mbmayhem_forum.mbmf_polls    repair    status    OK
mbmayhem_forum.mbmf_poll_choices    repair    status    OK
mbmayhem_forum.mbmf_sessions    repair    status    OK
mbmayhem_forum.mbmf_settings    repair    status    OK
mbmayhem_forum.mbmf_smileys    repair    status    OK
mbmayhem_forum.mbmf_themes    repair    status    OK
mbmayhem_forum.mbmf_topics    repair    status    OK
That's my firm opinion.... but what do I know?!

MrPhil

Looking through the SMF topics for "Incorrect key file", I found some suggestions that possibly you're almost out of database space. If your SMF errors log is huge, it might do to reduce it. If you can read the error log via SMF, write down the most common errors before trimming the log size. If you can't get to that point, browse the table (mbmf_log_errors) and note the most common errors in fields message, then truncate (empty) the table. Try doing the repair again (from phpMyAdmin). By the way, if you're satisfied with your last upgrade that produced all the "backup" tables, you can DROP them (assuming there will never be a need to roll back to the earlier version). It would be good to have a backup of them, just in case. That will free up more space, if that's what the problem is.

If it's not your database running out of space, another suggestion I saw is that your MySQL is frequently crashing. Do you see files containing the word "core"? If you see more than one or two old ones, I'd talk to your host about it. Do their dates correspond with when you started having database problems?

After that, the only thing I can think of is to back up just that one table, examine the backup (.sql file) carefully to see if it appears to be complete and valid, DROPping the table, and restoring (importing) the backup to re-create the table and fill it. That could be dangerous, simply because a bad table may produce an invalid backup that can't restore properly, but it may be all you can do. Another choice may be to restore your database from the last good backup. That would keep everything in sync, but you would lose recent activity. Have you added any members since that backup? If not, you could consider restoring that one table.

ModelBoatMayhem

Hi Phil,

Re: Database space.
My forum is total down at the moment, I can't even login as Admin.
I regularly empty out "unimportant logs" in Forum maintenance ... if that's what you mean.
If you're referring to Disk Space, I'm only half full, 10's of Gigs available.

"browse the table (mbmf_log_errors) and note the most common errors in fields message, then truncate (empty) the table." - I'll try that and report back.

"By the way, if you're satisfied with your last upgrade that produced all the "backup" tables, you an DROP them." - do you mean last SMF upgrades / updates? If so yes, I've not done any SMF updates or MODs for weeks/months.

"backup" tables, you can DROP them (assuming there will never be a need to roll back to the earlier version). It would be good to have a backup of them, just in case."- I have now created a back "as is" via myPHPadmin - is that what you mean?

"I saw is that your MySQL is frequently crashing. Do you see files containing the word "core"? If you see more than one or two old ones, I'd talk to your host about it. Do their dates correspond with when you started having database problems?" - Very interesting! Yes I've been having huge problems with my forum recently, mainly "504 timeout" errors. I have been in a constant battle with my host (hostforweb) for months now and rolling up from mySQL 4.1 to 5.1 was meant to help fix the problem but ended up crashing the whole forum! BTW, how did you know that SQL was crashing?


My last backup (all my backups!) are made via 'Forum Maintenance' and from what I'm now reading .... I may be screwed! but hopefully we can find a was of recovering just that one bad table, ie. mbmayhem_forum.mbmf_members.I know quite a bit about model boats... I can strip down and replace your laptop system board in less than an hour but PHP, mySQL, Db's and any programming language are all just 'dark arts!Many thanks again for your help Phil, I am willing to make a contribution for your time in expediting a resolution.
That's my firm opinion.... but what do I know?!

MrPhil

Quote from: ModelBoatMayhem on March 16, 2012, 08:08:20 AM
I regularly empty out "unimportant logs" in Forum maintenance ... if that's what you mean.
Good, but keep an eye on the Errors Log. It can get huge if you neglect it.
Quote
If you're referring to Disk Space, I'm only half full, 10's of Gigs available.
No, I'm referring to a separate thing -- the size of your database (MySQL keeps each of your tables in its own file). Often that size counts towards your overall disk space quota, but that depends on your host's policies. It's possible that their database's file system (shared among all the server's users) has run out of space, even though you're not near your own quota.

Quote
Quote"By the way, if you're satisfied with your last upgrade that produced all the "backup" tables, you an DROP them."
do you mean last SMF upgrades / updates? If so yes, I've not done any SMF updates or MODs for weeks/months.
What I'm saying is that once your satisfied that your latest upgrade or update is stable and working well, and there's little or no chance that you'll want to roll back to the earlier version, you should erase (DROP) those tables so they don't keep taking up space. You should consider making a separate backup of those "backup" tables, and downloading to your PC, just in case.

QuoteI have now created a back "as is" via myPHPadmin - is that what you mean?
If you backed up the "backup" tables (at least), before DROPping them, yes.

QuoteVery interesting! Yes I've been having huge problems with my forum recently, mainly "504 timeout" errors. I have been in a constant battle with my host (hostforweb) for months now and rolling up from mySQL 4.1 to 5.1 was meant to help fix the problem but ended up crashing the whole forum!
Frequent timeouts might be the cause of your problems, especially if they're by the database (leaving the database's data files in an inconsistent state because MySQL stopped running in the middle of a transaction). However, my reading of a "504" timeout leaves me unsure whether the database is involved. Possibly, the database is an innocent bystander that was shut down before it had finished its work, because of loss of contact due to timeout elsewhere.

QuoteBTW, how did you know that SQL was crashing?
I didn't. You misread me. I said that others have suggested this as a cause for corrupted database files.

QuoteMy last backup (all my backups!) are made via 'Forum Maintenance' and from what I'm now reading .... I may be screwed!
Yeah, you should be using phpMyAdmin or MySQL to make backups, not the crummy SMF feature.

Quotebut hopefully we can find a was of recovering just that one bad table, ie. mbmayhem_forum.mbmf_members.
One thing you might try is going into phpMyAdmin and dropping just the index for that one table, and then re-creating the index. Make sure that you understand the index (what field(s), etc. are involved), so you can re-create it the same way.

Advertisement: