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.

General Questions /

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

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

Site is working fine, suddenly I cant access Admin


Go to End


8 Posts   3400 Views

Avatar
MagicUK

Community Member, 60 Posts

25 January 2011 at 7:36am

Hi all. I've ran into a major problem.

For some reason now when I visit my admin page. It goes straight to an error:

Server error

Sorry, there was a problem with handling your request.

Everything is fine at the front end.

Is there anything I can do to repair this without loosing the content of my database?

Your help is urgently required. Thanks! :-(

Avatar
swaiba

Forum Moderator, 1899 Posts

25 January 2011 at 8:05am

add this to the top of your config, debug through log messages to find out what happens...

ini_set('display_errors', 1);
error_reporting(E_ALL);

and read (it's also full of debugging advice)...

http://doc.silverstripe.org/sapphire/en/installation/common-problems

Avatar
MagicUK

Community Member, 60 Posts

25 January 2011 at 8:19am

Thanks swaiba. I get the following when running in dev mode:

[User Error] Bad RecordClassName '' and $baseClass not set

DataObject.php :

2753 		foreach($records as $record) {
2754 			if(empty($record['RecordClassName'])) {
2755 				$record['RecordClassName'] = $record['ClassName'];
2756 			}
2757 			if(class_exists($record['RecordClassName'])) {
2758 				$results[] = new $record['RecordClassName']($record);
2759 			} else {
2760 				if(!$baseClass) {
2761 					user_error("Bad RecordClassName '{$record['RecordClassName']}' and "
2762 						. "\$baseClass not set", E_USER_ERROR);
2763 				} else if(!is_string($baseClass) || !class_exists($baseClass)) {
2764 					user_error("Bad RecordClassName '{$record['RecordClassName']}' and bad "
2765 						. "\$baseClass '$baseClass not set", E_USER_ERROR);
2766 				}
2767 				$results[] = new $baseClass($record);
2768 			}

Avatar
MagicUK

Community Member, 60 Posts

25 January 2011 at 8:35am

Fixed it! I had a emply className in one of my entries in the siteTree_Live table.

PHEW! I'm due to go live with this site on Monday and I thought i was buggered there!

Avatar
Nobrainer Web

Community Member, 138 Posts

8 February 2011 at 2:15am

Thank you MagicUK,

I had an error where i would get bad record classname when i clicked on a folder in Files and Images.
In my files table i had several images with empty column classname, setting that to Image solved the issue.

Avatar
justbql

Community Member, 2 Posts

30 January 2012 at 11:00pm

Hello MagikUK,
I have the sam problem, but I don't understand how you solve this. Can you explain how you fixed it?

Thanks

Avatar
MagicUK

Community Member, 60 Posts

31 January 2012 at 1:38am

Hey justbql. I had to go into my phpAdmin on my server control panel and browse my database tables to look for an empty value in the 'className' column of my table. You will need to edit that to something that matches the other classnames. You should be able to work out what it should be from the other values on the row.

Avatar
swaiba

Forum Moderator, 1899 Posts

31 January 2012 at 3:40am

@justbql

To find problem pages...

SELECT * FROM SiteTree WHERE ClassName='';
SELECT * FROM SiteTree_Live WHERE ClassName='';
SELECT * FROM SiteTree_versions WHERE ClassName='';

To fix problem pages...

UPDATE SiteTree SET ClassName = 'Page' WHERE ClassName='';
UPDATE SiteTree_Live SET ClassName = 'Page' WHERE ClassName='';
UPDATE SiteTree_versions SET ClassName = 'Page' WHERE ClassName='';