Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: serge M on December 19, 2010, 02:02:49 AM

Title: lost 20 thousand posts after a error 127 from table handler
Post by: serge M on December 19, 2010, 02:02:49 AM
SMF 1.1.12 on MySQL4.0

Friends, I am down on my knees.

Had a "Got error 127 from table handler" this morning and no access to my forum at all. so I checked the sql via mysql.

all was fine, but in smf_messages I got the 127 error again so I did run "REPAIR TABLE smf_messages;" and got the following:

Table    Op    Msg_type    Msg_text
db231597796.smf_messages   repair   info   Found block that points outside data file at 22175...
db231597796.smf_messages   repair   info   Found block that points outside data file at 22175...
db231597796.smf_messages   repair   warning   Number of rows changed from 90289 to 59174
db231597796.smf_messages   repair   status   OK

the forum was back up, but I am now missing 20 thousand posts, the last entry is from end of november 2009. I did run
the repair option thru the forum administration and got an enormous amount of mistakes to repair.

What happened? Did I screw something? Magical loss? Or should I consider someone has hacked the database?

Will be happy for any comments, sad day today.

Best greetings, Serge
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: wandawill on December 19, 2010, 07:10:28 AM
try this. I brought back some missing stuff once.

Administration Center

Forum Maintenance - General Maintenance

Recount all forum totals and statistics.
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: MrPhil on December 19, 2010, 01:57:46 PM
Better yet, contact your host and see if they have a very recent database backup that could be restored. Don't delay -- most hosts don't keep nightly backups around for more than a few days. By the way, MySQL 4.0 is quite old -- almost every host is up to MySQL 5.x by now.
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: serge M on December 19, 2010, 03:00:34 PM
thank you a lot for your kind answers. I have already contacted the host this morning, we shall see if there is a possibility
to get a backup, but I dont have much hope, its sunday and they havent answered yet. Have looked thru my backups,
made them regulary thru the admin panel.

actually they seem to be worthless, as they do not contain the messages. I have never paid much attention to them, just
downloaded the gzip-files. while lookem them thru I discovered they have less than 2MB and I cannot find any posts in
them after opening them in a text-editor.

Is it - in your opinion possible that something went wrong with the database or should I consider that somebody has
broken into the server and just deleted?

have a nice evening all, I think I am going to get drunk tonite for this.

serge
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: Deaks on January 07, 2011, 08:50:22 PM
serge-M in future you should always check the backups made by smf, to get proper backups you best doing it in in phpmyadmin itself.

Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: serge M on January 11, 2011, 01:25:56 PM
Runic - thank you a lot for that wise thought: http://www.simplemachines.org/community/index.php?topic=414073.0

Please all be careful with backups thru the admin-panel, I do direct back-ups of the DB right now.

But back to the topic, I will need some help:

I am of course having a hard argument with the host, not only that they did not reply in time to my urgent request of
a back-up (they replied after a week saying "sorry man, its too late now, we keep the back-ups for 2 days) the best
thing is that they claim:

"the server did not respond, so we had to re-setup the server. in such cases, normally no data shall be lost.
no other users of the servers have reported any loss of data. we therefore resume, that your script has
deleted the data in the moment of the server-re-setup
"

great! they presuppose that smf have a script "if german server is re-setup delete 30 percent of the DB"

please please please, this is a question of reputation for all of us. please help me telling them this is bull******.
or could it be? tell me that not!!

thank you all a lot in advance,

serge
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: Deaks on January 11, 2011, 01:34:24 PM
I think you need a new host :)
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: kat on January 11, 2011, 03:16:41 PM
It's never a good idea to rely on your host to make backups.

ALWAYS backup EVERYTHING, yourself.
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: serge M on January 11, 2011, 05:18:40 PM
I did not rely on nobody and i did make backups, regulary. my mistake that I did not check the backups, I still have them,
they are simply worth nothing as I trusted, that the backups I made thru the admin-panel will be proper. they turned
out to be worthless, now that I am richer of such a painful experience, I back up directly from the DB, never again thru
the admin-panel. I am not an informatic and trusted that a system would work.
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: kat on January 11, 2011, 05:32:14 PM
I can feel your pain, man!

Thing is, right from when I first started using SMF, some years ago, I went to backup from Admin and thought "WTF? There's nowhere to restore!".

So, I went to my site's CPanel>Backups and did it from there.

