Page MenuHomePhabricator

When logging into an account with an incorrect password, CheckUser attempts to create a actor for an IP, which fatals
Closed, DuplicatePublic

Description

I logged into an account on my localhost (with both CheckUser and Temporary accounts enabled) using an incorrect password. As a result, the CheckUser extension apparently attempts creating an actor for an IP user:

[951bc956b8edbaf72d17f612] /w/index.php?title=Special:UserLogin&returnto=Main+Page CannotCreateActorException: Cannot create an actor for an IP user when temporary accounts are enabled

Backtrace:

from /var/www/html/w/includes/user/ActorStore.php(639)
#0 /var/www/html/w/includes/user/ActorStore.php(416): MediaWiki\User\ActorStore->validateActorForInsertion()
#1 /var/www/html/w/extensions/CheckUser/src/Hooks.php(346): MediaWiki\User\ActorStore->acquireActorId()
#2 /var/www/html/w/extensions/CheckUser/src/Hooks.php(722): MediaWiki\CheckUser\Hooks::insertIntoCuPrivateEventTable()
#3 /var/www/html/w/includes/HookContainer/HookContainer.php(159): MediaWiki\CheckUser\Hooks->onAuthManagerLoginAuthenticateAudit()
#4 /var/www/html/w/includes/HookContainer/HookRunner.php(893): MediaWiki\HookContainer\HookContainer->run()
#5 /var/www/html/w/includes/auth/AuthManager.php(463): MediaWiki\HookContainer\HookRunner->onAuthManagerLoginAuthenticateAudit()
#6 /var/www/html/w/includes/specialpage/AuthManagerSpecialPage.php(390): MediaWiki\Auth\AuthManager->beginAuthentication()
#7 /var/www/html/w/includes/specialpage/AuthManagerSpecialPage.php(524): MediaWiki\SpecialPage\AuthManagerSpecialPage->performAuthenticationStep()
#8 [internal function]: MediaWiki\SpecialPage\AuthManagerSpecialPage->handleFormSubmit()
#9 /var/www/html/w/includes/htmlform/HTMLForm.php(794): call_user_func()
#10 /var/www/html/w/includes/specialpage/AuthManagerSpecialPage.php(455): MediaWiki\HTMLForm\HTMLForm->trySubmit()
#11 /var/www/html/w/includes/specialpage/LoginSignupSpecialPage.php(336): MediaWiki\SpecialPage\AuthManagerSpecialPage->trySubmit()
#12 /var/www/html/w/includes/specialpage/SpecialPage.php(720): MediaWiki\SpecialPage\LoginSignupSpecialPage->execute()
#13 /var/www/html/w/includes/specialpage/SpecialPageFactory.php(1653): MediaWiki\SpecialPage\SpecialPage->run()
#14 /var/www/html/w/includes/actions/ActionEntryPoint.php(504): MediaWiki\SpecialPage\SpecialPageFactory->executePath()
#15 /var/www/html/w/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest()
#16 /var/www/html/w/includes/MediaWikiEntryPoint.php(199): MediaWiki\Actions\ActionEntryPoint->execute()
#17 /var/www/html/w/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#18 {main}

Successful logins attempt to work correctly.

I tried pulling CheckUser and MediaWiki-Core, and it did not appear to help. My current versions:

urbanecm@wmf3345 CheckUser % git show -s HEAD
commit f432d2c0ad5a271f5940736d927fe57fd2a3dacc (HEAD -> master, origin/master, origin/HEAD)
Author: Translation updater bot <l10n-bot@translatewiki.net>
Date:   Fri Feb 23 08:43:59 2024 +0100

    Localisation updates from https://translatewiki.net.
    
    Change-Id: I0f2b94c57f3c6aaff3b9d016d6666ec71e557a81
urbanecm@wmf3345 CheckUser % 

urbanecm@wmf3345 core % git show -s HEAD
commit a47a5e3c0591c4bce2428ae0fc5f1dbdb2809ca3 (HEAD -> master, origin/master, origin/HEAD)
Author: [BOT] Translation updater bot <l10n-bot@translatewiki.net>
Date:   Fri Feb 23 08:17:53 2024 +0100

    Localisation updates from https://translatewiki.net.
    
    Change-Id: I6c4340e86dc10c3f8dd60d65a0ff8927284a0905
urbanecm@wmf3345 core %

Event Timeline

Hi @Dreamy_Jazz, do you have any idea why this could be happening, and whether I should try updating something else, or whether this is an actual error in CheckUser codebase?

Hi. This is an actual error but has been described in T353953: Don't use actor IDs for private CheckUser events when these actions are performed by IP addresses which is marked as a blocker for testwiki release.

As such, I will close this as a duplicate. If you have any thoughts on the direction I've gone in the patches, do let me know. The idea behind these patches is that:

  • We are not making an exception of saving IP addresses to the actor table for these private events (an exception is made for imports currently)
  • We can't assign an actor ID of 0 (otherwise we would need a LEFT JOIN and that brings it's own challenges).