Page MenuHomePhabricator

Contributors Compatibility with MW 1.43: update.php deletes ipblock table
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

Rdbms\DBQueryError: A database query error has occurred:

Error 1146: Table 'mediaewiki.ipblocks' doesn't exist
Function: ContributionScores::getContributionScoreData
Query: SELECT user_id,user_name,user_real_name,page_count,rev_count,page_count+SQRT(rev_count-page_count)*2 AS `wiki_rank` FROM `user` `u` JOIN ((SELECT actor_rev_user.actor_user AS `rev_user`,COUNT(DISTINCT rev_page) AS `page_count`,COUNT(rev_id) AS `rev_count` FROM `revision` JOIN `actor` `actor_rev_user` ON ((actor_rev_user.actor_id = rev_actor)) WHERE (rev_timestamp > '20250415145012') AND (actor_rev_user.actor_user NOT IN (SELECT ipb_user FROM `ipblocks` WHERE ipb_user <> 0 )) AND (actor_rev_user.actor_user NOT IN (SELECT ug_user FROM `user_groups` WHERE ug_group = 'bot' AND (ug_expiry IS NULL OR ug_expiry >= '20250515145012') )) GROUP BY rev_user ORDER BY page_count DESC LIMIT 50 ) UNION (SELECT actor_rev_user.actor_user AS `rev_user`,COUNT(DISTINCT rev_page) AS `page_count`,COUNT(rev_id) AS `rev_count` FROM `revision` JOIN `actor` `actor_rev_user` ON ((actor_rev_user.actor_id = rev_actor)) WHERE (rev_timestamp > '20250415145012') AND (actor_rev_user.actor_user NOT IN (SELECT ipb_user FROM `ipblocks` WHERE ipb_user <> 0 )) AND (actor_rev_user.actor_user NOT IN (SELECT ug_user FROM `user_groups` WHERE ug_group = 'bot' AND (ug_expiry IS NULL OR ug_expiry >= '20250515145012') )) GROUP BY rev_user ORDER BY rev_count DESC LIMIT 50 )) `s` ON ((user_id=rev_user)) GROUP BY user_name ORDER BY wiki_rank DESC LIMIT 50
Backtrace:

