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

Site is working fine, suddenly I cant access Admin


8 Posts   2211 Views


25 January 2011 at 7:36am Community Member, 60 Posts

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! :-(


25 January 2011 at 8:05am Forum Moderator, 1796 Posts

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

ini_set('display_errors', 1);

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


25 January 2011 at 8:19am Community Member, 60 Posts

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          }


25 January 2011 at 8:35am Community Member, 60 Posts

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!

Nobrainer Web

8 February 2011 at 2:15am Community Member, 135 Posts

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.


30 January 2012 at 11:00pm Community Member, 2 Posts

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



31 January 2012 at 1:38am Community Member, 60 Posts

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.


31 January 2012 at 3:40am Forum Moderator, 1796 Posts


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='';