What is the problem?
When creating a global block with autoblock enabled on the non-central wiki and the user you are trying to block has several entries in the cuci_user table, I get the below exception:
[cdc2d3f26403275f14dd3384] /wiki/Special:GlobalBlock Wikimedia\Assert\PreconditionException: Expected MediaWiki\User\UserIdentityValue to belong to the local wiki, but it belongs to 'commonswiki'
Backtrace:
from /var/www/html/w/includes/dao/WikiAwareEntityTrait.php(59)
#0 /var/www/html/w/includes/user/UserIdentityValue.php(129): MediaWiki\User\UserIdentityValue->assertWiki()
#1 /var/www/html/w/extensions/CheckUser/src/HookHandler/GlobalBlockingHandler.php(150): MediaWiki\User\UserIdentityValue->getId()
#2 /var/www/html/w/extensions/CheckUser/src/HookHandler/GlobalBlockingHandler.php(103): MediaWiki\CheckUser\HookHandler\GlobalBlockingHandler->fetchIPAddressesFromLocalWiki()
#3 /var/www/html/w/includes/HookContainer/HookContainer.php(159): MediaWiki\CheckUser\HookHandler\GlobalBlockingHandler->onGlobalBlockingGetRetroactiveAutoblockIPs()
#4 /var/www/html/w/extensions/GlobalBlocking/includes/Hooks/HookRunner.php(20): MediaWiki\HookContainer\HookContainer->run()
#5 /var/www/html/w/extensions/GlobalBlocking/includes/Services/GlobalBlockManager.php(247): MediaWiki\Extension\GlobalBlocking\Hooks\HookRunner->onGlobalBlockingGetRetroactiveAutoblockIPs()
#6 /var/www/html/w/extensions/GlobalBlocking/includes/Services/GlobalBlockManager.php(125): MediaWiki\Extension\GlobalBlocking\Services\GlobalBlockManager->insertBlockAfterChecks()
#7 /var/www/html/w/extensions/GlobalBlocking/includes/Services/GlobalBlockManager.php(287): MediaWiki\Extension\GlobalBlocking\Services\GlobalBlockManager->insertBlock()
#8 /var/www/html/w/extensions/GlobalBlocking/includes/Special/SpecialGlobalBlock.php(348): MediaWiki\Extension\GlobalBlocking\Services\GlobalBlockManager->block()
#9 [internal function]: MediaWiki\Extension\GlobalBlocking\Special\SpecialGlobalBlock->onSubmit()
#10 /var/www/html/w/includes/htmlform/HTMLForm.php(822): call_user_func()
#11 /var/www/html/w/includes/htmlform/HTMLForm.php(703): MediaWiki\HTMLForm\HTMLForm->trySubmit()
#12 /var/www/html/w/includes/htmlform/HTMLForm.php(719): MediaWiki\HTMLForm\HTMLForm->tryAuthorizedSubmit()
#13 /var/www/html/w/includes/specialpage/FormSpecialPage.php(241): MediaWiki\HTMLForm\HTMLForm->show()
#14 /var/www/html/w/extensions/GlobalBlocking/includes/Special/SpecialGlobalBlock.php(76): MediaWiki\SpecialPage\FormSpecialPage->execute()
#15 /var/www/html/w/includes/specialpage/SpecialPage.php(728): MediaWiki\Extension\GlobalBlocking\Special\SpecialGlobalBlock->execute()
#16 /var/www/html/w/includes/specialpage/SpecialPageFactory.php(1726): MediaWiki\SpecialPage\SpecialPage->run()
#17 /var/www/html/w/includes/actions/ActionEntryPoint.php(504): MediaWiki\SpecialPage\SpecialPageFactory->executePath()
#18 /var/www/html/w/includes/actions/ActionEntryPoint.php(146): MediaWiki\Actions\ActionEntryPoint->performRequest()
#19 /var/www/html/w/includes/MediaWikiEntryPoint.php(200): MediaWiki\Actions\ActionEntryPoint->execute()
#20 /var/www/html/w/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#21 {main}I can successfully block the same user from my central wiki.
Steps to reproduce problem
- Setup a wiki with several wikis connected with CentralAuth, GlobalBlocking and CheckUser and config $wgGlobalBlockingEnableAutoblocks = true; $wgAutoCreateTempUser['enabled'] = true;
- Login as a user and make edits on several different wikis
- Login as a steward on one of the wikis which is not the central wiki (i.e. not the value of $wgCentralAuthLoginWiki)
- Go to Special:GlobalBlock, enter the user from step 2, check "Automatically globally block the last IP address..." (it is by default) and submit
Expected behaviour: Global block is created.
Observed behaviour: Above exception.
Environment
Wiki(s): local docker GlobalBlocking – (ce531e3) 14:02, 22 October 2024. CheckUser 2.5 (6e55823) 10:18, 24 October 2024.