Lesson learnt. ;)

I was lucky, though, I s'pose.

Sadly, you weren't. :(

Maybe it would be best to remove that from Admin, ay?

I'll ask the devs what they think. Might be a plan.
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: serge M on January 11, 2011, 05:37:50 PM
K@ thanks for the warm words.

well either remove it or make it working properly, together with the possibility to re-import the backups. right now it gives
you a wrong feeling of safeness, well at least it gave me for three years I am using SMF.
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: kat on January 11, 2011, 06:10:40 PM
I may be a bit sad. But, I even backup to one drive, then backup, again, to another one!
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: Night09 on January 11, 2011, 06:20:04 PM
Quote from: K@ on January 11, 2011, 06:10:40 PM
I may be a bit sad. But, I even backup to one drive, then backup, again, to another one!

You can never be too carefull with your DB and I also make multiple copies of backups on physically different HDD's ;)
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: kat on January 11, 2011, 06:22:33 PM
I make one to a portable drive and keep it in a different room!
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: serge M on January 11, 2011, 06:49:13 PM
well well well, gentlemen, I am already quite sensitive in that matter and keep a proper eye on my current backups.

I remember, 20 years ago, I was responsible for the backups of the office-unix-system and I stored the tapes in a
fireproof safe. I found that quite strange, but today I understand.

Thank you for your help with the backups, but I would like to come back to my problem:

I need to proove that the hosts statement is improper and not acceptable. Can anyone supply me with proper
arguments, why it is rather unlikely (or better impossible) that SMF would destroy the DB by itself? I do not
agree that a big hosting company (one of the biggest in europe) simply tells us "****** off, we deleted your
database so what, its not our fault". this could happen to anybody, let us see to make sure the hosts do
not treat us like that, we shall not allow them to say "The database was destroyed by a faulty SMF script".

I shall fight for that not happening to others and make tham care about the data we hand them over. 
But I need your help!
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: Night09 on January 11, 2011, 07:14:34 PM
I dont think the host can be made responsible for data loss,its the individuals responsibility to backup any important data deemed wanted. If you are on a hosting plan where you pay for backup with 100% guaranteed daily backups its a different story but if its basic hosting I doubt youll even make first base with it tbh imo.

Id imagine from a hosts point of view it doesnt matter what sites are on the server or how many posts or popular they are when your all paying them the same prices.Maybe some of the members who also host here could clarify what is required or not as a host or the terms of agreement if they are doing backups paid for on your behalf.
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: Illori on January 11, 2011, 07:23:32 PM
this was also posted here http://www.simplemachines.org/community/index.php?topic=416871.0
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: IchBin™ on January 11, 2011, 07:35:18 PM
Are the posts from a single board or multiple boards? There's no way to delete 20K posts in SMF from different boards without doing a lot of work IMO. Not to mention if you have a recycle board, when SMF deletes the topics they would go there first. If you lost the posts, I would look to see if it was posts that were lost consecutively, or if they were random. Meaning, look at the ID in the messages table where you are missing posts. See if the 20K posts are all in consecutive order. If the table was truncated on that day and you are missing those posts that were all posted consecutively, it is likely that your host had the data loss.
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: Night09 on January 11, 2011, 07:38:18 PM
Thanks Illori for the pointer,

Based on both threads maybe a mod could merge them and also its likely the host restored a corrupt backup which your SQL admin fixed as best it could loosing or 'Truncating' the invalid entries. Your only hope was to back it up before running repair for a manual attempt at resolving the issue before running repair on it but unfortunately its past being usefull advice to you.

Ask the host do they have the final restored corrupt version still so someone decent with SQL maybe could recover the data manually via SQL query.
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: serge M on January 11, 2011, 07:41:24 PM
Illori, thank you for the information about reporting this matter as an eventual bug.

nightbre, well this topic is not really about the hosts responsibility although this is an interesting aspect of the hole thing
and I shall be happy about any opinion in this direction. this might be interesting also for others, in case they face similar
problems.

it is not that the host says: the DB is lost, but according to the law/and/or contract this is your problem. the host says:
the DB is lost/corrupted/destroyed and this was caused by a faulty script that you are using

so my question is: could they be right? if so, there would be a bug to be fixed.

