Page MenuHomePhabricator

Access of global_block_whitelist table on closed wikis through Special:CentralAuth causes exceptions
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
  • service.version: 1.46.0-wmf.22
  • timestamp: 2026-04-02T23:18:10.379Z
  • labels.phpversion: 8.3.30
  • trace.id: b1b1baa8-24a7-4443-a65a-36006f16f5f4
  • Find trace.id in Logstash
labels.normalized_message
[{reqId}] {exception_url}   Wikimedia\Rdbms\DBQueryError: Error 1146: Table 'akwiki.global_block_whitelist' doesn't exist
Function: MediaWiki\Extension\GlobalBlocking\Services\GlobalBlockLocalStatusLookup::getLocalStatusInfo
Query: SELECT  gbw_by,gbw_reas
FrameLocationCall
from/srv/mediawiki/php-1.46.0-wmf.22/includes/libs/Rdbms/Database/Database.php(1230)
#0/srv/mediawiki/php-1.46.0-wmf.22/includes/libs/Rdbms/Database/Database.php(1214)Wikimedia\Rdbms\Database->getQueryException(string, int, string, string)
#1/srv/mediawiki/php-1.46.0-wmf.22/includes/libs/Rdbms/Database/Database.php(1188)Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, int, string, string)
#2/srv/mediawiki/php-1.46.0-wmf.22/includes/libs/Rdbms/Database/Database.php(644)Wikimedia\Rdbms\Database->reportQueryError(string, int, string, string, bool)
#3/srv/mediawiki/php-1.46.0-wmf.22/includes/libs/Rdbms/Database/Database.php(1368)Wikimedia\Rdbms\Database->query(Wikimedia\Rdbms\Query, string)
#4/srv/mediawiki/php-1.46.0-wmf.22/includes/libs/Rdbms/Database/Database.php(1378)Wikimedia\Rdbms\Database->select(array, array, array, string, array, array)
#5/srv/mediawiki/php-1.46.0-wmf.22/includes/libs/Rdbms/Database/DBConnRef.php(129)Wikimedia\Rdbms\Database->selectRow(array, array, array, string, array, array)
#6/srv/mediawiki/php-1.46.0-wmf.22/includes/libs/Rdbms/Database/DBConnRef.php(407)Wikimedia\Rdbms\DBConnRef->__call(string, array)
#7/srv/mediawiki/php-1.46.0-wmf.22/includes/libs/Rdbms/QueryBuilder/SelectQueryBuilder.php(809)Wikimedia\Rdbms\DBConnRef->selectRow(array, array, array, string, array, array)
#8/srv/mediawiki/php-1.46.0-wmf.22/extensions/GlobalBlocking/includes/Services/GlobalBlockLocalStatusLookup.php(81)Wikimedia\Rdbms\SelectQueryBuilder->fetchRow()
#9/srv/mediawiki/php-1.46.0-wmf.22/extensions/CentralAuth/includes/Special/SpecialCentralAuth.php(621)MediaWiki\Extension\GlobalBlocking\Services\GlobalBlockLocalStatusLookup->getLocalStatusInfo(int, string)
#10/srv/mediawiki/php-1.46.0-wmf.22/extensions/CentralAuth/includes/Special/SpecialCentralAuth.php(570)MediaWiki\Extension\CentralAuth\Special\SpecialCentralAuth->getGlobalBlockingExemptWikiTableRows()
#11/srv/mediawiki/php-1.46.0-wmf.22/extensions/CentralAuth/includes/Special/SpecialCentralAuth.php(251)MediaWiki\Extension\CentralAuth\Special\SpecialCentralAuth->showGlobalBlockingExemptWikisList()
#12/srv/mediawiki/php-1.46.0-wmf.22/includes/SpecialPage/SpecialPage.php(714)MediaWiki\Extension\CentralAuth\Special\SpecialCentralAuth->execute(string)
#13/srv/mediawiki/php-1.46.0-wmf.22/includes/SpecialPage/SpecialPageFactory.php(1713)MediaWiki\SpecialPage\SpecialPage->run(string)
#14/srv/mediawiki/php-1.46.0-wmf.22/includes/Actions/ActionEntryPoint.php(505)MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, MediaWiki\Context\RequestContext)
#15/srv/mediawiki/php-1.46.0-wmf.22/includes/Actions/ActionEntryPoint.php(145)MediaWiki\Actions\ActionEntryPoint->performRequest()
#16/srv/mediawiki/php-1.46.0-wmf.22/includes/MediaWikiEntryPoint.php(180)MediaWiki\Actions\ActionEntryPoint->execute()
#17/srv/mediawiki/php-1.46.0-wmf.22/index.php(44)MediaWiki\MediaWikiEntryPoint->run()
#18/srv/mediawiki/w/index.php(3)require(string)
#19{main}
Impact
Notes

Event Timeline

@Dreamy_Jazz akwiki is a closed wiki, so I guess that is why the table was dropped there. But for some reasons we still try to query it?

