debugging an intermittent bonk problem
Today I started getting bonk's on my site's forum. I enabled Vanilla to show me the actual error - see below. The problem is intermittent - I guess it can't connect periodically to its MySQL database or something? When it does connect, everything seems fine on the site.
Wasn't sure if this was likely a problem on my web server, the MySQL database, or if this might be something to address on the Vanilla side. Sorry for the noob question, any advice greatly appreciated....
Dan
Fatal Error in Gdn_Database.Connection();
An error occurred while attempting to connect to the database
SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'localhost' (10061)
The error occurred on or near: C:\HostingSpaces\dnigrin\defectiverecords.com\wwwroot\forum\library\database\class.database.php
57: $this->_Connection = new PDO(strtolower($this->Engine) . ':' . $this->Dsn, $this->User, $this->Password, $this->ConnectionOptions);
58: if($this->ConnectionOptions[1002])
59: $this->Query($this->ConnectionOptions[1002]);
60: } catch (Exception $ex) {
61: trigger_error(ErrorMessage('An error occurred while attempting to connect to the database', $this->ClassName, 'Connection', $ex->getMessage()), E_USER_ERROR);
62: }
63: }
64:
65: return $this->_Connection;
Backtrace:
[C:\HostingSpaces\dnigrin\defectiverecords.com\wwwroot\forum\library\database\class.database.php:61] PHP::Gdn_ErrorHandler();
[C:\HostingSpaces\dnigrin\defectiverecords.com\wwwroot\forum\library\database\class.database.php:275] Gdn_Database->Connection();
[C:\HostingSpaces\dnigrin\defectiverecords.com\wwwroot\forum\library\database\class.sqldriver.php:1650] Gdn_Database->Query();
[C:\HostingSpaces\dnigrin\defectiverecords.com\wwwroot\forum\library\database\class.sqldriver.php:934] Gdn_SQLDriver->Query();
[C:\HostingSpaces\dnigrin\defectiverecords.com\wwwroot\forum\library\core\class.model.php:373] Gdn_SQLDriver->GetWhere();
[C:\HostingSpaces\dnigrin\defectiverecords.com\wwwroot\forum\library\core\class.model.php:356] Gdn_Model->GetWhere();
[C:\HostingSpaces\dnigrin\defectiverecords.com\wwwroot\forum\applications\dashboard\models\class.usermodel.php:452] Gdn_Model->GetID();
[C:\HostingSpaces\dnigrin\defectiverecords.com\wwwroot\forum\applications\dashboard\models\class.usermodel.php:623] UserModel->GetID();
[C:\HostingSpaces\dnigrin\defectiverecords.com\wwwroot\forum\library\core\class.session.php:280] UserModel->GetSession();
[C:\HostingSpaces\dnigrin\defectiverecords.com\wwwroot\forum\library\core\class.auth.php:36] Gdn_Session->Start();
[C:\HostingSpaces\dnigrin\defectiverecords.com\wwwroot\forum\bootstrap.php:168] Gdn_Auth->StartAuthenticator();
[C:\HostingSpaces\dnigrin\defectiverecords.com\wwwroot\forum\index.php:41] PHP::require_once();
Variables in local scope:
[ex] array (
'errorInfo' => NULL,
)
Need Help?
If you are a user of this website, you can report this message to a website administrator.
If you are an administrator of this website, you can get help at the Vanilla Community Forums.
Additional information for support personnel:
Application: Vanilla
Application Version: 2.0.18.1
PHP Version: 5.2.11
Operating System: WINNT
Server Software: Microsoft-IIS/7.0
Referer: http://defectiverecords.com/
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.26.17 (KHTML, like Gecko) Version/6.0.2 Safari/536.26.17
Request Uri: /forum/
Controller: Gdn_Database
Method: Connection
Comments
Since it was working before and only working intermittently today. You've got to ask yourself what changes did you make to vanilla or your server since it last worked consistently.
try changing it from localhost to 127.0.0.1 in your config.
HY000 is a very general ODBC-level error code, and 2003 is the MySQL-specific error code that means that the initial server connection failed
is your sql server running when you get this error? do you have something blocking connection (firewall)?
you might google
SQLSTATE[HY000] [2003]
and scout around on stackoverflow and see if anything jumps out at you.
there are a few threads relating to it. e.g. also see related posts. on that web page. Also try looking on mysql site.
http://stackoverflow.com/questions/7740915/mysql-error-2003-hy000-cant-connect-to-mysql-server-on-localhost-10061?rq=1
other than that I don't know.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.