Jump to:

4952 Posts in 14421 Topics by 1491 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » Error at Line 568 Framework/Model/MySQLDatabase.php

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

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

Page: 1
Go to End
Author Topic: 759 Views
  • arthurdent
    Avatar
    Community Member
    153 Posts

    Error at Line 568 Framework/Model/MySQLDatabase.php Link to this post

    Still experimenting with our install of SilverStripe 3.0. Now when I try to update a page I get the following message:

    Error at Line 568 Framework/Model/MySQLDatabase.php

    When I look at the relevant code I see:

    function databaseError($msg, $errorLevel = E_USER_ERROR) {
          // try to extract and format query
          if(preg_match('/Couldn\'t run query: ([^\|]*)\|\s*(.*)/', $msg, $matches)) {
             $formatter = new SQLFormatter();
             $msg = "Couldn't run query: \n" . $formatter->formatPlain($matches[1]) . "\n\n" . $matches[2];
          }

          user_error($msg, $errorLevel);
       }

    Pretty generic error stuff. What gives? Anybody got any pointers for me?

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Error at Line 568 Framework/Model/MySQLDatabase.php Link to this post

    It looks like the error might be getting cut off.

    Try adding some logging so that it emails you the full error details. In your mysite/_config.php add this code (replacing with your email)

    SS_Log::add_writer(new SS_LogEmailWriter('my@email.com'), SS_Log::WARN, '<=');

    Sean

  • Beau
    Avatar
    Community Member
    5 Posts

    Re: Error at Line 568 Framework/Model/MySQLDatabase.php Link to this post

    I'm getting the same error in the little pop up box when saving content in the CMS.

    For a while, I seemed to get the error only when trying to save a new change the first time - if I tried to save the change again right after the error would not appear.

    Now, however, the error is coming up every time I try to save content in the CMS.

    I have 2 modules installed:
    bootstrap forms (this doesn't appear to be the problem)
    googlesitemaps (have not tested without this module yet)

    Could anyone shed any light on this issue at all? Even just the ballpark area the issue could be in - something in my code or possibly a silverstripe bug or a conflict with a module or something else.

  • Beau
    Avatar
    Community Member
    5 Posts

    Re: Error at Line 568 Framework/Model/MySQLDatabase.php Link to this post

    It could be an error in your code on the page you are trying to save that is showing this error. That seemed to be the case for me.

    I had a typo of some kind in my CMS fields set up.

    759 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.