Page MenuHomePhabricator

"MediaWiki\Exception\CannotCreateActorException: Cannot create an actor for an IP user when temporary accounts are enabled" when using Special:Translate
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
  • service.version: 1.45.0-wmf.15
  • timestamp: 2025-08-27T00:33:33.468Z
  • labels.phpversion: 8.1.33
  • trace.id: ac5349a8-c61a-4258-81ae-34736016bc16
  • Find trace.id in Logstash
labels.normalized_message
[{reqId}] {exception_url}   MediaWiki\Exception\CannotCreateActorException: Cannot create an actor for an IP user when temporary accounts are enabled
referrer
https://wikimania.m.wikimedia.org/w/index.php?action=page&filter=&group=page-2025%3AScholarships&language=id&title=Special%3ATranslate
FrameLocationCall
from/srv/mediawiki/php-1.45.0-wmf.15/includes/user/ActorStore.php(635)
#0/srv/mediawiki/php-1.45.0-wmf.15/includes/user/ActorStore.php(407)MediaWiki\User\ActorStore->validateActorForInsertion(MediaWiki\User\User)
#1/srv/mediawiki/php-1.45.0-wmf.15/includes/Revision/RevisionStore.php(886)MediaWiki\User\ActorStore->acquireActorId(MediaWiki\User\User, Wikimedia\Rdbms\DatabaseMySQL)
#2/srv/mediawiki/php-1.45.0-wmf.15/includes/Revision/RevisionStore.php(765)MediaWiki\Revision\RevisionStore->getBaseRevisionRow(Wikimedia\Rdbms\DatabaseMySQL, MediaWiki\Revision\MutableRevisionRecord, int)
#3/srv/mediawiki/php-1.45.0-wmf.15/includes/Revision/RevisionStore.php(631)MediaWiki\Revision\RevisionStore->insertRevisionRowOn(Wikimedia\Rdbms\DatabaseMySQL, MediaWiki\Revision\MutableRevisionRecord, int)
#4/srv/mediawiki/php-1.45.0-wmf.15/includes/Revision/RevisionStore.php(482)MediaWiki\Revision\RevisionStore->insertRevisionInternal(MediaWiki\Revision\MutableRevisionRecord, Wikimedia\Rdbms\DatabaseMySQL, MediaWiki\User\User, MediaWiki\CommentStore\CommentStoreComment, MediaWiki\Page\PageIdentityValue, int, int)
#5/srv/mediawiki/php-1.45.0-wmf.15/includes/libs/rdbms/database/Database.php(2334)MediaWiki\Revision\RevisionStore->MediaWiki\Revision\{closure}(Wikimedia\Rdbms\DatabaseMySQL, string)
#6/srv/mediawiki/php-1.45.0-wmf.15/includes/libs/rdbms/database/DBConnRef.php(127)Wikimedia\Rdbms\Database->doAtomicSection(string, Closure)
#7/srv/mediawiki/php-1.45.0-wmf.15/includes/libs/rdbms/database/DBConnRef.php(754)Wikimedia\Rdbms\DBConnRef->__call(string, array)
#8/srv/mediawiki/php-1.45.0-wmf.15/includes/Revision/RevisionStore.php(490)Wikimedia\Rdbms\DBConnRef->doAtomicSection(string, Closure)
#9/srv/mediawiki/php-1.45.0-wmf.15/includes/Storage/PageUpdater.php(1446)MediaWiki\Revision\RevisionStore->insertRevisionOn(MediaWiki\Revision\MutableRevisionRecord, Wikimedia\Rdbms\DBConnRef)
#10/srv/mediawiki/php-1.45.0-wmf.15/includes/Storage/PageUpdater.php(984)MediaWiki\Storage\PageUpdater->doModify(MediaWiki\CommentStore\CommentStoreComment)
#11/srv/mediawiki/php-1.45.0-wmf.15/includes/Storage/PageUpdater.php(828)MediaWiki\Storage\PageUpdater->saveRevision(MediaWiki\CommentStore\CommentStoreComment, int)
#12/srv/mediawiki/php-1.45.0-wmf.15/extensions/Translate/src/TranslatorInterface/TranslateEditAddons.php(175)MediaWiki\Storage\PageUpdater->saveDummyRevision(MediaWiki\CommentStore\CommentStoreComment, int)
#13/srv/mediawiki/php-1.45.0-wmf.15/includes/HookContainer/HookContainer.php(155)MediaWiki\Extension\Translate\TranslatorInterface\TranslateEditAddons::onSaveComplete(MediaWiki\Page\WikiPage, MediaWiki\User\User, string, int, MediaWiki\Revision\RevisionStoreRecord, MediaWiki\Storage\EditResult)
#14/srv/mediawiki/php-1.45.0-wmf.15/includes/HookContainer/HookRunner.php(3262)MediaWiki\HookContainer\HookContainer->run(string, array)
#15/srv/mediawiki/php-1.45.0-wmf.15/includes/Storage/PageUpdater.php(1736)MediaWiki\HookContainer\HookRunner->onPageSaveComplete(MediaWiki\Page\WikiPage, MediaWiki\User\User, string, int, MediaWiki\Revision\RevisionStoreRecord, MediaWiki\Storage\EditResult)
#16/srv/mediawiki/php-1.45.0-wmf.15/includes/libs/rdbms/database/Database.php(2334)MediaWiki\Storage\PageUpdater->MediaWiki\Storage\{closure}(Wikimedia\Rdbms\DatabaseMySQL, string)
#17/srv/mediawiki/php-1.45.0-wmf.15/includes/libs/rdbms/database/DBConnRef.php(127)Wikimedia\Rdbms\Database->doAtomicSection(string, Closure)
#18/srv/mediawiki/php-1.45.0-wmf.15/includes/libs/rdbms/database/DBConnRef.php(754)Wikimedia\Rdbms\DBConnRef->__call(string, array)
#19/srv/mediawiki/php-1.45.0-wmf.15/includes/deferred/AtomicSectionUpdate.php(41)Wikimedia\Rdbms\DBConnRef->doAtomicSection(string, Closure)
#20/srv/mediawiki/php-1.45.0-wmf.15/includes/deferred/DeferredUpdates.php(459)MediaWiki\Deferred\AtomicSectionUpdate->doUpdate()
#21/srv/mediawiki/php-1.45.0-wmf.15/includes/deferred/DeferredUpdates.php(201)MediaWiki\Deferred\DeferredUpdates::attemptUpdate(MediaWiki\Deferred\AtomicSectionUpdate)
#22/srv/mediawiki/php-1.45.0-wmf.15/includes/deferred/DeferredUpdates.php(288)MediaWiki\Deferred\DeferredUpdates::run(MediaWiki\Deferred\AtomicSectionUpdate)
#23/srv/mediawiki/php-1.45.0-wmf.15/includes/deferred/DeferredUpdatesScope.php(243)MediaWiki\Deferred\DeferredUpdates::MediaWiki\Deferred\{closure}(MediaWiki\Deferred\AtomicSectionUpdate, int)
#24/srv/mediawiki/php-1.45.0-wmf.15/includes/deferred/DeferredUpdatesScope.php(172)MediaWiki\Deferred\DeferredUpdatesScope->processStageQueue(int, int, Closure)
#25/srv/mediawiki/php-1.45.0-wmf.15/includes/deferred/DeferredUpdates.php(307)MediaWiki\Deferred\DeferredUpdatesScope->processUpdates(int, Closure)
#26/srv/mediawiki/php-1.45.0-wmf.15/includes/MediaWikiEntryPoint.php(302)MediaWiki\Deferred\DeferredUpdates::doUpdates(int)
#27/srv/mediawiki/php-1.45.0-wmf.15/includes/MediaWikiEntryPoint.php(187)MediaWiki\MediaWikiEntryPoint->commitMainTransaction()
#28/srv/mediawiki/php-1.45.0-wmf.15/includes/MediaWikiEntryPoint.php(170)MediaWiki\MediaWikiEntryPoint->doPrepareForOutput()
#29/srv/mediawiki/php-1.45.0-wmf.15/includes/MediaWiki.php(87)MediaWiki\MediaWikiEntryPoint->prepareForOutput()
#30/srv/mediawiki/php-1.45.0-wmf.15/includes/api/ApiMain.php(983)MediaWiki::preOutputCommit(MediaWiki\Context\DerivativeContext)
#31/srv/mediawiki/php-1.45.0-wmf.15/includes/api/ApiMain.php(926)MediaWiki\Api\ApiMain->executeActionWithErrorHandling()
#32/srv/mediawiki/php-1.45.0-wmf.15/includes/api/ApiEntryPoint.php(152)MediaWiki\Api\ApiMain->execute()
#33/srv/mediawiki/php-1.45.0-wmf.15/includes/MediaWikiEntryPoint.php(198)MediaWiki\Api\ApiEntryPoint->execute()
#34/srv/mediawiki/php-1.45.0-wmf.15/api.php(44)MediaWiki\MediaWikiEntryPoint->run()
#35/srv/mediawiki/w/api.php(3)require(string)
#36{main}
Impact

