2013-11-08

New thread: Connect through socket is crashing MySQL server

New page

I have recently been put in charge of my companies Wiki that they use for a knowledge base.

It is way out of date

MediaWiki 1.16.1 (patched to enable page accessrestriction)

PHP 5.2.17 (apache2handler) (patched to enable page accessrestriction)

MySQL 5.1.58 (patched to enable page accessrestriction)

and so the first thing Im working on is updating to the latest version.

Created a virtual machine, cloned the production machine onto the VM and Ive run into a bit of a problem that I just cant track down. Any help would be greatly appreciated.

I can read and write to the wikidb through PhpMyAdmin using the same socket and user that the wiki is trying to use. but whenever i try and navigate to the mediawiki page in my browser the MySQL server crashes (mysql status shows uptime revert to 0seconds, and logs show a restart) and the following is dumped into the browser:

MediaWiki internal error.

Original exception: exception 'DBQueryError' with message 'A database error has occurred

Query: COMMIT

Function: Database::commit

Error: 2002 Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) (localhost)

' in /var/www/html/mediawiki/includes/db/Database.php:576

Stack trace:

#0 /var/www/html/mediawiki/includes/db/Database.php(538): DatabaseBase->reportQueryError('Can't connect t...', 2002, 'COMMIT', 'Database::commi...', false)

#1 /var/www/html/mediawiki/includes/db/Database.php(1969): DatabaseBase->query('COMMIT', 'Database::commi...')

#2 /var/www/html/mediawiki/includes/BagOStuff.php(265): DatabaseBase->commit()

#3 /var/www/html/mediawiki/includes/MessageCache.php(241): SqlBagOStuff->get('wikidb:messages...')

#4 /var/www/html/mediawiki/includes/MessageCache.php(588): MessageCache->load('en')

#5 /var/www/html/mediawiki/includes/MessageCache.php(527): MessageCache->getMsgFromNamespace('Mainpage', 'en')

#6 [internal function]: MessageCache->get('mainpage', true, true)

#7 /var/www/html/mediawiki/includes/StubObject.php(58): call_user_func_array(Array, Array)

#8 /var/www/html/mediawiki/includes/StubObject.php(76): StubObject->_call('get', Array)

#9 /var/www/html/mediawiki/includes/GlobalFunctions.php(742): StubObject->__call('get', Array)

#10 /var/www/html/mediawiki/includes/GlobalFunctions.php(742): StubObject->get('mainpage', true, true)

#11 /var/www/html/mediawiki/includes/GlobalFunctions.php(707): wfMsgGetKey('mainpage', true, true, true)

#12 /var/www/html/mediawiki/includes/GlobalFunctions.php(655): wfMsgReal('mainpage', Array, true, true)

#13 /var/www/html/mediawiki/includes/Title.php(284): wfMsgForContent('mainpage')

#14 /var/www/html/mediawiki/includes/Wiki.php(117): Title::newMainPage()

#15 /var/www/html/mediawiki/index.php(61): MediaWiki->checkInitialQueries(NULL, 'view')

#16 {main}

Exception caught inside exception handler: exception 'DBConnectionError' with message 'DB connection error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) (localhost)' in /var/www/html/mediawiki/includes/db/Database.php:421

Stack trace:

#0 /var/www/html/mediawiki/includes/db/LoadBalancer.php(685): DatabaseBase->reportConnectionError('Unknown error (...')

#1 /var/www/html/mediawiki/includes/db/LoadBalancer.php(455): LoadBalancer->reportConnectionError(Object(DatabaseMysql))

#2 /var/www/html/mediawiki/includes/GlobalFunctions.php(2973): LoadBalancer->getConnection(-1, Array, false)

#3 /var/www/html/mediawiki/includes/LocalisationCache.php(760): wfGetDB(-1)

#4 /var/www/html/mediawiki/includes/LocalisationCache.php(321): LCStore_DB->get('en', 'deps')

#5 /var/www/html/mediawiki/includes/LocalisationCache.php(350): LocalisationCache->isExpired('en')

#6 /var/www/html/mediawiki/includes/LocalisationCache.php(262): LocalisationCache->initLanguage('en')

#7 /var/www/html/mediawiki/includes/LocalisationCache.php(205): LocalisationCache->loadItem('en', 'defaultUserOpti...')

#8 /var/www/html/mediawiki/languages/Language.php(442): LocalisationCache->getItem('en', 'defaultUserOpti...')

#9 /var/www/html/mediawiki/includes/User.php(1053): Language->getDefaultUserOptionOverrides()

#10 /var/www/html/mediawiki/includes/User.php(1975): User::getDefaultOptions()

#11 [internal function]: User->getOption('language')

#12 /var/www/html/mediawiki/includes/StubObject.php(58): call_user_func_array(Array, Array)

#13 /var/www/html/mediawiki/includes/StubObject.php(182): StubObject->_call('getOption', Array)

#14 /var/www/html/mediawiki/includes/StubObject.php(150): StubUser->__call('getOption', Array)

#15 /var/www/html/mediawiki/includes/StubObject.php(150): StubUser->getOption('language')

#16 /var/www/html/mediawiki/includes/StubObject.php(103): StubUserLang->_newObject()

#17 /var/www/html/mediawiki/includes/StubObject.php(57): StubObject->_unstub('getCode', 5)

#18 /var/www/html/mediawiki/includes/StubObject.php(145): StubObject->_call('getCode', Array)

#19 /var/www/html/mediawiki/includes/GlobalFunctions.php(582): StubUserLang->__call('getCode', Array)

#20 /var/www/html/mediawiki/includes/GlobalFunctions.php(582): StubUserLang->getCode()

#21 /var/www/html/mediawiki/includes/MessageCache.php(506): wfGetLangObj(false)

#22 /var/www/html/mediawiki/includes/GlobalFunctions.php(742): MessageCache->get('databaseerror', true, false)

#23 /var/www/html/mediawiki/includes/GlobalFunctions.php(707): wfMsgGetKey('databaseerror', true, false, true)

#24 /var/www/html/mediawiki/includes/Exception.php(75): wfMsgReal('databaseerror', Array)

#25 /var/www/html/mediawiki/includes/db/Database.php(2731): MWException->msg('databaseerror', 'Database error')

#26 /var/www/html/mediawiki/includes/Exception.php(209): DBQueryError->getPageTitle()

#27 /var/www/html/mediawiki/includes/Exception.php(172): MWException->htmlHeader()

#28 /var/www/html/mediawiki/includes/Exception.php(191): MWException->reportHTML()

#29 /var/www/html/mediawiki/includes/Exception.php(289): MWException->report()

#30 /var/www/html/mediawiki/includes/Exception.php(348): wfReportException(Object(DBQueryError))

#31 [internal function]: wfExceptionHandler(Object(DBQueryError))

#32 {main}

Show more