Page MenuHomePhabricator

Error when updating, viewing and creating various pages
Open, Needs TriagePublicBUG REPORT

Description

When updating various pages, I am receiving a db exception:

[e28003fa15a1752eb492f47c] Exception caught: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
Query: SELECT  COUNT(DISTINCT t0.smw_id) AS count  FROM `smw_object_ids` AS t0 INNER JOIN `smw_fpt_inst` AS t2 ON t0.smw_id=t2.s_id INNER JOIN `smw_di_time` AS t4 ON t2.s_id=t4.s_id    WHERE (t2.o_id='163' AND ((t4.o_sortkey<='2459400.8358218') AND t4.p_id='265041')) AND t0.smw_iw!=':smw' AND t0.smw_iw!=':smw-delete' AND t0.smw_iw!=':smw-redi'  LIMIT 30001  
Function: SMW\SQLStore\QueryEngine\QueryEngine::getCountQueryResult
Error: 1969 Query execution was interrupted (max_statement_time exceeded) (localhost)

#0 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/libs/rdbms/database/Database.php(933): Wikimedia\Rdbms\Database->reportQueryError()
#1 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/libs/rdbms/database/Database.php(1269): Wikimedia\Rdbms\Database->query()
#2 /var/www/wikiapiary/www/mediawiki/public_html/w/extensions/SemanticMediaWiki/src/MediaWiki/Database.php(220): Wikimedia\Rdbms\Database->select()
#3 /var/www/wikiapiary/www/mediawiki/public_html/w/extensions/SemanticMediaWiki/src/SQLStore/QueryEngine/QueryEngine.php(342): SMW\MediaWiki\Database->select()
#4 /var/www/wikiapiary/www/mediawiki/public_html/w/extensions/SemanticMediaWiki/src/SQLStore/QueryEngine/QueryEngine.php(222): SMW\SQLStore\QueryEngine\QueryEngine->getCountQueryResult()
#5 /var/www/wikiapiary/www/mediawiki/public_html/w/extensions/SemanticMediaWiki/includes/storage/SQLStore/SMW_SQLStore3.php(330): SMW\SQLStore\QueryEngine\QueryEngine->getQueryResult()
#6 /var/www/wikiapiary/www/mediawiki/public_html/w/extensions/SemanticMediaWiki/includes/storage/SQLStore/SMW_SQLStore3.php(318): SMWSQLStore3->fetchQueryResult()
#7 /var/www/wikiapiary/www/mediawiki/public_html/w/extensions/SemanticMediaWiki/includes/query/SMW_QueryProcessor.php(418): SMWSQLStore3->getQueryResult()
#8 /var/www/wikiapiary/www/mediawiki/public_html/w/extensions/SemanticMediaWiki/src/ParserFunctions/AskParserFunction.php(210): SMWQueryProcessor::getResultFromQuery()
#9 /var/www/wikiapiary/www/mediawiki/public_html/w/extensions/SemanticMediaWiki/src/ParserFunctions/AskParserFunction.php(135): SMW\ParserFunctions\AskParserFunction->doFetchResultsFromFunctionParameters()
#10 /var/www/wikiapiary/www/mediawiki/public_html/w/extensions/SemanticMediaWiki/src/ParserFunctionFactory.php(298): SMW\ParserFunctions\AskParserFunction->parse()
#11 [internal function]: SMW\ParserFunctionFactory->SMW\{closure}()
#12 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/parser/Parser.php(3408): call_user_func_array()
#13 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/parser/Parser.php(3128): Parser->callParserFunction()
#14 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/parser/Preprocessor_DOM.php(1199): Parser->braceSubstitution()
#15 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/parser/Parser.php(3046): PPFrame_DOM->expand()
#16 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/parser/Preprocessor_DOM.php(1199): Parser->braceSubstitution()
#17 /var/www/wikiapiary/www/mediawiki/public_html/w/extensions/ParserFunctions/ParserFunctions_body.php(104): PPFrame_DOM->expand()
#18 [internal function]: ExtParserFunctions::ifObj()
#19 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/parser/Parser.php(3408): call_user_func_array()
#20 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/parser/Parser.php(3128): Parser->callParserFunction()
#21 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/parser/Preprocessor_DOM.php(1199): Parser->braceSubstitution()
#22 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/parser/Parser.php(3282): PPFrame_DOM->expand()
#23 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/parser/Preprocessor_DOM.php(1199): Parser->braceSubstitution()
#24 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/parser/Parser.php(2942): PPFrame_DOM->expand()
#25 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/parser/Parser.php(1297): Parser->replaceVariables()
#26 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/parser/Parser.php(451): Parser->internalParse()
#27 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/content/WikitextContent.php(330): Parser->parse()
#28 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/content/AbstractContent.php(497): WikitextContent->fillParserOutput()
#29 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/page/WikiPage.php(2071): AbstractContent->getParserOutput()
#30 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/page/WikiPage.php(1600): WikiPage->prepareContentForEdit()
#31 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/EditPage.php(2160): WikiPage->doEditContent()
#32 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/EditPage.php(1493): EditPage->internalAttemptSave()
#33 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/api/ApiEditPage.php(396): EditPage->attemptSave()
#34 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/api/ApiMain.php(1567): ApiEditPage->execute()
#35 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/api/ApiMain.php(545): ApiMain->executeAction()
#36 /var/www/wikiapiary/www/mediawiki/public_html/w/includes/api/ApiMain.php(516): ApiMain->executeActionWithErrorHandling()
#37 /var/www/wikiapiary/www/mediawiki/public_html/w/api.php(83): ApiMain->execute()
#38 {main}