from /var/www/html/includes/libs/rdbms/database/Database.php(1198)
#0 /var/www/html/includes/libs/rdbms/database/Database.php(1182): Wikimedia\Rdbms\Database->getQueryException(string, int, string, string)
#1 /var/www/html/includes/libs/rdbms/database/Database.php(1156): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, int, string, string)
#2 /var/www/html/includes/libs/rdbms/database/Database.php(647): Wikimedia\Rdbms\Database->reportQueryError(string, int, string, string, bool)
#3 /var/www/html/includes/libs/rdbms/database/Database.php(1345): Wikimedia\Rdbms\Database->query(Wikimedia\Rdbms\Query, string)
#4 /var/www/html/includes/libs/rdbms/database/DBConnRef.php(127): Wikimedia\Rdbms\Database->select(array, array, array, string, array, array)
#5 /var/www/html/includes/libs/rdbms/database/DBConnRef.php(351): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#6 /var/www/html/extensions/ContributionScores/src/ContributionScores.php(193): Wikimedia\Rdbms\DBConnRef->select(array, array, array, string, array, array)
#7 /var/www/html/extensions/ContributionScores/src/ContributionScores.php(235): ContributionScores::getContributionScoreData(int, int)
#8 /var/www/html/includes/libs/objectcache/WANObjectCache.php(1809): ContributionScores->{closure}(bool, int, array, null, array)
#9 /var/www/html/includes/libs/objectcache/WANObjectCache.php(1623): Wikimedia\ObjectCache\WANObjectCache->fetchOrRegenerate(string, int, Closure, array, array)
#10 /var/www/html/extensions/ContributionScores/src/ContributionScores.php(236): Wikimedia\ObjectCache\WANObjectCache->getWithSetCallback(string, int, Closure)
#11 /var/www/html/extensions/ContributionScores/src/ContributionScores.php(369): ContributionScores->genContributionScoreTable(int, int, string, string)
#12 /var/www/html/extensions/ContributionScores/src/ContributionScores.php(319): ContributionScores->showInclude(string)
#13 /var/www/html/includes/specialpage/SpecialPage.php(728): ContributionScores->execute(string)
#14 /var/www/html/includes/specialpage/SpecialPageFactory.php(1724): MediaWiki\SpecialPage\SpecialPage->run(string)
#15 /var/www/html/includes/specialpage/SpecialPageFactory.php(1791): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, MediaWiki\Context\RequestContext, bool, MediaWiki\Linker\LinkRenderer)
#16 /var/www/html/includes/parser/Parser.php(3215): MediaWiki\SpecialPage\SpecialPageFactory->capturePath(MediaWiki\Title\Title, MediaWiki\Context\RequestContext, MediaWiki\Linker\LinkRenderer)
#17 /var/www/html/includes/parser/PPFrame_Hash.php(280): MediaWiki\Parser\Parser->braceSubstitution(array, MediaWiki\Parser\PPFrame_Hash)
#18 /var/www/html/includes/parser/Parser.php(2951): MediaWiki\Parser\PPFrame_Hash->expand(MediaWiki\Parser\PPNode_Hash_Tree, int)
#19 /var/www/html/includes/parser/Parser.php(1599): MediaWiki\Parser\Parser->replaceVariables(string)
#20 /var/www/html/includes/parser/Parser.php(701): MediaWiki\Parser\Parser->internalParse(string)
#21 /var/www/html/includes/content/WikitextContentHandler.php(384): MediaWiki\Parser\Parser->parse(string, MediaWiki\Title\Title, MediaWiki\Parser\ParserOptions, bool, bool, int)
#22 /var/www/html/includes/content/ContentHandler.php(1692): MediaWiki\Content\WikitextContentHandler->fillParserOutput(MediaWiki\Content\WikitextContent, MediaWiki\Content\Renderer\ContentParseParams, MediaWiki\Parser\ParserOutput)
#23 /var/www/html/includes/content/Renderer/ContentRenderer.php(79): MediaWiki\Content\ContentHandler->getParserOutput(MediaWiki\Content\WikitextContent, MediaWiki\Content\Renderer\ContentParseParams)
#24 /var/www/html/includes/Revision/RenderedRevision.php(264): MediaWiki\Content\Renderer\ContentRenderer->getParserOutput(MediaWiki\Content\WikitextContent, MediaWiki\Title\Title, MediaWiki\Revision\RevisionStoreRecord, MediaWiki\Parser\ParserOptions, array)
#25 /var/www/html/includes/Revision/RenderedRevision.php(236): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(MediaWiki\Content\WikitextContent, array)
#26 /var/www/html/includes/Revision/RevisionRenderer.php(239): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string, array)
#27 /var/www/html/includes/Revision/RevisionRenderer.php(172): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, MediaWiki\Parser\ParserOptions, array)
#28 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
#29 /var/www/html/includes/Revision/RenderedRevision.php(199): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
#30 /var/www/html/includes/poolcounter/PoolWorkArticleView.php(106): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#31 /var/www/html/includes/poolcounter/PoolWorkArticleViewCurrent.php(123): MediaWiki\PoolCounter\PoolWorkArticleView->renderRevision(null, bool, string)
#32 /var/www/html/includes/poolcounter/PoolCounterWork.php(171): MediaWiki\PoolCounter\PoolWorkArticleViewCurrent->doWork()
#33 /var/www/html/includes/page/ParserOutputAccess.php(362): MediaWiki\PoolCounter\PoolCounterWork->execute()
#34 /var/www/html/includes/page/Article.php(828): MediaWiki\Page\ParserOutputAccess->getParserOutput(WikiPage, MediaWiki\Parser\ParserOptions, MediaWiki\Revision\RevisionStoreRecord, int)
#35 /var/www/html/includes/page/Article.php(547): Article->generateContentOutput(MediaWiki\User\User, MediaWiki\Parser\ParserOptions, int, MediaWiki\Output\OutputPage, array)
#36 /var/www/html/includes/actions/ViewAction.php(78): Article->view()
#37 /var/www/html/includes/actions/ActionEntryPoint.php(733): ViewAction->show()
#38 /var/www/html/includes/actions/ActionEntryPoint.php(510): MediaWiki\Actions\ActionEntryPoint->performAction(Article, MediaWiki\Title\Title)
#39 /var/www/html/includes/actions/ActionEntryPoint.php(146): MediaWiki\Actions\ActionEntryPoint->performRequest()
#40 /var/www/html/includes/MediaWikiEntryPoint.php(200): MediaWiki\Actions\ActionEntryPoint->execute()
#41 /var/www/html/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#42 {main}

What should have happened instead?:

It should have no table deletion happened. It is possible to reproduce it by inserting the SQL table dump (of the table ipblock) and running the update.php script.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

MediaWiki: 1.43.0
Contributors: 2.1

Other information (browser name/version, screenshots, etc.):