Page MenuHomePhabricator

ActorStore throws InvalidArgumentException("Actor name can not be empty") in action=info for legacy revisions with empty rev_user_text, unlike history/diff/feeds which degrade gracefully
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Migrate a wiki with a revision that has an empty actor_name (empty rev_user_text) through the actor migration.
  • Visit action=info ("Page information") for any page containing one of these revisions.

Summary
A revision whose actor has an empty actor_name crashes action=info ("Page information") with a hard InvalidArgumentException. Every other view that resolves the same revision's author — the normal page view, action=history, and the history Atom/RSS feed, handles it gracefully, rendering it as the localized "Unknown user". Only action=info's specific call site is missing that fallback.

Root cause
InfoAction::pageInfo() → RevisionStoreCacheRecord::getUser() → ActorStore::newActorFromRowFields(), which throws when actor_name === '' (comment references T273933).

How this data arises
Verified against the pre-migration dump; 4,260 revisions genuinely had rev_user=0, rev_user_text='' in production (distinct from the 1 legitimate 'MediaWiki default' revision). update.php's actor migration mapped them all to one empty-named actor row. Same pattern as T229092, which fixed the migration script's crash but not this later load-time crash.

Expected result
Renders "Unknown user" like every other view of the same data does.

Actual result
HTTP 500, InvalidArgumentException: Actor name can not be empty for 0 and 258, full trace through InfoAction.php(621). Confirmed specific to action=info; the normal view, action=history, and action=history&feed=atom on the exact same page all render fine.

Suggested fix
Give this call site the same empty-name fallback the history view/feed already have, instead of throwing.

Workaround

UPDATE actor SET actor_name = 'Unknown user (legacy)' WHERE actor_id = <id>;

Related
T229092, T273933

Environment
MediaWiki 1.46.0, PHP 8.3.33, Apache 2.4.68, MariaDB 10