I am also receiving similar errors when viewing certain pages, such as https://wikiapiary.com/wiki/Apocryphal_SMP_Wiki

[9cd7bd32b71b1970c9beaa8b] 2022-09-16 22:25:59: Fatal exception of type "RuntimeException"

Event Timeline

As I wrote on my blog last night:

I've taken a sledgehammer to the connection time allowed by setting MAX_STATEMENT_TIME to 30 for the DB user that php is using.

So this is a known problem. I've been planning to see if I can do anything about the long running queries tonight.

@MarkAHershberger Appears to be all up and working again. Let me know if you ever want some assistance, happy to help out.

@MarkAHershberger Appears to be all up and working again. Let me know if you ever want some assistance, happy to help out.

MarkAHershberger claimed this task.

Thanks.

Could you let me know if your bot would mark this wiki defunct? It isn't right now and I saw WikiApiary's bots didn't mark it defunct when it crawled it.

@MarkAHershberger Just had a look and currently my bot is not finding this page, as it is not returning in category lookup for Website or Bot_Segment_56, even though it is listed on the page... I assume WikiApiary's bots are doing the same?

@MarkAHershberger Additionally, I just looked at a whole bunch of other pages and it appears most pages created since May 2022 no longer have categories associated with them when requested through the api, even though its listed on the UI. My bot found these pretty quickly:
ColSMP Wiki
Col Wiki
Cola battle Wiki
Cola battle official Wiki
Colaboracion Empresarial Wiki
Colaborativas Wiki
Colaborative Tools Wiki
ColackentCommunity Wiki
Colackent Creations: Engines of Sodor Wiki
Colacorp Wiki
ColbaltStars Wiki
Colbertopedia
Colby Wiki
Colby s Clubhouse Wiki
ColcoAnimation Wikia
ColdBloodStudiosFilms Wiki
ColdMind Wiki
Cold As Radiation Official Wiki
Cold Blood Wiki
Cold Case Wiki
Cold Cat Wiki
Cold Cherry Wiki
Cold Comfort Wiki
Cold Conflict Wiki
Cold Doggia Wiki
Cold Feet Wiki
Cold Hearted Wiki
Cold Justice Franchise Wiki
Cold Killaz Wiki
Cold Legacy Wiki
Cold RBLX Wiki
Cold Radiation Wiki
Cold Shoot Wiki
Cold Shores Wiki
Cold Space Wiki
Cold Steel Wiki
Cold War: Red Dawn by WaC Wikia

Looking this further, it might be to the Job Queue being 4287529 as I assume we have set

$wgJobRunRate == 0

And the maintenance script isn't running?

runJobs is running. I have a log that shows that it is.

I just ran it by hand, however, and it processes a few jobs and then ends up spitting out FormatJson not found even though the autoloader has it and the file exists.

I'm working around it right now by adding require_once for the class file to LocalSettings.php, but it looks like the problem (which I guess must be related to how PHP handles auto-loading during error reporting?) is something that recent MediaWiki will fix.

Looks like it started to update after you fixed the FormatJson issue.

Now it looks like the site is in its old state of being slow when updating pages. I assume some big queries are still running in the database as Bumble Bee is reporting 23742.4 seconds to complete a job. I am also getting an error when uploading files, but I dont think that error is related to these performance issues.