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