==== Error ====
* mwversion: 1.44.0-wmf.19
* reqId: `8b961d04-c737-441c-8558-6edf6f1a3e2d`
* [[ https://logstash.wikimedia.org/app/dashboards#/view/AXFV7JE83bOlOASGccsT?_g=(time:(from:'2025-03-11T22:43:31.597Z',to:'2025-03-12T22:55:05.319Z'))&_a=(query:(query_string:(query:'reqId:%228b961d04-c737-441c-8558-6edf6f1a3e2d%22'))) | Find reqId in Logstash ]]
```name=normalized_message,lines=10
[{reqId}] {exception_url} RuntimeException: Can\'t reblock a user with multiple blocks already present. Update calling code for multiblocks, providing a specific block to update.
```
| Frame | Location | Call
| -- | -- | --
| from | [[ https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+blame/refs/heads/wmf/1.44.0-wmf.19/includes/block/BlockUser.php#628 | /srv/mediawiki/php-1.44.0-wmf.19/includes/block/BlockUser.php(628) ]] |
| #0 | [[ https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+blame/refs/heads/wmf/1.44.0-wmf.19/includes/block/BlockUser.php#566 | /srv/mediawiki/php-1.44.0-wmf.19/includes/block/BlockUser.php(566) ]] | MediaWiki\Block\BlockUser->placeBlockInternal(bool)
| #1 | [[ https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+blame/refs/heads/wmf/1.44.0-wmf.19/includes/block/BlockUser.php#491 | /srv/mediawiki/php-1.44.0-wmf.19/includes/block/BlockUser.php(491) ]] | MediaWiki\Block\BlockUser->placeBlockUnsafe(bool)
| #2 | [[ https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+blame/refs/heads/wmf/1.44.0-wmf.19/includes/specials/SpecialBlock.php#1117 | /srv/mediawiki/php-1.44.0-wmf.19/includes/specials/SpecialBlock.php(1117) ]] | MediaWiki\Block\BlockUser->placeBlock(bool)
| #3 | [[ https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+blame/refs/heads/wmf/1.44.0-wmf.19/includes/specials/SpecialBlock.php#1201 | /srv/mediawiki/php-1.44.0-wmf.19/includes/specials/SpecialBlock.php(1201) ]] | MediaWiki\Specials\SpecialBlock::processFormInternal(array, MediaWiki\User\User, MediaWiki\Block\UserBlockCommandFactory, MediaWiki\Block\BlockTargetFactory)
| #4 | [[ https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+blame/refs/heads/wmf/1.44.0-wmf.19/includes/htmlform/HTMLForm.php#824 | /srv/mediawiki/php-1.44.0-wmf.19/includes/htmlform/HTMLForm.php(824) ]] | MediaWiki\Specials\SpecialBlock->onSubmit(array, MediaWiki\HTMLForm\OOUIHTMLForm)
| #5 | [[ https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+blame/refs/heads/wmf/1.44.0-wmf.19/includes/htmlform/HTMLForm.php#705 | /srv/mediawiki/php-1.44.0-wmf.19/includes/htmlform/HTMLForm.php(705) ]] | MediaWiki\HTMLForm\HTMLForm->trySubmit()
| #6 | [[ https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+blame/refs/heads/wmf/1.44.0-wmf.19/includes/htmlform/HTMLForm.php#721 | /srv/mediawiki/php-1.44.0-wmf.19/includes/htmlform/HTMLForm.php(721) ]] | MediaWiki\HTMLForm\HTMLForm->tryAuthorizedSubmit()
| #7 | [[ https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+blame/refs/heads/wmf/1.44.0-wmf.19/includes/specialpage/FormSpecialPage.php#240 | /srv/mediawiki/php-1.44.0-wmf.19/includes/specialpage/FormSpecialPage.php(240) ]] | MediaWiki\HTMLForm\HTMLForm->show()
| #8 | [[ https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+blame/refs/heads/wmf/1.44.0-wmf.19/includes/specials/SpecialBlock.php#150 | /srv/mediawiki/php-1.44.0-wmf.19/includes/specials/SpecialBlock.php(150) ]] | MediaWiki\SpecialPage\FormSpecialPage->execute(string)
| #9 | [[ https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+blame/refs/heads/wmf/1.44.0-wmf.19/includes/specialpage/SpecialPage.php#729 | /srv/mediawiki/php-1.44.0-wmf.19/includes/specialpage/SpecialPage.php(729) ]] | MediaWiki\Specials\SpecialBlock->execute(string)
| #10 | [[ https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+blame/refs/heads/wmf/1.44.0-wmf.19/includes/specialpage/SpecialPageFactory.php#1737 | /srv/mediawiki/php-1.44.0-wmf.19/includes/specialpage/SpecialPageFactory.php(1737) ]] | MediaWiki\SpecialPage\SpecialPage->run(string)
| #11 | [[ https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+blame/refs/heads/wmf/1.44.0-wmf.19/includes/actions/ActionEntryPoint.php#503 | /srv/mediawiki/php-1.44.0-wmf.19/includes/actions/ActionEntryPoint.php(503) ]] | MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, MediaWiki\Context\RequestContext)
| #12 | [[ https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+blame/refs/heads/wmf/1.44.0-wmf.19/includes/actions/ActionEntryPoint.php#145 | /srv/mediawiki/php-1.44.0-wmf.19/includes/actions/ActionEntryPoint.php(145) ]] | MediaWiki\Actions\ActionEntryPoint->performRequest()
| #13 | [[ https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+blame/refs/heads/wmf/1.44.0-wmf.19/includes/MediaWikiEntryPoint.php#202 | /srv/mediawiki/php-1.44.0-wmf.19/includes/MediaWikiEntryPoint.php(202) ]] | MediaWiki\Actions\ActionEntryPoint->execute()
| #14 | [[ https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+blame/refs/heads/wmf/1.44.0-wmf.19/index.php#58 | /srv/mediawiki/php-1.44.0-wmf.19/index.php(58) ]] | MediaWiki\MediaWikiEntryPoint->run()
| #15 | [[ https://gerrit.wikimedia.org/r/plugins/gitiles/operations/mediawiki-config/+blame/refs/heads/master/w/index.php#3 | /srv/mediawiki/w/index.php(3) ]] | require(string)
| #16 | {main} |
==== Impact ====
* Some users have two `block_target` rows. These users cannot be unblocked.
==== Notes ====
See also: {T387723}, {T387730}
### **Derived Requirement**
Ensure that **Special:Block** properly handles users/IPs with multiple existing blocks by:
- Preventing the **RuntimeException: Can't reblock a user with multiple blocks already present.**
- Allowing unblock operations to function correctly even when multiple `block_target` rows exist.
- Updating the calling code for **multiblocks** to provide a specific block to update, instead of failing with an exception.
### **Test Steps**
#### **Test Case 1: Verify that Special:Block does not throw a RuntimeException when reblocking a user with multiple existing blocks**
1. Navigate to **Special:Block** on a wiki where **multiblocks** and **codex**are enabled.
2. Enter a target **user/IP** and apply a **first block**.
3. Apply a **second block** on the same user/IP.
4. Turn off multiblocks and Codex Special:Block
4. Attempt to reblock the **same user/IP** with a different expiration or block reason.
5. ✅❓❌⬜ **AC1:** Confirm that the system **does not throw a RuntimeException** and allows reblocking without errors.
6. ✅❓❌⬜ **AC2:** Confirm that the **existing blocks are correctly updated or preserved** without corruption.