[Solved] Need assistance with a bug SilverStripe 3.4.1 PHP5.6

bugs
Tags: #<Tag:0x00007f0827e07cd0>

#1

Silverstripe Version:
SilverStripe 3.4.1
PHP: 5.6
Mysql:5.5

Question:
Navigation through the website was causing errors
What is causing the framework to crash ?

[User Error] Uncaught SS_DatabaseException: Couldn't run query: SELECT DISTINCT "SiteConfig"."ClassName", "SiteConfig"."LastEdited", "SiteConfig"."Created", "SiteConfig"."Title", "SiteConfig"."Tagline", "SiteConfig"."Theme", "SiteConfig"."CanViewType", "SiteConfig"."CanEditType", "SiteConfig"."CanCreateTopLevelType", "SiteConfig"."Place", "SiteConfig"."Street", "SiteConfig"."Number", "SiteConfig"."Zip", "SiteConfig"."City", "SiteConfig"."Latitude", "SiteConfig"."Longitude", "SiteConfig"."Email", "SiteConfig"."Facebook", "SiteConfig"."Person1", "SiteConfig"."Phone1", "SiteConfig"."Person2", "SiteConfig"."Phone2", "SiteConfig"."ID", CASE WHEN "SiteConfig"."ClassName" IS NOT NULL THEN "SiteConfig"."ClassName" ELSE 'SiteConfig' END AS "RecordClassName" FROM "SiteConfig" LIMIT 1 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '."ClassName", "SiteConfig"."LastEdited", "SiteConfig"."Created", "SiteConfig"."T' at line 1
GET /home/a-propos/
Line 55 in /home/pixelsetoz/www/framework/model/connect/DBConnector.php

