Page MenuHomePhabricator

User.php: Cannot create a user with no name, no ID, and no actor ID (Unable to delete certain pages on Chinese Wikisource)
Open, Needs TriagePublicPRODUCTION ERROR

Description

i tried to delete this page,
https://zh.wikisource.org/wiki/%E5%AE%87%E5%AE%99%E6%B5%AA%E5%AD%90

and it returns

[W5U8aApAADwAACsyA6UAAAAY] 2018-09-09 15:29:44: 类型“InvalidArgumentException”的致命例外

i tried to delete another similar page,
https://zh.wikisource.org/wiki/%E5%A4%A7%E9%A6%AC%E6%89%81

and it returns similar results, as

[W5U9XwpAIDEAAExgjJwAAAAA] 2018-09-09 15:33:51: 类型“InvalidArgumentException”的致命例外

there are some pages that link to a same website, so you can find them at
https://zh.wikisource.org/w/index.php?title=Special:%E9%93%BE%E6%8E%A5%E6%90%9C%E7%B4%A2&limit=500&offset=0&target=http%3A%2F%2Fopen-lit.com

i've also found that these pages have their first versions at Jan 15, 2001, several years before zh.wikisource was established. i wonder if these versions are the cause. so maybe this problem is linked with T123313.

Event Timeline

Aklapper renamed this task from Unable to delete certain pages in Chinese Wikisource to Unable to delete certain pages in Chinese Wikisource: InvalidArgumentException from includes/user/User.php: Cannot create a user with no name, no ID, and no actor ID.Sep 10 2018, 9:07 AM
exception.file	       	/srv/mediawiki/php-1.32.0-wmf.20/includes/user/User.php:706
exception.message	       	Cannot create a user with no name, no ID, and no actor ID
exception.trace
#0 /srv/mediawiki/php-1.32.0-wmf.20/includes/page/WikiPage.php(2591): User::newFromAnyId(string, string, NULL)
#1 /srv/mediawiki/php-1.32.0-wmf.20/includes/page/Article.php(1877): WikiPage->doDeleteArticleReal(string, boolean, integer, boolean, string, User)
#2 /srv/mediawiki/php-1.32.0-wmf.20/includes/page/Article.php(1636): Article->doDelete(string, boolean)
#3 /srv/mediawiki/php-1.32.0-wmf.20/includes/actions/DeleteAction.php(46): Article->delete()
#4 /srv/mediawiki/php-1.32.0-wmf.20/includes/MediaWiki.php(501): DeleteAction->show()
#5 /srv/mediawiki/php-1.32.0-wmf.20/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)
#6 /srv/mediawiki/php-1.32.0-wmf.20/includes/MediaWiki.php(868): MediaWiki->performRequest()
#7 /srv/mediawiki/php-1.32.0-wmf.20/includes/MediaWiki.php(525): MediaWiki->main()
#8 /srv/mediawiki/php-1.32.0-wmf.20/index.php(42): MediaWiki->run()
#9 /srv/mediawiki/w/index.php(3): include(string)
#10 {main}
exception_id	       	W5U8aApAADwAACsyA6UAAAAY
exception_url	       	/w/index.php?title=%E5%A5%B3%E9%96%8B%E7%A7%91%E5%82%B3&action=delete
Krinkle subscribed.

Adding missing team tag per mw:Maintainers, for an unresolved production error.

Krinkle renamed this task from Unable to delete certain pages in Chinese Wikisource: InvalidArgumentException from includes/user/User.php: Cannot create a user with no name, no ID, and no actor ID to User.php: Cannot create a user with no name, no ID, and no actor ID (Unable to delete certain pages on Chinese Wikisource).Jan 26 2019, 7:58 AM

Internal error : [XJEYgApAAEAAAIhm1agAAACU] 2019-03-19 16:27:44: Fatal exception of type "InvalidArgumentException"

Hey @aaron tagging you for visibility as the maintainer. We aren't planning to work on this.

Copy-pasting from IRC #mediawiki-core:

[17:37:49] <Krinkle> anomie: Regarding "Unknown user" - is this a bug in the page deletion logic, or is this something to be fixed by a maintenance script, or something else? https://phabricator.wikimedia.org/T203913
[17:51:27] <anomie> Krinkle: The exception may have been fixed by the fact that migrateActors.php created an actor for the empty-string user, or will be once we can switch the actor migration to READ_NEW (which is currently blocked on code review for T215525). But the real fix would be to do something (maintenance script or manual DB update) to replace that empty-string actor with the "Unknown user" actor, and fill in xx_user_text to match if we're still on READ_OLD
[17:51:28] <anomie> by the time someone does that.
[17:52:04] <Krinkle> anomie: (the exception is not fixed)
[17:52:54] <Krinkle> anomie: OK. so no code changes required. I imagine there's probably other tasks already about fixing the corrupt db entries?
[17:53:15] <Krinkle> But I also recall a "temporary fix" from a few months ago that made empty string valid for the mean time as "unknown user".
[17:53:26] <Krinkle> I thought we merged that..
[17:55:27] <anomie> Krinkle: https://gerrit.wikimedia.org/r/c/435822/ ?
[17:55:40] <Krinkle> anomie: Right, that looks familiar.
[17:55:52] <Krinkle> anomie: Should that not have made this a non-fatal problem?
[17:56:16] <Krinkle> It's basically doing the maint thing at run-time.
[17:56:42] <anomie> Different code path.
[17:56:47] <Krinkle> Anyhow, what's your suggested path forward to fixing this fatal. What's the easiest to do quickly and/or worthwhile investment?
[17:57:00] <Krinkle> Ah, so we might be able to apply this fix in another and/or more central place.
[17:59:33] <anomie> I'd be wary of screwing around with User::newFromAnyId(). The real fix is for someone to do that maintenance script (or manually do what the maintenance script would do: set rev_user_text = 'Unknown user' and revactor_actor in the corresponding revision_actor_temp row to match, and the same for other xx_user_text fields in other tables).

@Anomie Which maintenance script is that? Does it just need someone with time to run it, or does the script first need auditing for prod?

Screenshot 2019-04-09 at 18.40.11.png (196×1 px, 55 KB)

https://quarry.wmflabs.org/query/1266

rev_idrev_pagerev_comment_idrev_userrev_user_textrev_actorrev_timestamp
209282108661107232520010115000000

Seems to be fixed. I deleted the referred page.

(Sorry this reply got lost in my inbox)

@Anomie Which maintenance script is that? Does it just need someone with time to run it, or does the script first need auditing for prod?

It first needs someone to write it.

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:08 PM