I tend to the opinion that they are wrong and use this argument in order to get rid of any kind of responsibility, or
maybe they just dont care. well, as we all are somehow depending on hosts, without them we would not be able
to keep our great forums, we should not allow them to treat us like that. If there is a problem, we need to find the
reason and fix it in order to prevent trouble for the future. If there was a crash of the server, ok, I understand, bad
luck - backups do not work, make other backups in the future or/and fix the admin panel based backup function.

but the host says: we only restarted the server and in the very moment one of the SMF scripts destroyed the
database. so, having no clue about this I ask you: Is this possible? if yes, let us fix it. if no, tell me the reasons
why it is impossible, I tell the host and I have a good point i making them change their politics.

I had bad luck, but why the hell shouldnt this help others in the future to avoid the same problem which could
happen to anybody again?

IchBin thank you for your comment. I am not sure what you mean by single/multiple. have a look at my board:
www.jaguarclubpoland.net/forum
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: serge M on January 11, 2011, 07:50:31 PM
IchBin, sorry for not reading your post in total when I wrote mine.

well, I have a recycle board, but only if you delete thru the forum the posts go there. anything deleted or lost directly in the
DB does not go the recycle board, so this is no help at all. there is no posiibility, that those posts have been deleted from
the forum, they have gone from the DB directly.

Backing up the DB before repair would not help, the data was already lost.

nightbre, thanks for that point. the host keeps old data for 48 hours, nothing is there anymore to be reconstructed. I
asked them immediately, but they responded too late.
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: Adish - (F.L.A.M.E.R) on January 11, 2011, 08:01:49 PM
I could possibly have a look into your website if you want me to. Dunno what I may find out, but you might get lucky... ;)

(I can't have a look at it for at least the following 12 hours unfortunately. Yeeeay! my laptop is coming back tomorrow from some hardcore operation.)
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: serge M on January 11, 2011, 08:06:57 PM
(F.L.A.M.E.R.) thank you a lot, would be most appreciated. www.jaguarclubpoland.net/forum let me know if you need some
more information. keep my fingers crossed for your laptop!
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: Adish - (F.L.A.M.E.R) on January 11, 2011, 08:11:09 PM
I meant the website from inside with the control panel login, admin login for SMF and database login if separately accessed instead through the control panel.

You can PM me the details as they are not safe to be shown publically.
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: serge M on January 11, 2011, 08:17:37 PM
I presupposed that  ;) sent you a PM, thank you a lot for your offer to help.
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: JimM on January 11, 2011, 08:31:30 PM
After doing a bit of research on this here is what I found.  This appears to be a documented bug in MySQL 4.0.  It's reported when there is enough corruption in a table that MySQL is not able to read the data properly.  Some causes were listed as: 1) The mysqld process being killed in the middle of a write 2) The hardware that the database resides on losing power unexpectedly, 3) A hardware error.

From what I could find, repairing the table as you did is what was recommended and some data loss is to be expected when this happens.  It is normally minimal.

You can find more information here on the documented bug >>> http://bugs.mysql.com/bug.php?id=1711

It is your host responsibility to make sure the server software is the most up to date.  In this case they didn't and you have to suffer for it.  Bottom line is you need a new host.
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: serge M on January 11, 2011, 08:57:54 PM
JimM, thank you so much for that. I will look it through, sounds logically but:

it says "Running CHECK TABLE on all involved tables reveals nothing"

in my case, running CHECK TABLE at smf_messages showed the 127 error so it was
obvious for me to repair that one specific table. I keep on reading.

Well, no doubt about to change the host after all that, that was obvious already.

Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: serge M on January 11, 2011, 09:51:09 PM
I did run a query on my sql and it turned that the actual version is:

4.0.27-max-log

so this seems to be a dead road as the bug was fixed in version 4.0.17  :-\

well, anyhow, thank you a lot for your help JimM!
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: Night09 on January 12, 2011, 12:38:59 PM
Quotenightbre, well this topic is not really about the hosts responsibility although this is an interesting aspect of the hole thing
and I shall be happy about any opinion in this direction. this might be interesting also for others, in case they face similar
problems.

Ah sorry, I got the impression from your posts you were looking toward the host side of it so apologies for the confusion. :)
Title: Re: lost 20 thousand posts after a error 127 from table handler
Post by: JimM on January 17, 2011, 08:07:38 PM
OK, sorry you are having this difficulty but there really isn't anything we can do.  I'll go ahead and mark this one as solved so that it doesn't appear in the support queue anymore.  If you have additional information feel free to unmark it.