Hi, when i tried to import a dump (with users that do not exist in that wiki) it causes a actor exception:
[235f86487b2e1d444e16276f] [no req] CannotCreateActorException from line 2456 of /srv/mediawiki/w/includes/user/User.php: Cannot create an actor for a usable name that is not an existing user Backtrace: #0 /srv/mediawiki/w/includes/ActorMigration.php(245): User->getActorId(Wikimedia\Rdbms\DBConnRef) #1 /srv/mediawiki/w/includes/Storage/RevisionStore.php(426): ActorMigration->getInsertValuesWithTempTable(Wikimedia\Rdbms\DBConnRef, string, User) #2 /srv/mediawiki/w/includes/Revision.php(1123): MediaWiki\Storage\RevisionStore->insertRevisionOn(MediaWiki\Storage\MutableRevisionRecord, Wikimedia\Rdbms\DBConnRef) #3 /srv/mediawiki/w/includes/import/ImportableOldRevisionImporter.php(129): Revision->insertOn(Wikimedia\Rdbms\DBConnRef) #4 /srv/mediawiki/w/includes/import/WikiRevision.php(602): ImportableOldRevisionImporter->import(WikiRevision) #5 /srv/mediawiki/w/includes/import/WikiImporter.php(366): WikiRevision->importOldRevision() #6 /srv/mediawiki/w/maintenance/importDump.php(196): WikiImporter->importRevision(WikiRevision) #7 /srv/mediawiki/w/includes/import/WikiImporter.php(503): BackupReader->handleRevision(WikiRevision, WikiImporter) #8 /srv/mediawiki/w/includes/import/WikiImporter.php(943): WikiImporter->revisionCallback(WikiRevision) #9 /srv/mediawiki/w/includes/import/WikiImporter.php(859): WikiImporter->processRevision(array, array) #10 /srv/mediawiki/w/includes/import/WikiImporter.php(801): WikiImporter->handleRevision(array) #11 /srv/mediawiki/w/includes/import/WikiImporter.php(608): WikiImporter->handlePage() #12 /srv/mediawiki/w/maintenance/importDump.php(345): WikiImporter->doImport() #13 /srv/mediawiki/w/maintenance/importDump.php(278): BackupReader->importFromHandle(resource) #14 /srv/mediawiki/w/maintenance/importDump.php(114): BackupReader->importFromFile(string) #15 /srv/mediawiki/w/maintenance/doMaintenance.php(94): BackupReader->execute() #16 /srv/mediawiki/w/maintenance/importDump.php(350): require_once(string) #17 {main}
This should be fixed to work again.
Analysis by Anomie, copied from the comments:
It turns out the problem is because the <username> is containing a name with a lowercased first letter. That fails the isUsableName() check when https://github.com/wikimedia/mediawiki/blob/REL1_31/includes/user/ExternalUserNames.php#L76 is called. But the name gets canonicalized by the time it makes it to https://github.com/wikimedia/mediawiki/blob/REL1_31/includes/user/User.php#L2455.