⚓ T267477 CannotCreateActorException when renaming the currently-logged-in user
Page Menu
Phabricator
Create Task
Maniphest
T267477
CannotCreateActorException when renaming the currently-logged-in user
Closed, Resolved
Public
Actions
Edit Task
Edit Related Tasks...
Create Subtask
Edit Parent Tasks
Edit Subtasks
Merge Duplicates In
Close As Duplicate
Edit Related Objects...
Edit Commits
Edit Mocks
Mute Notifications
Protect as security issue
Assigned To
XtexChooser
Authored By
User670839245
Nov 7 2020, 2:39 PM
2020-11-07 14:39:08 (UTC+0)
Tags
MediaWiki-User-rename
(Backlog)
MW-1.44-notes (1.44.0-wmf.2; 2024-11-05)
Referenced Files
None
Subscribers
Aklapper
Ammarpad
AndrewDBate
Bawolff
DannyS712
FrozenPlum
kostajh
View All 12 Subscribers
Description
[exception] [55ef3d6d2b5a9078e582824f] /wiki/index.php/Special:%E9%87%8D%E5%91%BD%E5%90%8D%E7%94%A8%E6%88%B7 CannotCreateActorException from line 312 of C:\xampp\apps\mediawiki\htdocs\includes\ActorMigration.php: Failed to create actor ID for user_id=1 user_name="User670"
#0 C:\xampp\apps\mediawiki\htdocs\includes\ActorMigration.php(351): ActorMigration->getNewActorId(Wikimedia\Rdbms\MaintainableDBConnRef, User)
#1 C:\xampp\apps\mediawiki\htdocs\includes\logging\ManualLogEntry.php(295): ActorMigration->getInsertValues(Wikimedia\Rdbms\MaintainableDBConnRef, string, User)
#2 C:\xampp\apps\mediawiki\htdocs\extensions\Renameuser\includes\RenameuserSQL.php(346): ManualLogEntry->insert()
#3 C:\xampp\apps\mediawiki\htdocs\extensions\Renameuser\includes\SpecialRenameuser.php(310): RenameuserSQL->rename()
#4 C:\xampp\apps\mediawiki\htdocs\includes\specialpage\SpecialPage.php(600): SpecialRenameuser->execute(NULL)
#5 C:\xampp\apps\mediawiki\htdocs\includes\specialpage\SpecialPageFactory.php(635): SpecialPage->run(NULL)
#6 C:\xampp\apps\mediawiki\htdocs\includes\MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#7 C:\xampp\apps\mediawiki\htdocs\includes\MediaWiki.php(940): MediaWiki->performRequest()
#8 C:\xampp\apps\mediawiki\htdocs\includes\MediaWiki.php(543): MediaWiki->main()
#9 C:\xampp\apps\mediawiki\htdocs\index.php(53): MediaWiki->run()
#10 C:\xampp\apps\mediawiki\htdocs\index.php(46): wfIndexMain()
#11 {main}
Installation: Bitnami MediaWiki installer, XAMPP, on Windows 10. Mediawiki version 1.35.0, PHP version 7.4.11.
I installed the extension by adding
wfLoadExtension("Renameuser");
to LocalSettings.php; I didn't touch any other files.
Steps to reproduce:
Go to Special:RenameUser
Fill out the currently-logged-in user's username as the old username, and a new username (*)
Submit
And an error page shows up.
(*) The wiki only has two users, MediaWiki Default (no special usergroups) and User670 (bureaucrat, interface administrator, administrator). I am logged in as User670, and I tried to rename User670 (i.e. myself) using that page.
Additional testing:
I created a new user, Test, and used User670 to rename Test to Test1. Success.
I gave Test1 permissions, then used Test1 to rename User670 to User671. Success.
I used Test1 to rename Test1 to Test2. Fail with the same error.
Details
Related Changes in Gerrit:
Subject
Repo
Branch
Lines +/-
RenameUser: Fix invalidated renamer user when self-renames
mediawiki/core
master
+24
-10
RenameUser: Allow self-rename
mediawiki/core
master
+1
-10
Customize query in gerrit
Related Objects
Mentions
Duplicates
Mentioned In
T343667: Cannot create actor exception when renaming onself
Duplicates Merged Here
T343667: Cannot create actor exception when renaming onself
Event Timeline
User670839245
created this task.
Nov 7 2020, 2:39 PM
2020-11-07 14:39:08 (UTC+0)
Restricted Application
added a subscriber:
Aklapper
View Herald Transcript
Nov 7 2020, 2:39 PM
2020-11-07 14:39:09 (UTC+0)
User670839245
updated the task description.
(Show Details)
Nov 7 2020, 2:44 PM
2020-11-07 14:44:04 (UTC+0)
DannyS712
subscribed.
Nov 8 2020, 4:49 AM
2020-11-08 04:49:30 (UTC+0)
Comment Actions
I don't think you're supposed to be able to rename yourself...
User670839245
added a comment.
Nov 8 2020, 10:58 AM
2020-11-08 10:58:40 (UTC+0)
Comment Actions
In
T267477#6610975
@DannyS712
wrote:
I don't think you're supposed to be able to rename yourself...
Yeah, probably, but if that's the case I suppose it's better to have a message "You can't rename yourself" rather than throw an exception that no one understands.
MaxBowsher
subscribed.
May 9 2021, 4:56 PM
2021-05-09 16:56:02 (UTC+0)
Comment Actions
You are supposed to be able to rename yourself, as shown by this in the extension source code:
// If this user is renaming his/herself, make sure that MovePage::move()
// doesn't make a bunch of null move edits under the old name!
if ( $user->getId() === $uid ) {
$user->setName( $newusername->getText() );
However, looking around in the SQL debug log and the code, it seems that a bug was added that prevents this, with the actor migration changes:
The user's name is updated
The actor record is updated
Later in the process, a ManualLogEntry is created, passing the unmodified $this->renamer User as the performer
The log insertion tries to find/create an actor record to use for the log entry
This fails, because the actor record has been updated but the renamer/performer object has not
The above code that patches up the username in the in-memory object for the current user either needs to be duplicated or happen earlier, so that the new name is the one passed to ManualLogEntry as performer.
Leaderboard
subscribed.
May 9 2021, 6:09 PM
2021-05-09 18:09:24 (UTC+0)
Comment Actions
For the record, it works properly when trying to rename the same user globally (returns an error saying that "you cannot rename yourself"). The problem is only local.
AndrewDBate
subscribed.
Sep 5 2021, 12:27 AM
2021-09-05 00:27:39 (UTC+0)
Comment Actions
I can confirm that I am having the same issue on MediaWiki version 1.36.1 on Debian.
FrozenPlum
subscribed.
Jan 6 2023, 12:08 AM
2023-01-06 00:08:44 (UTC+0)
Comment Actions
I can also confirm the same issue is also occuring on the version of RenameUser packaged with 1.39:
MediaWiki
1.39.1
PHP
8.0.12 (cgi-fcgi)
MySQL
8.0.28-0ubuntu0.20.04.3
MollyMaclachlan
subscribed.
Feb 18 2024, 2:38 PM
2024-02-18 14:38:14 (UTC+0)
Comment Actions
I'm getting the same issue with 1.41.
MediaWiki
1.41.0
PHP
8.3.3 (apache2handler)
MariaDB
10.11.7-MariaDB
kostajh
mentioned this in
T343667: Cannot create actor exception when renaming onself
Jul 26 2024, 9:49 AM
2024-07-26 09:49:56 (UTC+0)
gerritbot
added a comment.
Sep 16 2024, 7:24 AM
2024-09-16 07:24:42 (UTC+0)
Comment Actions
Change #1073047 had a related patch set uploaded (by XtexChooser; author: XtexChooser):
[mediawiki/core@master] RenameUser: Update performer name on self-rename
gerritbot
added a project:
Patch-For-Review
Sep 16 2024, 7:24 AM
2024-09-16 07:24:43 (UTC+0)
Comment Actions
Change #1073048 had a related patch set uploaded (by XtexChooser; author: XtexChooser):
[mediawiki/core@master] RenameUser: Allow self-rename
XtexChooser
subscribed.
Sep 16 2024, 7:33 AM
2024-09-16 07:33:53 (UTC+0)
Ammarpad
merged a task:
T343667: Cannot create actor exception when renaming onself
Sep 16 2024, 7:36 AM
2024-09-16 07:36:14 (UTC+0)
Ammarpad
added subscribers:
Bawolff
kostajh
Ammarpad
XtexChooser
claimed this task.
Oct 27 2024, 3:01 AM
2024-10-27 03:01:05 (UTC+0)
gerritbot
added a comment.
Oct 27 2024, 3:02 AM
2024-10-27 03:02:42 (UTC+0)
Comment Actions
Change #1073048
abandoned
by XtexChooser:
[mediawiki/core@master] RenameUser: Allow self-rename
Reason:
Squashed into Ie959e15838f87b1f84b8d90796102c8bd099b76e
PatchDemoBot
added a comment.
Oct 27 2024, 3:34 AM
2024-10-27 03:34:18 (UTC+0)
Comment Actions
Test wiki
created
on
Patch demo
by XtexChooser using patch(es) linked to this task:
gerritbot
added a comment.
Nov 2 2024, 10:47 PM
2024-11-02 22:47:47 (UTC+0)
Comment Actions
Change #1073047
merged
by jenkins-bot:
[mediawiki/core@master] RenameUser: Fix invalidated renamer user when self-renames
ReleaseTaggerBot
added a project:
MW-1.44-notes (1.44.0-wmf.2; 2024-11-05)
Nov 2 2024, 11:00 PM
2024-11-02 23:00:42 (UTC+0)
Maintenance_bot
removed a project:
Patch-For-Review
Nov 2 2024, 11:30 PM
2024-11-02 23:30:16 (UTC+0)
XtexChooser
closed this task as
Resolved
Feb 22 2025, 12:24 PM
2025-02-22 12:24:10 (UTC+0)
PatchDemoBot
added a comment.
Jun 18 2025, 8:48 PM
2025-06-18 20:48:26 (UTC+0)
Comment Actions
Test wiki on
Patch demo
by XtexChooser using patch(es) linked to this task was
deleted
Log In to Comment
Content licensed under Creative Commons Attribution-ShareAlike (CC BY-SA) 4.0 unless otherwise noted; code licensed under GNU General Public License (GPL) 2.0 or later and other open source licenses. By using this site, you agree to the Terms of Use, Privacy Policy, and Code of Conduct.
Wikimedia Foundation
Code of Conduct
Disclaimer
CC-BY-SA
GPL
Credits