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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Hosting Requirements /

What you need to consider when choosing a hosting provider and plan.

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

Mysql Service shuts down


Go to End


9 Posts   3855 Views

Avatar
kindleman.com.au

Community Member, 70 Posts

20 October 2011 at 4:44pm

Hello.

We have just deployed a site to our stage environment. Its a 500m Ram, "Cloud" VPS with Crucial Paradigm.

If we both test it together, the cms ends up hanging, and then if i refresh the page i get:

PHP Fatal error: DataObjects have been requested before the database is ready.

Looking in cpanel, the mysql service is off. Rebooting it gets us going again until the next topple.

Whats to be done? could there be a configuration i have missed in the Silverstripe? Or does it need something special turned on at the server?

Thanks, will

Avatar
kindleman.com.au

Community Member, 70 Posts

20 October 2011 at 6:53pm

Just to confirm this,

We have to edit the site one at a time. If i click on a item in the tree 5 times rapid fire, the mysql proccess falls down. every time.

At this stage we can live with the slowness but it needs to be reliable.

Is there anything we can do to fix this?

w

Avatar
kominiarz

Community Member, 1 Post

24 March 2012 at 12:21am

Well, are you sure that it's CMS fault?
maybe it's VPS internal problem?

Avatar
jasonsypolt

Community Member, 5 Posts

6 August 2012 at 2:59am

I have several sites running on a micro instance on AWS (613mb) and had this problem. The server was getting low on memory and was shutting down mysql. Changing the php memory_limit and adjusting some my the mysql memory parameters helped. So I reduced the memory that php and mysql used and installed varnish to compensate, and the sites are actually pretty fast.

Avatar
Maariak

Community Member, 37 Posts

14 January 2016 at 10:16pm

Edited: 14/01/2016 10:45pm

This may not be the problem with SS, but I found this old topic, so I'm asking if someone can help with this. I got this same error that DataObjects have been requested before the database is ready. But with my imperfect english I'm not quite sure what does this mean what's said after that. "Please ensure your database connection details are correct, your database has been built, and that you are not trying to query the database in _config.php. in .../sapphire/core/model/DataObject.php on line 2873"
I checked what's on that line in DataObject.php, and it's just that text what's written in error information (DataObjects have been requested....)
The whole part of that code is:
public function instance_get_one($filter, $orderby = null) {
if(!DB::isActive()) {
user_error("DataObjects have been requested before the database is ready. Please ensure your database connection details are correct, your database has been built, and that you are not trying to query the database in _config.php.", E_USER_ERROR);
}

If I check my database connection details in _config.php (which I assume means database name, server, password etc.) they are correct, database does exists, but what's that last one, that "you are not trying to query the database in _config.php"?

The problem occured when I was updating php-version, but changed it back when recieved some error codes that I need to search for more information. When updating php-version, I also changed database password, because it was recommended there in services providers information. When changing back the older version I also changed the password.

edit: And when trying to get to the page with mobile phone it says: "Fatal error: Call to a member function addslashes() on a non-object in .../sapphire/core/Convert.php on line 119"
I don't understand much about these codes, when in that convert.php there's
static function raw2sql($val) {
if(is_array($val)) {
foreach($val as $k => $v) $val[$k] = self::raw2sql($v);
return $val;
} else {
return DB::getConn()->addslashes($val);
}

In silverstripe_version file it says version is 2.4.5

Do I need to flush the page somehow or what could help with this problem?

Avatar
Maariak

Community Member, 37 Posts

14 January 2016 at 11:04pm

Ok, so after flushing and restarting browser it gives that addslashes error text also when using computer. Any help for that then?

Avatar
camfindlay

Forum Moderator, 267 Posts

15 January 2016 at 9:24am

What version of PHP are you using?

Just some observations, the error message is saying that calling the "addslashes" method is not working because DB::getConn() is not returning as an object so something to do with the database connection layer is not correct (without knowing your project I cant help much further than that). Something to double check is that even if the database name, username, password is correct make sure that the text characters encoding is perhaps correct (something like UTF8). Have you managed to get this site running on a local development environment? Do you get the same problems?

Avatar
Maariak

Community Member, 37 Posts

15 January 2016 at 5:13pm

Php version is 5.2. I was upgrading it but rolled back to this version. I'm not quite sure how the problem could be with database names etc cause I haven't changed that informatiln in the file. But I'll check those once more when I'll get to computer.And I'll search the information how to get the site running on a local development environment, because I'm not quite sure if I know that already... :>

Go to Top