Low, one occurrence on wikimaniawiki

Notes

Slightly different codepath (via getBaseRevisionRow) than resolved T390636 and T373318

Details

MediaWiki Version
1.45.0-wmf.15
Request URL
https://wikimania.wikimedia.org/w/api.php

Event Timeline

Dreamy_Jazz renamed this task from MediaWiki\Exception\CannotCreateActorException: Cannot create an actor for an IP user when temporary accounts are enabled to "MediaWiki\Exception\CannotCreateActorException: Cannot create an actor for an IP user when temporary accounts are enabled" when using Special:Translate.Aug 27 2025, 10:29 AM
Pppery subscribed.

This seems like core's fault rather than Translate's; all Translate does here is take a user identity as an argument to a hook from core, and then pass it back into core.

(Tagging MW-Interfaces-Team since they've touched a lot of this code recently)

Actually, it may be Translate that needs an update here. I think what happens is:

  1. An IP user (i.e. someone who doesn’t have a temp account yet) does a null edit to a translation unit.
  2. Since it’s a null edit, the main edit causes no auto-creation (no revision entry, no need to create a temp user).
  3. The hook handler is called with what’s still an IP user.
  4. We ask core to create a dummy revision in the name of the IP user, which it rejects.

Since the main edit doesn’t create any revision, it’s a reasonable choice from core not to auto-create the temp user. On the other hand, it may cause even more bugs if we auto-create the user on our own, but other hook handlers still see the IP user. Maybe instead of the pure value object UserIdentity, the hook should get an object that allows calling ->autoCreate()?

Also it hasn't reoccurred since the original report.

Yeah, looking at https://wikimania.m.wikimedia.org/w/index.php?action=page&filter=&group=page-2025%3AScholarships&language=id&title=Special%3ATranslate while logged out says that I need to get permission to edit translations.

Therefore, the fix we implemented in T403067: Temporary accounts: $wmgDisableAccountCreation causes temporary account autocreation to fail which was to disable all logged out editing on that wiki has worked for this specific instance

Dreamy_Jazz assigned this task to Tchanders.

When testing on a wiki with temporary accounts enabled and page translation available to logged out users, I cannot reproduce the issue.

Neither could I (locally); the temporary account got created as expected.