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.

Installing SilverStripe

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

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

Error at Line 568 Framework/Model/MySQLDatabase.php


Reply

4 Posts   806 Views

Avatar
arthurdent

18 January 2013 at 2:16pm Community Member, 166 Posts

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?

Avatar
Sean

23 January 2013 at 3:59pm Forum Moderator, 921 Posts

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

Avatar
Beau

18 February 2013 at 11:55am Community Member, 5 Posts

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.

Avatar
Beau

3 April 2013 at 1:29pm Community Member, 5 Posts

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.