Jump to:

22972 Posts in 11596 Topics by 2824 members

General Questions

SilverStripe Forums » General Questions » Site is working fine, suddenly I cant access Admin

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

Page: 1
Go to End
Author Topic: 2012 Views
  • MagicUK
    Avatar
    Community Member
    60 Posts

    Site is working fine, suddenly I cant access Admin Link to this post

    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!

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Site is working fine, suddenly I cant access Admin Link to this post

    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

  • MagicUK
    Avatar
    Community Member
    60 Posts

    Re: Site is working fine, suddenly I cant access Admin Link to this post

    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          }

  • MagicUK
    Avatar
    Community Member
    60 Posts

    Re: Site is working fine, suddenly I cant access Admin Link to this post

    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
    Avatar
    Community Member
    134 Posts

    Re: Site is working fine, suddenly I cant access Admin Link to this post

    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.

  • justbql
    Avatar
    Community Member
    2 Posts

    Re: Site is working fine, suddenly I cant access Admin Link to this post

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

    Thanks

  • MagicUK
    Avatar
    Community Member
    60 Posts

    Re: Site is working fine, suddenly I cant access Admin Link to this post

    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.

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Site is working fine, suddenly I cant access Admin Link to this post

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

    2012 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.