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.

General Questions

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

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

[User Error] Couldn't run query: SELECT


Reply

2 Posts   542 Views

Avatar
Iano

6 January 2012 at 2:43am Community Member, 1 Post

Im fairly new to silverstripe I have a site that I have took over management off, it has been running ok. The client has done some content changes and now every page on the site has Internal Server Error and I cant login to admin I have run an error report and this is what I got below. I have tried to dev/build to rebuild the db and this just comes with an error as well any help would be much appreciated thanks Ian

[User Error] Couldn't run query: SELECT "SiteTree_Live"."ClassName", "SiteTree_Live"."Created", "SiteTree_Live"."LastEdited", "SiteTree_Live"."URLSegment", "SiteTree_Live"."Title", "SiteTree_Live"."MenuTitle", "SiteTree_Live"."Content", "SiteTree_Live"."MetaTitle", "SiteTree_Live"."MetaDescription", "SiteTree_Live"."MetaKeywords", "SiteTree_Live"."ExtraMeta", "SiteTree_Live"."ShowInMenus", "SiteTree_Live"."ShowInSearch", "SiteTree_Live"."HomepageForDomain", "SiteTree_Live"."ProvideComments", "SiteTree_Live"."Sort", "SiteTree_Live"."HasBrokenFile", "SiteTree_Live"."HasBrokenLink", "SiteTree_Live"."Status", "SiteTree_Live"."ReportClass", "SiteTree_Live"."CanViewType", "SiteTree_Live"."CanEditType", "SiteTree_Live"."ToDo", "SiteTree_Live"."Version", "SiteTree_Live"."Priority", "SiteTree_Live"."ParentID", "Page_Live"."picAtBottom", "Page_Live"."RequireLogin", "Page_Live"."WidgetsBarID", "EventPage_Live"."Location", "EventPage_Live"."StartDate", "EventPage_Live"."EndDate", CASE WHEN "SiteTree_Live"."ClassName" IN ('EventsSection') THEN "EventsSection_Live"."FeedRedirection" WHEN "SiteTree_Live"."ClassName" IN ('NewsSection') THEN "NewsSection_Live"."FeedRedirection" ELSE NULL END AS "FeedRedirection", "Library_Live"."ShowMembershipSpecificDocuments", "MemberPage_Live"."MembershipTypeID", "ErrorPage_Live"."ErrorCode", "RedirectorPage_Live"."RedirectionType", "RedirectorPage_Live"."ExternalURL", "RedirectorPage_Live"."LinkToID", "VirtualPage_Live"."VersionID", "VirtualPage_Live"."CopyContentFromID", "SiteTree_Live"."ID", CASE WHEN "SiteTree_Live"."ClassName" IS NOT NULL THEN "SiteTree_Live"."ClassName" ELSE 'SiteTree' END AS "RecordClassName" FROM "SiteTree_Live" LEFT JOIN "Page_Live" ON "Page_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "EventPage_Live" ON "EventPage_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "EventsSection_Live" ON "EventsSection_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "NewsSection_Live" ON "NewsSection_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "Library_Live" ON "Library_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "MemberPage_Live" ON "MemberPage_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "ErrorPage_Live" ON "ErrorPage_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "RedirectorPage_Live" ON "RedirectorPage_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "VirtualPage_Live" ON "VirtualPage_Live"."ID" = "SiteTree_Live"."ID" WHERE ("ShowInMenus" = 1 AND "ParentID" = 0) ORDER BY "Sort" Table './abpcoor_ssabpcocms/SiteTree_Live' is marked as crashed and should be repaired
GET /Security/login?BackURL=%2Fadmin%2Fdev%2Fbuild%3Fflush%3D1
Line 536 in /home/abpcoor/public_html/sapphire/core/model/MySQLDatabase.php
Source
527 }
528
529 function databaseError($msg, $errorLevel = E_USER_ERROR) {
530 // try to extract and format query
531 if(preg_match('/Couldn\'t run query: ([^\|]*)\|\s*(.*)/', $msg, $matches)) {
532 $formatter = new SQLFormatter();
533 $msg = "Couldn't run query: \n" . $formatter->formatPlain($matches[1]) . "\n\n" . $matches[2];
534 }
535
536 user_error($msg, $errorLevel);
537 }
538
539 /**
540 * Return a boolean type-formatted string
541 *
542 * @param array $values Contains a tokenised list of info about this data type
Trace
Couldn't run query: SELECT "SiteTree_Live"."ClassName", "SiteTree_Live"."Created", "SiteTree_Live"."LastEdited", "SiteTree_Live"."URLSegment", "SiteTree_Live"."Title", "SiteTree_Live"."MenuTitle", "SiteTree_Live"."Content", "SiteTree_Live"."MetaTitle", "SiteTree_Live"."MetaDescription", "SiteTree_Live"."MetaKeywords", "SiteTree_Live"."ExtraMeta", "SiteTree_Live"."ShowInMenus", "SiteTree_Live"."ShowInSearch", "SiteTree_Live"."HomepageForDomain", "SiteTree_Live"."ProvideComments", "SiteTree_Live"."Sort", "SiteTree_Live"."HasBrokenFile", "SiteTree_Live"."HasBrokenLink", "SiteTree_Live"."Status", "SiteTree_Live"."ReportClass", "SiteTree_Live"."CanViewType", "SiteTree_Live"."CanEditType", "SiteTree_Live"."ToDo", "SiteTree_Live"."Version", "SiteTree_Live"."Priority", "SiteTree_Live"."ParentID", "Page_Live"."picAtBottom", "Page_Live"."RequireLogin", "Page_Live"."WidgetsBarID", "EventPage_Live"."Location", "EventPage_Live"."StartDate", "EventPage_Live"."EndDate", CASE WHEN "SiteTree_Live"."ClassName" IN ('EventsSection') THEN "EventsSection_Live"."FeedRedirection" WHEN "SiteTree_Live"."ClassName" IN ('NewsSection') THEN "NewsSection_Live"."FeedRedirection" ELSE NULL END AS "FeedRedirection", "Library_Live"."ShowMembershipSpecificDocuments", "MemberPage_Live"."MembershipTypeID", "ErrorPage_Live"."ErrorCode", "RedirectorPage_Live"."RedirectionType", "RedirectorPage_Live"."ExternalURL", "RedirectorPage_Live"."LinkToID", "VirtualPage_Live"."VersionID", "VirtualPage_Live"."CopyContentFromID", "SiteTree_Live"."ID", CASE WHEN "SiteTree_Live"."ClassName" IS NOT NULL THEN "SiteTree_Live"."ClassName" ELSE 'SiteTree' END AS "RecordClassName" FROM "SiteTree_Live" LEFT JOIN "Page_Live" ON "Page_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "EventPage_Live" ON "EventPage_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "EventsSection_Live" ON "EventsSection_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "NewsSection_Live" ON "NewsSection_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "Library_Live" ON "Library_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "MemberPage_Live" ON "MemberPage_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "ErrorPage_Live" ON "ErrorPage_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "RedirectorPage_Live" ON "RedirectorPage_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "VirtualPage_Live" ON "VirtualPage_Live"."ID" = "SiteTree_Live"."ID" WHERE ("ShowInMenus" = 1 AND "ParentID" = 0) ORDER BY "Sort" Table './abpcoor_ssabpcocms/SiteTree_Live' is marked as crashed and should be repaired
Line 536 of MySQLDatabase.php
MySQLDatabase->databaseError(Couldn't run query: SELECT "SiteTree_Live"."ClassName", "SiteTree_Live"."Created", "SiteTree_Live"."LastEdited", "SiteTree_Live"."URLSegment", "SiteTree_Live"."Title", "SiteTree_Live"."MenuTitle", "SiteTree_Live"."Content", "SiteTree_Live"."MetaTitle", "SiteTree_Live"."MetaDescription", "SiteTree_Live"."MetaKeywords", "SiteTree_Live"."ExtraMeta", "SiteTree_Live"."ShowInMenus", "SiteTree_Live"."ShowInSearch", "SiteTree_Live"."HomepageForDomain", "SiteTree_Live"."ProvideComments", "SiteTree_Live"."Sort", "SiteTree_Live"."HasBrokenFile", "SiteTree_Live"."HasBrokenLink", "SiteTree_Live"."Status", "SiteTree_Live"."ReportClass", "SiteTree_Live"."CanViewType", "SiteTree_Live"."CanEditType", "SiteTree_Live"."ToDo", "SiteTree_Live"."Version", "SiteTree_Live"."Priority", "SiteTree_Live"."ParentID", "Page_Live"."picAtBottom", "Page_Live"."RequireLogin", "Page_Live"."WidgetsBarID", "EventPage_Live"."Location", "EventPage_Live"."StartDate", "EventPage_Live"."EndDate", CASE WHEN "SiteTree_Live"."ClassName" IN ('EventsSection') THEN "EventsSection_Live"."FeedRedirection" WHEN "SiteTree_Live"."ClassName" IN ('NewsSection') THEN "NewsSection_Live"."FeedRedirection" ELSE NULL END AS "FeedRedirection", "Library_Live"."ShowMembershipSpecificDocuments", "MemberPage_Live"."MembershipTypeID", "ErrorPage_Live"."ErrorCode", "RedirectorPage_Live"."RedirectionType", "RedirectorPage_Live"."ExternalURL", "RedirectorPage_Live"."LinkToID", "VirtualPage_Live"."VersionID", "VirtualPage_Live"."CopyContentFromID", "SiteTree_Live"."ID", CASE WHEN "SiteTree_Live"."ClassName" IS NOT NULL THEN "SiteTree_Live"."ClassName" ELSE 'SiteTree' END AS "RecordClassName" FROM "SiteTree_Live" LEFT JOIN "Page_Live" ON "Page_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "EventPage_Live" ON "EventPage_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "EventsSection_Live" ON "EventsSection_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "NewsSection_Live" ON "NewsSection_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "Library_Live" ON "Library_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "MemberPage_Live" ON "MemberPage_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "ErrorPage_Live" ON "ErrorPage_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "RedirectorPage_Live" ON "RedirectorPage_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "VirtualPage_Live" ON "VirtualPage_Live"."ID" = "SiteTree_Live"."ID" WHERE ("ShowInMenus" = 1 AND "ParentID" = 0) ORDER BY "Sort" | Table './abpcoor_ssabpcocms/SiteTree_Live' is marked as crashed and should be repaired,256)
Line 134 of MySQLDatabase.php
MySQLDatabase->query(SELECT "SiteTree_Live"."ClassName", "SiteTree_Live"."Created", "SiteTree_Live"."LastEdited", "SiteTree_Live"."URLSegment", "SiteTree_Live"."Title", "SiteTree_Live"."MenuTitle", "SiteTree_Live"."Content", "SiteTree_Live"."MetaTitle", "SiteTree_Live"."MetaDescription", "SiteTree_Live"."MetaKeywords", "SiteTree_Live"."ExtraMeta", "SiteTree_Live"."ShowInMenus", "SiteTree_Live"."ShowInSearch", "SiteTree_Live"."HomepageForDomain", "SiteTree_Live"."ProvideComments", "SiteTree_Live"."Sort", "SiteTree_Live"."HasBrokenFile", "SiteTree_Live"."HasBrokenLink", "SiteTree_Live"."Status", "SiteTree_Live"."ReportClass", "SiteTree_Live"."CanViewType", "SiteTree_Live"."CanEditType", "SiteTree_Live"."ToDo", "SiteTree_Live"."Version", "SiteTree_Live"."Priority", "SiteTree_Live"."ParentID", "Page_Live"."picAtBottom", "Page_Live"."RequireLogin", "Page_Live"."WidgetsBarID", "EventPage_Live"."Location", "EventPage_Live"."StartDate", "EventPage_Live"."EndDate", CASE WHEN "SiteTree_Live"."ClassName" IN ('EventsSection') THEN "EventsSection_Live"."FeedRedirection" WHEN "SiteTree_Live"."ClassName" IN ('NewsSection') THEN "NewsSection_Live"."FeedRedirection" ELSE NULL END AS "FeedRedirection", "Library_Live"."ShowMembershipSpecificDocuments", "MemberPage_Live"."MembershipTypeID", "ErrorPage_Live"."ErrorCode", "RedirectorPage_Live"."RedirectionType", "RedirectorPage_Live"."ExternalURL", "RedirectorPage_Live"."LinkToID", "VirtualPage_Live"."VersionID", "VirtualPage_Live"."CopyContentFromID", "SiteTree_Live"."ID", CASE WHEN "SiteTree_Live"."ClassName" IS NOT NULL THEN "SiteTree_Live"."ClassName" ELSE 'SiteTree' END AS "RecordClassName" FROM "SiteTree_Live" LEFT JOIN "Page_Live" ON "Page_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "EventPage_Live" ON "EventPage_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "EventsSection_Live" ON "EventsSection_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "NewsSection_Live" ON "NewsSection_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "Library_Live" ON "Library_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "MemberPage_Live" ON "MemberPage_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "ErrorPage_Live" ON "ErrorPage_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "RedirectorPage_Live" ON "RedirectorPage_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "VirtualPage_Live" ON "VirtualPage_Live"."ID" = "SiteTree_Live"."ID" WHERE ("ShowInMenus" = 1 AND "ParentID" = 0) ORDER BY "Sort",256)
Line 126 of DB.php
DB::query(SELECT "SiteTree_Live"."ClassName", "SiteTree_Live"."Created", "SiteTree_Live"."LastEdited", "SiteTree_Live"."URLSegment", "SiteTree_Live"."Title", "SiteTree_Live"."MenuTitle", "SiteTree_Live"."Content", "SiteTree_Live"."MetaTitle", "SiteTree_Live"."MetaDescription", "SiteTree_Live"."MetaKeywords", "SiteTree_Live"."ExtraMeta", "SiteTree_Live"."ShowInMenus", "SiteTree_Live"."ShowInSearch", "SiteTree_Live"."HomepageForDomain", "SiteTree_Live"."ProvideComments", "SiteTree_Live"."Sort", "SiteTree_Live"."HasBrokenFile", "SiteTree_Live"."HasBrokenLink", "SiteTree_Live"."Status", "SiteTree_Live"."ReportClass", "SiteTree_Live"."CanViewType", "SiteTree_Live"."CanEditType", "SiteTree_Live"."ToDo", "SiteTree_Live"."Version", "SiteTree_Live"."Priority", "SiteTree_Live"."ParentID", "Page_Live"."picAtBottom", "Page_Live"."RequireLogin", "Page_Live"."WidgetsBarID", "EventPage_Live"."Location", "EventPage_Live"."StartDate", "EventPage_Live"."EndDate", CASE WHEN "SiteTree_Live"."ClassName" IN ('EventsSection') THEN "EventsSection_Live"."FeedRedirection" WHEN "SiteTree_Live"."ClassName" IN ('NewsSection') THEN "NewsSection_Live"."FeedRedirection" ELSE NULL END AS "FeedRedirection", "Library_Live"."ShowMembershipSpecificDocuments", "MemberPage_Live"."MembershipTypeID", "ErrorPage_Live"."ErrorCode", "RedirectorPage_Live"."RedirectionType", "RedirectorPage_Live"."ExternalURL", "RedirectorPage_Live"."LinkToID", "VirtualPage_Live"."VersionID", "VirtualPage_Live"."CopyContentFromID", "SiteTree_Live"."ID", CASE WHEN "SiteTree_Live"."ClassName" IS NOT NULL THEN "SiteTree_Live"."ClassName" ELSE 'SiteTree' END AS "RecordClassName" FROM "SiteTree_Live" LEFT JOIN "Page_Live" ON "Page_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "EventPage_Live" ON "EventPage_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "EventsSection_Live" ON "EventsSection_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "NewsSection_Live" ON "NewsSection_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "Library_Live" ON "Library_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "MemberPage_Live" ON "MemberPage_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "ErrorPage_Live" ON "ErrorPage_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "RedirectorPage_Live" ON "RedirectorPage_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "VirtualPage_Live" ON "VirtualPage_Live"."ID" = "SiteTree_Live"."ID" WHERE ("ShowInMenus" = 1 AND "ParentID" = 0) ORDER BY "Sort",256)
Line 386 of SQLQuery.php
SQLQuery->execute()
Line 2679 of DataObject.php
DataObject->instance_get("ShowInMenus" = 1 AND "ParentID" = 0,,,,DataObjectSet)
Line 2657 of DataObject.php
DataObject::get(SiteTree,"ShowInMenus" = 1 AND "ParentID" = 0)
Line 288 of ContentController.php
ContentController->getMenu(1)
Line 319 of ContentController.php
ContentController->Menu(1)
call_user_func_array(Array,Array)
Line 369 of ViewableData.php
ViewableData->obj(Menu,Array,1,,)
Line 826 of ViewableData.php
ViewableData_Customised->obj(Menu,Array,1,,)
Line 826 of ViewableData.php
ViewableData_Customised->obj(Menu,Array)
Line 237 of .cache.home.abpcoor.public_html.themes.abpco.templates.Page.ss
include(/tmp/silverstripe-cache-home-abpcoor-public_html/.cache.home.abpcoor.public_html.themes.abpco.templates.Page.ss)
Line 392 of SSViewer.php
SSViewer->process(ViewableData_Customised)
Line 342 of ViewableData.php
ViewableData->renderWith(Array)
Line 394 of Security.php
Security->login(SS_HTTPRequest)
Line 193 of Controller.php
Controller->handleAction(SS_HTTPRequest)
Line 134 of RequestHandler.php
RequestHandler->handleRequest(SS_HTTPRequest)
Line 147 of Controller.php
Controller->handleRequest(SS_HTTPRequest)
Line 283 of Director.php
Director::handleRequest(SS_HTTPRequest,Session)
Line 127 of Director.php
Director::direct(/Security/login)
Line 127 of main.php

Avatar
swaiba

6 January 2012 at 5:42am Forum Moderator, 1796 Posts

'./abpcoor_ssabpcocms/SiteTree_Live' is marked as crashed and should be repaired
this literally means what it says, there is a repair option within phpmyadmin
or you can call your host and they should help you "repair" the table