Posted on: 11/12/07 09:48am
By: kingsley
I have made no changes to my site in several weeks. This morning when I try and log in I get an SQL error and the follwoing appears in my Error Log...
Text Formatted Code
Mon Nov 12 09:23:05 2007 - 2006: MySQL server has gone away. SQL in question: SELECT pi_name FROM gl_plugins WHERE pi_enabled = 1
Any ideas, I did a search and only found one reference from 2004 that was of little help. I am dead in the water until I can fix this so any help would be very appretiated.
The site is...
http://www.nelug.org/[*1]
The home page is fine but I cannot log in.
-Eric
Re: New Error "MySQL server has gone away "
Posted on: 11/12/07 02:26pm
By: Dirk
Your MySQL server crashed or was restarted in the middle of that request. Sounds like it's running again now or you wouldn't even see your homepage. That you can't log in must be due to something else then.
If you see more of those "has gone away" messages in your error.log you should contact your hosting service.
bye, Dirk
Re: New Error "MySQL server has gone away "
Posted on: 11/12/07 02:51pm
By: kingsley
Quote by: DirkYour MySQL server crashed or was restarted in the middle of that request. Sounds like it's running again now or you wouldn't even see your homepage. That you can't log in must be due to something else then.
If you see more of those "has gone away" messages in your error.log you should contact your hosting service.
bye, Dirk
Dirk,
Mark Evans worked tierlessly with me on this. He just found that it was in issue with the BadBehaviour plugin. I think he will be posting the resolution soon as I don't really understand what happened. Basically the issue was slowing down just about every site that used BadBehavior but for some reason it was causing my site to throw errors. Anyway it seems to be resolved now.
Thanks,
-Eric
Re: New Error "MySQL server has gone away "
Posted on: 11/12/07 02:53pm
By: mevans
Eric contacted me and I help debug the issue. It turned out that it didn't have anything to do with MySQL. I'm still not exactly sure how it manifested itself into SQL errors.
Here is what I found:
The site was working fine, it was only when you either tried to login, send an email, post a comments, etc. that it would ultimately die. The common thread was, anytime something generated an HTTP POST, it died.
Eric is running the Bad Behavior2 plugin and it has a feature where on any POST, the IP is run through a series of Internet blacklists. It appears that either dnsbl.ioerror.us is down or was unreachable by Eric's host, so the request was timing out. Actually, it looks like PHP was timing out first and for some reason that manifested itself in a MySQL connection gone away error.
I've seen this happen before where POSTs on my site became very, very slow because of the blacklist checks. Generally it clears up on its own, but you can also disable these checks which immediately corrects the problem.
I ended up editing blackhole.inc.php in the public_html/bad_behavior2/bad-behavior/ directory and commenting the blacklist sites, the problem immediately whent away. Uncomment them, the problem immediately reappeared.
I still don't understand why it manifested into a MySQL error, but it sure did speed things up and solve the problem whent he checks were disabled.
I notice that my posts here are also very, very slow, might be worth a try here to see if it speeds things up a bit.
Thanks!
Mark
Re: New Error "MySQL server has gone away "
Posted on: 11/12/07 03:12pm
By: Dirk
Quote by: mevansI notice that my posts here are also very, very slow, might be worth a try here to see if it speeds things up a bit.
Good catch! I was wondering myself why the site was so slow as I couldn't see anything out of the ordinary in the logfiles.
I've disabled the ioerror.us blacklist now - hope it helps. Thanks!
bye, Dirk
P.S. And no, I don't understand either how all that could make the MySQL server die ...
Re: New Error "MySQL server has gone away "
Posted on: 11/12/07 03:16pm
By: kingsley
Quick update.
I had 2 other sites with this problem that I have now resolved with the same fix. I have 3 other sites hosted at a different host that where not failing but where seeing significant performance issues. This has also made those sites run faster.
-Eric
Re: New Error "MySQL server has gone away "
Posted on: 11/12/07 03:23pm
By: mevans
Well, let's see if that sped up the posting here....
Thanks!
Mark
Edit
Oh yea, much, much faster!