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.

Installing SilverStripe /

Getting SilverStripe up and running on your computer and on your web server.

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

"Show deleted pages" gives me "error loading tree"


Go to End


2 Posts   2395 Views

Avatar
tmkp

Community Member, 42 Posts

30 January 2010 at 10:09am

Hi,
i've been pulling my hair out over this one for a couple hours already..

A click on "Show deleted pages" in Site Content throws an "error loading tree", tree is not shown. Everything else is working just fine. Error appears on both 2.3.4 and 2.3.5, fresh installs.

Here's some firebug output:

2.3.4:

POST http://[MYURL]/admin/getshowdeletedsubtree?ajax=1&ID=0 500 Internal Server Error

500//ERROR [User Error]: Couldn't run query:
CREATE TEMPORARY TABLE IF NOT EXISTS _ArchiveSiteTree (
				RecordID INT NOT NULL PRIMARY KEY,
				Version INT NOT NULL
			)

Access denied for user '[MYSQLCREDS]'@'%' to database '[MYSQLCREDS]'
IN POST /admin/getshowdeletedsubtree?ajax=1&ID=0
Line 401 in [PATH]/sapphire/core/model/MySQLDatabase.php

Source
======
  392: 	}
  393:
  394: 	function databaseError($msg, $errorLevel = E_USER_ERROR) {
  395: 		// try to extract and format query
  396: 		if(preg_match('/Couldn\'t run query: ([^\|]*)\|\s*(.*)/', $msg, $matches)) {
  397: 			$formatter = new SQLFormatter();
  398: 			$msg = "Couldn't run query: \n" . $formatter->formatPlain($matches[1]) . "\n\n" . $matches[2];
  399: 		}
  400:
* 401: 		user_error($msg, $errorLevel);
  402: 	}
  403: }
  404:
  405: /**
  406:  * A result-set from a MySQL database.
  407:  * @package sapphire

<ul>user_error(Couldn't run query:
CREATE TEMPORARY TABLE IF NOT EXISTS _ArchiveSiteTree (
				RecordID INT NOT NULL PRIMARY KEY,
				Version INT NOT NULL
			)

Access denied for user '[MYSQLCREDS]'@'%' to database '[MYSQLCREDS]',256)
line 401 of MySQLDatabase.php

MySQLDatabase->databaseError(Couldn't run query: CREATE TEMPORARY TABLE IF NOT EXISTS _ArchiveSiteTree (
				RecordID INT NOT NULL PRIMARY KEY,
				Version INT NOT NULL
			) | Access denied for user '[MYSQLCREDS]'@'%' to database '[MYSQLCREDS]',256)
line 102 of MySQLDatabase.php

MySQLDatabase->query(CREATE TEMPORARY TABLE IF NOT EXISTS _ArchiveSiteTree (
				RecordID INT NOT NULL PRIMARY KEY,
				Version INT NOT NULL
			),256)
line 120 of DB.php

DB::query(CREATE TEMPORARY TABLE IF NOT EXISTS _ArchiveSiteTree (
				RecordID INT NOT NULL PRIMARY KEY,
				Version INT NOT NULL
			))
line 108 of Versioned.php

Versioned::requireArchiveTempTable(SiteTree)
line 733 of Versioned.php

Versioned::get_including_deleted(SiteTree,ParentID = 0)
line 515 of Hierarchy.php

Hierarchy->AllHistoricalChildren(CMSMain)

call_user_func_array(Array,Array)
line 550 of Object.php

Object->__call(AllHistoricalChildren,Array)

SiteTree->AllHistoricalChildren(CMSMain)
line 151 of Hierarchy.php

Hierarchy->markChildren(SiteTree,CMSMain,AllHistoricalChildren)
line 85 of Hierarchy.php

Hierarchy->markPartialTree(30,CMSMain,AllHistoricalChildren)

call_user_func_array(Array,Array)
line 550 of Object.php

Object->__call(markPartialTree,Array)

SiteTree->markPartialTree(30,CMSMain,AllHistoricalChildren)
line 479 of LeftAndMain.php

LeftAndMain->getSiteTreeFor(SiteTree,0,AllHistoricalChildren)
line 159 of CMSMain.php

CMSMain->getshowdeletedsubtree(HTTPRequest)
line 159 of Controller.php

Controller->handleAction(HTTPRequest)
line 129 of RequestHandler.php

RequestHandler->handleRequest(HTTPRequest)
line 119 of Controller.php

Controller->handleRequest(HTTPRequest)
line 277 of Director.php

Director::handleRequest(HTTPRequest,Session)
line 121 of Director.php

Director::direct(/admin/getshowdeletedsubtree)
line 118 of main.php

</ul>
http://[MYURL]/jsparty/prototype.js?m=1264795354
Line 658

And in 2.3.5

500//There has been an error
http://[MYURL]/silverstripe/assets/base.js?m=1264788920
Line 55

which reads:
var Ajax={getTransport:function(){return Try.these(function(){return new ActiveXObject('Msxml2.XMLHTTP')},function(){return new ActiveXObject('Microsoft.XMLHTTP')},function(){return new XMLHttpRequest()})||false;},activeRequestCount:0}

Does this happen to look familiar to anyone?

Silverstripe is running on subdomains in both cases, i'm not sure if that could be the problem at all though.. Like stated above, everything else seems to be working smoothly.

Any help would be greatly appreciated!

Thanks,
Andi

Avatar
OwenW

Community Member, 45 Posts

30 January 2010 at 8:08pm

Hi tmkp,

I have not seen this error, but i suspect it may be that the database user is not able to create temporary tables, based on this bit;

<quote>
500//ERROR [User Error]: Couldn't run query:
CREATE TEMPORARY TABLE IF NOT EXISTS _ArchiveSiteTree (
RecordID INT NOT NULL PRIMARY KEY,
Version INT NOT NULL
)

Access denied for user '[MYSQLCREDS]'@'%' to database '[MYSQLCREDS]'
</quote>

I suspect that if you grant the mysql user the CREATE TEMPORARY TABLES priv then you should hopefully be ok.

Cheers
Owen