Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

MySQL server has gone away - Versioned::get_versionnumber_by_stage()


Go to End


2 Posts   1200 Views

Avatar
HARVS1789UK

Community Member, 31 Posts

8 August 2014 at 9:00pm

Edited: 08/08/2014 9:01pm

I have an error which would suggest that one the MySQL connection has been closed due to one of its timeouts being hit (i.e. connect_timeout or wait_timeout) or potentially an SQL query being attempted after the connection has been closed?

MySQL Explanation of Error: http://dev.mysql.com/doc/refman/5.0/en/gone-away.html

My first thought was that this must be infrastructure, MySQL config and/or traffic level based (i.e. maybe when I have high traffic levels this query fails due to a > 15 second connection tome, which my connect_timeout is set to) however of the 100+ error log entires I have relating to this ALL but 1 of them are either:

- Couldn't run query: SELECT "Version" FROM "SiteTree_Live" WHERE "ID" = -1 MySQL server has gone away
- Couldn't run query: SHOW TABLES; MySQL server has gone away

Surly if this were a high traffic/low timeout issue, I would be seeing this error for a whole host of queries made during peak traffic times. So this suggests to me potentially some issue with the core code where both of these MySQL queries are called? Perhaps the MySQL connection is closed before they are made under some circumstance?

I have identified that the first f these queries is made via Versioned::get_versionnumber_by_stage() and have also noticed that in my case this method should really even be called on the page type which is throwing the error (see bug report below). I am yet to identify why the 'SHOW TABLES' query is being called although I can see it is triggered by a call to ClassInfo::hasTable().

Framework Issue Report: https://github.com/silverstripe/silverstripe-framework/issues/3371

In the 3 months or so this clients website has been live I have received over 100 error log entries referencing "MySQL server has gone away" and as mentioned above basically all of them relate to these 2 queries which are made by the core code. Does anyone have any ideas or suggestions as to why this might be and how I can resolve them?

Kind regards,

HARVS1789UK

Avatar
HARVS1789UK

Community Member, 31 Posts

4 September 2014 at 8:31pm

Bump!