MediaWiki internal error.

Original exception: exception 'DBQueryError' with message 'A database error has occurred
Query: SELECT s.smw_id as smw_id, s.smw_sortkey as title, s.smw_namespace as ns FROM `smw_ids` s WHERE s.smw_id in (101317,88129,48165,38940,38780,98390,38865,49825,38867,38869,38871,38923,148589,112425,51267,146697,144321,39344,40130,51883,39396,59846,77379,147614,40311,39447,86715,42126,111754,42788,39274,39017,39454,40427,40428,40797,39496,76275,49749,48828,148851,154321,154324,54900,152372,101321,54444,40678,46728,109303)
Function:
Error: 2002 Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) (localhost)
' in /var/www/html/neurolex/w/includes/db/Database.php:661
Stack trace:
#0 /var/www/html/neurolex/w/includes/db/Database.php(616): Database->reportQueryError('Can't connect t...', 2002, 'SELECT s.smw_id...', '', false)
#1 /var/www/html/neurolex/w/extensions/Treeview/TreeGenerator.php(489): Database->query('SELECT s.smw_id...')
#2 /var/www/html/neurolex/w/extensions/Treeview/TreeGenerator.php(366): TreeviewStorageSQL2->getElementProperties()
#3 /var/www/html/neurolex/w/extensions/Treeview/TreeGenerator.php(107): TreeviewStorageSQL2->getHierarchyByRelation(Object(Title), NULL, Object(Title))
#4 [internal function]: TreeGenerator->generateTree(Object(Parser), 'start=Category:...', 'property=Is_par...')
#5 /var/www/html/neurolex/w/includes/parser/Parser.php(2813): call_user_func_array(Array, Array)
#6 /var/www/html/neurolex/w/includes/parser/Preprocessor_Hash.php(921): Parser->braceSubstitution(Array, Object(PPTemplateFrame_Hash))
#7 /var/www/html/neurolex/w/includes/parser/Parser.php(2713): PPFrame_Hash->expand(Object(PPNode_Hash_Tree))
#8 /var/www/html/neurolex/w/includes/parser/Preprocessor_Hash.php(921): Parser->braceSubstitution(Array, Object(PPTemplateFrame_Hash))
#9 /var/www/html/neurolex/w/extensions/ApplicationProgramming/ParserFunctions/ParserFunctions.php(111): PPFrame_Hash->expand(Object(PPNode_Hash_Tree))
#10 [internal function]: ExtParserFunctions->ifObj(Object(Parser), Object(PPTemplateFrame_Hash), Array)
#11 /var/www/html/neurolex/w/includes/parser/Parser.php(2813): call_user_func_array(Array, Array)
#12 /var/www/html/neurolex/w/includes/parser/Preprocessor_Hash.php(921): Parser->braceSubstitution(Array, Object(PPTemplateFrame_Hash))
#13 /var/www/html/neurolex/w/includes/parser/Parser.php(2941): PPFrame_Hash->expand(Object(PPNode_Hash_Tree))
#14 /var/www/html/neurolex/w/includes/parser/Preprocessor_Hash.php(921): Parser->braceSubstitution(Array, Object(PPFrame_Hash))
#15 /var/www/html/neurolex/w/includes/parser/Parser.php(2632): PPFrame_Hash->expand(Object(PPNode_Hash_Tree), 0)
#16 /var/www/html/neurolex/w/includes/parser/Parser.php(875): Parser->replaceVariables('{{NIF Standard ...')
#17 /var/www/html/neurolex/w/includes/parser/Parser.php(327): Parser->internalParse('{{NIF Standard ...')
#18 /var/www/html/neurolex/w/extensions/FlaggedRevs/FlaggedRevs.class.php(330): Parser->parse('{{NIF Standard ...', Object(Title), Object(ParserOptions), true, true, 342416)
#19 /var/www/html/neurolex/w/extensions/FlaggedRevs/FlaggedArticle.php(440): FlaggedRevs::parseStableText(Object(SMWCategoryPage), '{{NIF Standard ...', 342416)
#20 /var/www/html/neurolex/w/extensions/FlaggedRevs/FlaggedRevs.hooks.php(1279): FlaggedArticle->setPageContent(false, true)
#21 [internal function]: FlaggedRevsHooks::onArticleViewHeader(Object(SMWCategoryPage), false, true)
#22 /var/www/html/neurolex/w/includes/Hooks.php(117): call_user_func_array(Array, Array)
#23 /var/www/html/neurolex/w/includes/Article.php(869): wfRunHooks('ArticleViewHead...', Array)
#24 /var/www/html/neurolex/w/includes/CategoryPage.php(30): Article->view()
#25 /var/www/html/neurolex/w/includes/Wiki.php(450): CategoryPage->view()
#26 /var/www/html/neurolex/w/includes/Wiki.php(63): MediaWiki->performAction(Object(OutputPage), Object(SMWCategoryPage), Object(Title), Object(User), Object(WebRequest))
#27 /var/www/html/neurolex/w/index.php(116): MediaWiki->initialize(Object(Title), Object(SMWCategoryPage), Object(OutputPage), Object(User), Object(WebRequest))
#28 {main}

Exception caught inside exception handler: exception 'DBUnexpectedError' with message 'Error in fetchObject(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) (localhost)' in /var/www/html/neurolex/w/includes/db/Database.php:788
Stack trace:
#0 /var/www/html/neurolex/w/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php(221): Database->fetchObject(false)
#1 /var/www/html/neurolex/w/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php(340): SMWSQLStore2->getSemanticData(Object(Title), Array)
#2 /var/www/html/neurolex/w/extensions/SMWHalo/includes/storage/SMW_TripleStore.php(68): SMWSQLStore2->getPropertyValues(Object(Title), Object(SMWPropertyValue), NULL, '')
#3 /var/www/html/neurolex/w/extensions/SemanticForms/includes/SF_LinkUtils.inc(80): SMWTripleStore->getPropertyValues(Object(Title), Object(SMWPropertyValue))
#4 /var/www/html/neurolex/w/extensions/SemanticForms/includes/SF_LinkUtils.inc(255): SFLinkUtils::getFormsThatPagePointsTo('Cognitive effor...', 14, '_SF_PDF', '_SF_PDF_BACKUP', 4)
#5 /var/www/html/neurolex/w/extensions/SemanticForms/includes/SF_FormEditTab.php(24): SFLinkUtils::getFormsForArticle(Object(SkinOntoSkin3))
#6 [internal function]: SFFormEditTab::displayTab(Object(SkinOntoSkin3), Array)
#7 /var/www/html/neurolex/w/includes/Hooks.php(117): call_user_func_array(Array, Array)
#8 /var/www/html/neurolex/w/includes/SkinTemplate.php(804): wfRunHooks('SkinTemplateTab...', Array)
#9 /var/www/html/neurolex/w/includes/SkinTemplate.php(437): SkinTemplate->buildContentActionUrls()
#10 /var/www/html/neurolex/w/includes/OutputPage.php(970): SkinTemplate->outputPage(Object(OutputPage))
#11 /var/www/html/neurolex/w/includes/Exception.php(159): OutputPage->output()
#12 /var/www/html/neurolex/w/includes/Exception.php(186): MWException->reportHTML()
#13 /var/www/html/neurolex/w/includes/Exception.php(284): MWException->report()
#14 /var/www/html/neurolex/w/includes/Exception.php(344): wfReportException(Object(DBQueryError))
#15 [internal function]: wfExceptionHandler(Object(DBQueryError))
#16 {main}