Yeah, MediaWiki-extensions-CentralAuth probably needs updating to have a list of wikis where GlobalBlocking is installed and only query from those (it currently assumes it's installed on every wiki that MediaWiki-extensions-CentralAuth would be able to show).

Relevant fix would be to ::getGlobalBlockingExemptWikiTableRows to check if the listed wiki is in $wmgUseGlobalBlocking (or some other appropriate config var that's defined by MediaWiki-extensions-CentralAuth)

I feel like this should be handled in the getLocalStatusInfo() method in GlobalBlocking. Maybe just a tableExists() check would be enough.

Also, it's weird that we allow GlobalBlocking to not be installed on some wikis in the farm. If I understand correctly, that means that global blocks don't apply to users on those wikis. I understand all such wikis are closed, so maybe it doesn't matter in practice, but it's still weird. The getLocalStatusInfo() method should probably make up a "fake" exemption info for those wikis, so that Special:CentralAuth can display it appropriately.

I feel like this should be handled in the getLocalStatusInfo() method in GlobalBlocking. Maybe just a tableExists() check would be enough.

AFAIK tableExists requires a maintainable DB connection (not just a primary DB)? Should be fine, but it's definitely not a normal pattern to do outside maintenance scripts as far as I can tell. Also feels like it would hide subtle bugs (to assume that the table not existing means the extension is not installed)

Also, it's weird that we allow GlobalBlocking to not be installed on some wikis in the farm. If I understand correctly, that means that global blocks don't apply to users on those wikis. I understand all such wikis are closed, so maybe it doesn't matter in practice, but it's still weird.

This was done to reduce the number of DB tables on production to improve performance, per request from the DBAs. No user should be able to do anything anyway on a closed wiki.

The getLocalStatusInfo() method should probably make up a "fake" exemption info for those wikis, so that Special:CentralAuth can display it appropriately.

Maybe, but again could introduce subtle bugs if the table is supposed to exist. Ideally I'd want it to throw unless we know it is deliberately not installed there and then the code that calls it should know that incase it needs other handling

Change #1268543 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/GlobalBlocking@master] GlobalBlockLocalStatusLookup: Remove unused constructor param

https://gerrit.wikimedia.org/r/1268543

Change #1268544 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/GlobalBlocking@master] GlobalBlockLocalStatusLookup: Support wikis that don't apply blocks

https://gerrit.wikimedia.org/r/1268544

Change #1268560 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[operations/mediawiki-config@master] Set $wgGlobalBlockingWikisWhereGlobalBlocksDoNotApply

https://gerrit.wikimedia.org/r/1268560

Dreamy_Jazz renamed this task from Wikimedia\Rdbms\DBQueryError: Error 1146: Table 'akwiki.global_block_whitelist' doesn't existFunction: MediaWiki\Extension\GlobalBlocking\Services\GlobalBlockLocalStatusLookup::getLocalStatusInfoQuery: SELECT gbw_by,gbw_reas to Access of global_block_whitelist table on closed wikis through Special:CentralAuth causes exceptions.Apr 7 2026, 1:26 PM
Dreamy_Jazz triaged this task as High priority.

Breaks Special:CentralAuth for all users who have accounts on closed wikis

Change #1268543 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@master] GlobalBlockLocalStatusLookup: Remove unused constructor param

https://gerrit.wikimedia.org/r/1268543

Change #1268544 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@master] GlobalBlockLocalStatusLookup: Support wikis that don't apply blocks

https://gerrit.wikimedia.org/r/1268544

Change #1268584 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/GlobalBlocking@wmf/1.46.0-wmf.23] GlobalBlockLocalStatusLookup: Remove unused constructor param

https://gerrit.wikimedia.org/r/1268584

Change #1268585 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/GlobalBlocking@wmf/1.46.0-wmf.23] GlobalBlockLocalStatusLookup: Support wikis that don't apply blocks

https://gerrit.wikimedia.org/r/1268585

Change #1268586 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/GlobalBlocking@wmf/1.46.0-wmf.22] GlobalBlockLocalStatusLookup: Remove unused constructor param

https://gerrit.wikimedia.org/r/1268586

Change #1268587 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/GlobalBlocking@wmf/1.46.0-wmf.22] GlobalBlockLocalStatusLookup: Support wikis that don't apply blocks

https://gerrit.wikimedia.org/r/1268587

Change #1268584 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@wmf/1.46.0-wmf.23] GlobalBlockLocalStatusLookup: Remove unused constructor param

https://gerrit.wikimedia.org/r/1268584

Change #1268585 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@wmf/1.46.0-wmf.23] GlobalBlockLocalStatusLookup: Support wikis that don't apply blocks

https://gerrit.wikimedia.org/r/1268585

Change #1268560 merged by jenkins-bot:

[operations/mediawiki-config@master] Set $wgGlobalBlockingWikisWhereGlobalBlocksDoNotApply

https://gerrit.wikimedia.org/r/1268560

Change #1268586 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@wmf/1.46.0-wmf.22] GlobalBlockLocalStatusLookup: Remove unused constructor param

https://gerrit.wikimedia.org/r/1268586

Change #1268587 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@wmf/1.46.0-wmf.22] GlobalBlockLocalStatusLookup: Support wikis that don't apply blocks

https://gerrit.wikimedia.org/r/1268587

Mentioned in SAL (#wikimedia-operations) [2026-04-07T15:44:51Z] <dreamyjazz@deploy1003> Started scap sync-world: Backport for [[gerrit:1268560|Set $wgGlobalBlockingWikisWhereGlobalBlocksDoNotApply (T422220)]], [[gerrit:1268584|GlobalBlockLocalStatusLookup: Remove unused constructor param (T422220)]], [[gerrit:1268586|GlobalBlockLocalStatusLookup: Remove unused constructor param (T422220)]], [[gerrit:1268585|GlobalBlockLocalStatusLookup: Support wikis that don't apply blocks (T42222

Mentioned in SAL (#wikimedia-operations) [2026-04-07T16:03:35Z] <dreamyjazz@deploy1003> stran, dreamyjazz: Backport for [[gerrit:1268560|Set $wgGlobalBlockingWikisWhereGlobalBlocksDoNotApply (T422220)]], [[gerrit:1268584|GlobalBlockLocalStatusLookup: Remove unused constructor param (T422220)]], [[gerrit:1268586|GlobalBlockLocalStatusLookup: Remove unused constructor param (T422220)]], [[gerrit:1268585|GlobalBlockLocalStatusLookup: Support wikis that don't apply blocks (T422220)]],

A_smart_kitten subscribed.

Also, it's weird that we allow GlobalBlocking to not be installed on some wikis in the farm. If I understand correctly, that means that global blocks don't apply to users on those wikis. I understand all such wikis are closed, so maybe it doesn't matter in practice, but it's still weird.

This was done to reduce the number of DB tables on production to improve performance, per request from the DBAs. No user should be able to do anything anyway on a closed wiki.

cross-reference: T420062: Uninstall PSI extensions on closed wikis which are not needed / T420052: Drop extensions from closed wikis where the database tables are unused / T420525: Drop global_block_whitelist from closed wikis

Mentioned in SAL (#wikimedia-operations) [2026-04-07T16:20:04Z] <dreamyjazz@deploy1003> Finished scap sync-world: Backport for [[gerrit:1268560|Set $wgGlobalBlockingWikisWhereGlobalBlocksDoNotApply (T422220)]], [[gerrit:1268584|GlobalBlockLocalStatusLookup: Remove unused constructor param (T422220)]], [[gerrit:1268586|GlobalBlockLocalStatusLookup: Remove unused constructor param (T422220)]], [[gerrit:1268585|GlobalBlockLocalStatusLookup: Support wikis that don't apply blocks (T4222

@Dreamy_Jazz the immediate issue has been resolved, but with an unintended result – "Wikis exempt from global block" should only list those which locally disabled the global block. It now shows a list of closed wikis + meta wiki (where global blocks never apply).

Screenshot 2026-04-07 at 20.23.28.png (684×868 px, 131 KB)

There might even be a feature in telling users that global blocks don't apply to metawiki (sometimes people are confused why globally blocked users can still edit on metawiki), but personally I don't think the issue is important enough to do that. We now have to scroll by this block before looking at the global account status and list of local accounts for every globally blocked account...

Screenshot 2026-04-07 at 20.24.54.png (1×1 px, 180 KB)

Dreamy_Jazz closed this task as Resolved.EditedApr 7 2026, 6:45 PM

@Dreamy_Jazz the immediate issue has been resolved, but with an unintended result – "Wikis exempt from global block" should only list those which locally disabled the global block. It now shows a list of closed wikis + meta wiki (where global blocks never apply).

Screenshot 2026-04-07 at 20.23.28.png (684×868 px, 131 KB)

There might even be a feature in telling users that global blocks don't apply to metawiki (sometimes people are confused why globally blocked users can still edit on metawiki), but personally I don't think the issue is important enough to do that. We now have to scroll by this block before looking at the global account status and list of local accounts for every globally blocked account...

Screenshot 2026-04-07 at 20.24.54.png (1×1 px, 180 KB)

I'd file a new task for this instead of reopening this task, because this is about the exception that was seen.

Personally I think it was a bug for this information to not be displayed, but I get that showing this info for closed wikis just shows more information on a page that is already long. Perhaps MediaWiki-extensions-CentralAuth can be updated to skip showing this when the block was not manually disabled or a class added such that site CSS could hide this info just for WMF wikis

Change #1268894 had a related patch set uploaded (by Mszwarc; author: Mszwarc):

[mediawiki/extensions/GlobalBlocking@master] Fix message mode in ...LocalStatusLookup::getLocalStatusInfo

https://gerrit.wikimedia.org/r/1268894

Change #1268894 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@master] Fix message mode in ...LocalStatusLookup::getLocalStatusInfo

https://gerrit.wikimedia.org/r/1268894

Change #1269971 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/GlobalBlocking@master] Make GlobalBlockLocalStatusLookup::doGlobalBlocksApplyOnWiki public

https://gerrit.wikimedia.org/r/1269971