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.

Upgrading SilverStripe /

Ask questions about upgrading SilverStripe to the latest version.

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

Internal server error happening every 4 hrs


Go to End


3 Posts   2198 Views

Avatar
stumck

Community Member, 9 Posts

25 November 2016 at 3:49pm

Hi there I need some help on an issue we have been having since we upgrading from silverstripe 3.1 to 3.4. We also changed hosting companies to siteground.
We are getting an internal server error every 4 hours for about 3 minutes. About 80% of our web page will display an internal server error. After 3 minutes everything will come right again. The timing is exactly at 1:00pm 5:00pm 9:00pm 1:00am and 5:00am.
I enabled silverstripe logging on monday
In the log,
The error that occur is

[24-Nov-2016 02:03:10] Error at framework/model/connect/DBConnector.php line 55: Uncaught SS_DatabaseException: Couldn't run query:

SELECT DISTINCT "SiteTree_Live"."ClassName", "SiteTree_Live"."LastEdited", "SiteTree_Live"."Created", "SiteTree_Live"."URLSegment", "SiteTree_Live"."Title", "SiteTree_Live"."MenuTitle", "SiteTree_Live"."Content", "SiteTree_Live"."MetaDescription", "SiteTree_Live"."ExtraMeta", "SiteTree_Live"."ShowInMenus", "SiteTree_Live"."ShowInSearch", "SiteTree_Live"."Sort", "SiteTree_Live"."HasBrokenFile", "SiteTree_Live"."HasBrokenLink", "SiteTree_Live"."ReportClass", "SiteTree_Live"."CanViewType", "SiteTree_Live"."CanEditType", "SiteTree_Live"."HideOnSitemap", "SiteTree_Live"."Version", "SiteTree_Live"."ParentID", "SiteTree_Live"."ID",
CASE WHEN "SiteTree_Live"."ClassName" IS NOT NULL THEN "SiteTree_Live"."ClassName"
ELSE 'SiteTree' END AS "RecordClassName"

FROM "SiteTree_Live"

WHERE ("SiteTree_Live"."URLSegment" = ?)
AND ("SiteTree_Live"."ParentID" = ?)

ORDER BY "SiteTree_Live"."Sort" ASC

LIMIT 1

Prepared statement needs to be re-prepared (http://www.pertronic.com.au/news/)

[24-Nov-2016 02:03:24] Error at framework/model/connect/DBConnector.php line 55: Uncaught SS_DatabaseException: Couldn't run query:

SELECT DISTINCT "SiteTree_Live"."ClassName", "SiteTree_Live"."LastEdited", "SiteTree_Live"."Created", "SiteTree_Live"."URLSegment", "SiteTree_Live"."Title", "SiteTree_Live"."MenuTitle", "SiteTree_Live"."Content", "SiteTree_Live"."MetaDescription", "SiteTree_Live"."ExtraMeta", "SiteTree_Live"."ShowInMenus", "SiteTree_Live"."ShowInSearch", "SiteTree_Live"."Sort", "SiteTree_Live"."HasBrokenFile", "SiteTree_Live"."HasBrokenLink", "SiteTree_Live"."ReportClass", "SiteTree_Live"."CanViewType", "SiteTree_Live"."CanEditType", "SiteTree_Live"."HideOnSitemap", "SiteTree_Live"."Version", "SiteTree_Live"."ParentID", "SiteTree_Live"."ID",
CASE WHEN "SiteTree_Live"."ClassName" IS NOT NULL THEN "SiteTree_Live"."ClassName"
ELSE 'SiteTree' END AS "RecordClassName"

FROM "SiteTree_Live"

WHERE ("SiteTree_Live"."URLSegment" = ?)
AND ("SiteTree_Live"."ParentID" = ?)

ORDER BY "SiteTree_Live"."Sort" ASC

LIMIT 1

Prepared statement needs to be re-prepared (http://pertronic.com.au/resources/online-tools/)

Has anyone come accross this error before?

I have done a bit if searching on google and wondered if this is a MYSQL bug
and happens during auto back of the database. Which would explain why our site goes down exactly at the precise times above .

Any help would be greatly appreciated.

Stu

Avatar
martimiz

Forum Moderator, 1391 Posts

9 December 2016 at 3:30am

Looks like a lot of people have ran into this at some point - I see a lot of comments referring to mysqldump being in progress so you may be right. It shouldn't be a SilverStripe upgrade problem, I think.

You could try temporary downgrading back to 3.2 to see if it's maybe a difference in how MySQL queries are executed in 3.5, but I doubt that...

Avatar
stumck

Community Member, 9 Posts

9 December 2016 at 8:45am

We have sorted the issue out now.
I switched from MySQLi to PDO by updating the mysite/_config.php file.
This stop the errors.
Info about the issue in the link below

http://bugs.mysql.com/bug.php?id=42041

Stu