Source
46 		if (!empty($sql)) {
47 			$formatter = new SQLFormatter();
48 			$formattedSQL = $formatter->formatPlain($sql);
49 			$msg = "Couldn't run query:\n\n{$formattedSQL}\n\n{$msg}";
50 		}
51 
52 		if($errorLevel === E_USER_ERROR) {
53 			// Treating errors as exceptions better allows for responding to errors
54 			// in code, such as credential checking during installation
55 			throw new SS_DatabaseException($msg, 0, null, $sql, $parameters);
56 		} else {
57 			user_error($msg, $errorLevel);
58 		}
59 	}
60 
61 	/**
Trace
DBConnector->databaseError(You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '."ClassName", "SiteConfig"."LastEdited", "SiteConfig"."Created", "SiteConfig"."T' at line 1,256,SELECT DISTINCT "SiteConfig"."ClassName", "SiteConfig"."LastEdited", "SiteConfig"."Created", "SiteConfig"."Title", "SiteConfig"."Tagline", "SiteConfig"."Theme", "SiteConfig"."CanViewType", "SiteConfig"."CanEditType", "SiteConfig"."CanCreateTopLevelType", "SiteConfig"."Place", "SiteConfig"."Street", "SiteConfig"."Number", "SiteConfig"."Zip", "SiteConfig"."City", "SiteConfig"."Latitude", "SiteConfig"."Longitude", "SiteConfig"."Email", "SiteConfig"."Facebook", "SiteConfig"."Person1", "SiteConfig"."Phone1", "SiteConfig"."Person2", "SiteConfig"."Phone2", "SiteConfig"."ID", CASE WHEN "SiteConfig"."ClassName" IS NOT NULL THEN "SiteConfig"."ClassName" ELSE 'SiteConfig' END AS "RecordClassName" FROM "SiteConfig" LIMIT 1) 
MySQLiConnector.php:135
MySQLiConnector->query(SELECT DISTINCT "SiteConfig"."ClassName", "SiteConfig"."LastEdited", "SiteConfig"."Created", "SiteConfig"."Title", "SiteConfig"."Tagline", "SiteConfig"."Theme", "SiteConfig"."CanViewType", "SiteConfig"."CanEditType", "SiteConfig"."CanCreateTopLevelType", "SiteConfig"."Place", "SiteConfig"."Street", "SiteConfig"."Number", "SiteConfig"."Zip", "SiteConfig"."City", "SiteConfig"."Latitude", "SiteConfig"."Longitude", "SiteConfig"."Email", "SiteConfig"."Facebook", "SiteConfig"."Person1", "SiteConfig"."Phone1", "SiteConfig"."Person2", "SiteConfig"."Phone2", "SiteConfig"."ID", CASE WHEN "SiteConfig"."ClassName" IS NOT NULL THEN "SiteConfig"."ClassName" ELSE 'SiteConfig' END AS "RecordClassName" FROM "SiteConfig" LIMIT 1,256) 
MySQLiConnector.php:223
MySQLiConnector->preparedQuery(SELECT DISTINCT "SiteConfig"."ClassName", "SiteConfig"."LastEdited", "SiteConfig"."Created", "SiteConfig"."Title", "SiteConfig"."Tagline", "SiteConfig"."Theme", "SiteConfig"."CanViewType", "SiteConfig"."CanEditType", "SiteConfig"."CanCreateTopLevelType", "SiteConfig"."Place", "SiteConfig"."Street", "SiteConfig"."Number", "SiteConfig"."Zip", "SiteConfig"."City", "SiteConfig"."Latitude", "SiteConfig"."Longitude", "SiteConfig"."Email", "SiteConfig"."Facebook", "SiteConfig"."Person1", "SiteConfig"."Phone1", "SiteConfig"."Person2", "SiteConfig"."Phone2", "SiteConfig"."ID", CASE WHEN "SiteConfig"."ClassName" IS NOT NULL THEN "SiteConfig"."ClassName" ELSE 'SiteConfig' END AS "RecordClassName" FROM "SiteConfig" LIMIT 1,Array,256) 
Database.php:134
SS_Database->{closure}(SELECT DISTINCT "SiteConfig"."ClassName", "SiteConfig"."LastEdited", "SiteConfig"."Created", "SiteConfig"."Title", "SiteConfig"."Tagline", "SiteConfig"."Theme", "SiteConfig"."CanViewType", "SiteConfig"."CanEditType", "SiteConfig"."CanCreateTopLevelType", "SiteConfig"."Place", "SiteConfig"."Street", "SiteConfig"."Number", "SiteConfig"."Zip", "SiteConfig"."City", "SiteConfig"."Latitude", "SiteConfig"."Longitude", "SiteConfig"."Email", "SiteConfig"."Facebook", "SiteConfig"."Person1", "SiteConfig"."Phone1", "SiteConfig"."Person2", "SiteConfig"."Phone2", "SiteConfig"."ID", CASE WHEN "SiteConfig"."ClassName" IS NOT NULL THEN "SiteConfig"."ClassName" ELSE 'SiteConfig' END AS "RecordClassName" FROM "SiteConfig" LIMIT 1) 
Database.php:178
SS_Database->benchmarkQuery(SELECT DISTINCT "SiteConfig"."ClassName", "SiteConfig"."LastEdited", "SiteConfig"."Created", "SiteConfig"."Title", "SiteConfig"."Tagline", "SiteConfig"."Theme", "SiteConfig"."CanViewType", "SiteConfig"."CanEditType", "SiteConfig"."CanCreateTopLevelType", "SiteConfig"."Place", "SiteConfig"."Street", "SiteConfig"."Number", "SiteConfig"."Zip", "SiteConfig"."City", "SiteConfig"."Latitude", "SiteConfig"."Longitude", "SiteConfig"."Email", "SiteConfig"."Facebook", "SiteConfig"."Person1", "SiteConfig"."Phone1", "SiteConfig"."Person2", "SiteConfig"."Phone2", "SiteConfig"."ID", CASE WHEN "SiteConfig"."ClassName" IS NOT NULL THEN "SiteConfig"."ClassName" ELSE 'SiteConfig' END AS "RecordClassName" FROM "SiteConfig" LIMIT 1,Closure) 
Database.php:136
SS_Database->preparedQuery(SELECT DISTINCT "SiteConfig"."ClassName", "SiteConfig"."LastEdited", "SiteConfig"."Created", "SiteConfig"."Title", "SiteConfig"."Tagline", "SiteConfig"."Theme", "SiteConfig"."CanViewType", "SiteConfig"."CanEditType", "SiteConfig"."CanCreateTopLevelType", "SiteConfig"."Place", "SiteConfig"."Street", "SiteConfig"."Number", "SiteConfig"."Zip", "SiteConfig"."City", "SiteConfig"."Latitude", "SiteConfig"."Longitude", "SiteConfig"."Email", "SiteConfig"."Facebook", "SiteConfig"."Person1", "SiteConfig"."Phone1", "SiteConfig"."Person2", "SiteConfig"."Phone2", "SiteConfig"."ID", CASE WHEN "SiteConfig"."ClassName" IS NOT NULL THEN "SiteConfig"."ClassName" ELSE 'SiteConfig' END AS "RecordClassName" FROM "SiteConfig" LIMIT 1,Array,256) 
DB.php:311
DB::prepared_query(SELECT DISTINCT "SiteConfig"."ClassName", "SiteConfig"."LastEdited", "SiteConfig"."Created", "SiteConfig"."Title", "SiteConfig"."Tagline", "SiteConfig"."Theme", "SiteConfig"."CanViewType", "SiteConfig"."CanEditType", "SiteConfig"."CanCreateTopLevelType", "SiteConfig"."Place", "SiteConfig"."Street", "SiteConfig"."Number", "SiteConfig"."Zip", "SiteConfig"."City", "SiteConfig"."Latitude", "SiteConfig"."Longitude", "SiteConfig"."Email", "SiteConfig"."Facebook", "SiteConfig"."Person1", "SiteConfig"."Phone1", "SiteConfig"."Person2", "SiteConfig"."Phone2", "SiteConfig"."ID", CASE WHEN "SiteConfig"."ClassName" IS NOT NULL THEN "SiteConfig"."ClassName" ELSE 'SiteConfig' END AS "RecordClassName" FROM "SiteConfig" LIMIT 1,Array) 
SQLExpression.php:121
SQLExpression->execute() 
DataList.php:807
DataList->first() 
DataObject.php:3236
DataObject::get_one(SiteConfig) 
SiteConfig.php:213
SiteConfig::current_site_config() 
SiteTree.php:1119
SiteTree->getSiteConfig() 
SiteTree.php:924
SiteTree->canView(0) 
SiteTree.php:923
SiteTree->canView() 
ContentController.php:111
ContentController->init() 
Page.php:31
Page_Controller->init() 
Controller.php:143
Controller->handleRequest(SS_HTTPRequest,DataModel) 
ContentController.php:174
ContentController->handleRequest(SS_HTTPRequest,DataModel) 
ContentController.php:154
ContentController->handleRequest(SS_HTTPRequest,DataModel) 
ModelAsController.php:75
ModelAsController->handleRequest(SS_HTTPRequest,DataModel) 
Director.php:385
Director::handleRequest(SS_HTTPRequest,Session,DataModel) 
Director.php:149
Director::direct(/home/a-propos/,DataModel) 
main.php:188

#3

Didn’t have time to dive in into the code so I just switched the project to another server and it’s working now.
Just a drag and drop from one server to another…

Old config was : Silverstripe 3.4.1 - php5.6 - Mysql 5.5
New config : Silverstripe 3.4.1 - php5.6 - MariaDB 10.x