Jump to content

Site Completely Down due to Max User Connections Being Exceeded to the SQL Database


Recommended Posts

I have had Prestashop up and running for several weeks.  Just yesterday, the site became inaccessible with the following error coming up:

 

Link to database cannot be established: SQLSTATE[42000] [1203] User prs0x6EXpyJ already has more than 'max_user_connections' active connections

 

The tech support from my host, Fatcow has suggested the following could be the root cause:

 

* A script is not closing the MySQL connection after accessing the database. In WordPress, such chances are less, however if there is an error in the scripting of a plugin or theme which you're using, then the MySQL connection won't close after querying the database. Thus, please make sure that you close the connection immediately after accessing the database using mysql_close() command from your scripts. 

* Your scripts or pages are hitting too frequently from a specific IP address through brute force tools or manually or from other websites. You can check raw logs available in the /stats directory or check the Visitor Statistics for such possibilities. Using the .htaccess Hotlink Protection and the .htaccess Block IP Addresses would resolve this issue. 

 

Can someone please help me understand how to go about fixing this if you have experienced it?

 

Thanks

Link to comment
Share on other sites

have you contacted your hosting company about this issue?

 

outside of ps (search) you can find  solutions to this but if you are not comfortable and/or do not have access to making changes of this sort it's best to use your hosting company.

 

note: some hosting will not allow increase, this is how they get you to move up in hosting accounts.

Link to comment
Share on other sites

I've contacted the hosting company (Fatcow).  They believe that it is an issue with Prestashop that is outside the scope of their support. I am running a standard build with really no customization and I only have 2 products.  It is a very simple store without much traffic.  They believe that one of the scripts in Prestashop is causing the issue and that perhaps over time it has led to this error that built up to this crash.  This seems highly unlikely to me given that the store has had no changes and has been stable for the last 5 weeks.  I have made no modifications to it since going live in early January.

 

I reviewed my hosting error logs and found the following which occurred yesterday around the time that I believe the issues started.

 

PHP Warning:  Invalid argument supplied for foreach() in /hermes/waloraweb075/b2751/moo.sobektherapeuticscom/migramin.com/store/classes/Pack.php on line 145
 
PHP Warning:  Invalid argument supplied for foreach() in /hermes/waloraweb075/b2751/moo.sobektherapeuticscom/migramin.com/store/classes/Pack.php on line 152
 
Does this look like these warning could be related to an issue that would cause the SQL database to be overloaded?  
 
I am totally blocked out of both the front and backend of the store.  Is there another way to access error logs that Prestashop may generate itself?  
Link to comment
Share on other sites

no the warnings are not an issue...

 

what your hosting is suggesting is to look at your access log (from hosting account) to see if there are bots hammering your shop.

 

and if so then to block these bots....I would follow their suggestion in the matter...(this is not the same as error log)

 

if you see bad behavior from bots (ip) you can use vekia's free ip blocker

 

http://www.prestashop.com/forums/topic/245300-module-free-ban-ip-address-block-any-user-you-want/

Link to comment
Share on other sites

Thanks.  Any thoughts on how to regain access to the store?  I was thinking about asking if they could restart the SQL database but I'm not sure that's the right course of action.  

I would follow the course prescribed by hosting as to (why this is happening)...

you could of course request a recycle of your domain...better yet get vps then you can do all this yourself. :)

Link to comment
Share on other sites

Was never able to figure out the root cause with the hosting company.  However, they did do a scan of my files for Malware and found nothing.  The only way I was able to restore access was to replace all my files to an earlier backup.  The concern I have is that I do not understand the root cause of what happened, so I don't know how stable the store will be.  

 

 

In looking back at the original error code:

Link to database cannot be established: SQLSTATE[42000] [1203] User prs0x6EXpyJ already has more than 'max_user_connections' active connections

 

The user "prs0x6EXpyJ" appears to be the Prestashop connection to the SQL database.  This is the response I got back from my hosting company (Fatcow) which is leaving me somewhat perplexed:

 

From the error message, it appears that database user 'prs0x6EXpyJ' has exceed the database connection limits. On our platform the maximum concurrent MySQL connections per user is 10. If you exceed this limit, you will not be able to connect the database and you will receive the above error. However, it will reset every hour. I suggest you to upgrade your application and optimize your database. 

 

 

I have searched the bulletin boards and have not found an exact replication of this error from other users. Are there any thoughts on how this might be happening or where I can look to investigate?  As I stated before the only errors I found were as follows:  

 

PHP Warning:  Invalid argument supplied for foreach() in /hermes/waloraweb075/b2751/moo.sobektherapeuticscom/migramin.com/store/classes/Pack.php on line 145
 
PHP Warning:  Invalid argument supplied for foreach() in /hermes/waloraweb075/b2751/moo.sobektherapeuticscom/migramin.com/store/classes/Pack.php on line 152
 
They showed up the day that the event happened.  What do they mean?  Why did they occur?  
 
I really appreciate all the help by the way.  I am new to Prestashop and still finding my sea legs with it.
Link to comment
Share on other sites

×
×
  • Create New...