Page MenuHomePhabricator

Actor name can not be empty for 0 and 3215898
Open, Needs TriagePublic

Event Timeline

FWIW:

wikiadmin@10.64.16.208(enwikibooks)> select * from revision where rev_actor =0 limit 5;
Empty set (0.001 sec)

Possibly system users?

FWIW:

wikiadmin@10.64.16.208(enwikibooks)> select * from revision where rev_actor =0 limit 5;
Empty set (0.001 sec)

Possibly system users?

actor id is the last one, 3215898

actor id is the last one, 3215898

https://quarry.wmcloud.org/query/58739
https://en.wikibooks.org/w/index.php?oldid=32811

Some broken actors are imported with suppressed revisions.

Maybe need a run of maintenance/findMissingActors.php

hmm. Nope :(

ladsgroup@mwmaint1002:~$ mwscript maintenance/findMissingActors.php --wiki=enwikibooks --field rev_actor
Finding invalid actor IDs in revision.rev_actor...
	Found 0 invalid actor IDs.
Done.

oh, that script only handles completely missing actors now, not broken ones.

Change 789786 had a related patch set uploaded (by Func; author: Func):

[mediawiki/core@master] Extend findMissingActors to fix broken actors with empty actor_name

https://gerrit.wikimedia.org/r/789786

Change 789786 merged by jenkins-bot:

[mediawiki/core@master] Extend findMissingActors to fix broken actors with empty actor_name

https://gerrit.wikimedia.org/r/789786

Found it:

ladsgroup@mwmaint1002:~$ mwscript maintenance/findMissingActors.php --wiki=enwikibooks --field rev_actor --type broken
Finding invalid actor IDs in revision.rev_actor...
		ID	ACTOR
		32811	3215898
		33371	3215898
		1960367	3215898
		1960368	3215898
		1960370	3215898
		1960371	3215898
		1960372	3215898
		1960374	3215898
		1960375	3215898
		1960376	3215898
		1960377	3215898
		1960378	3215898
		1960379	3215898
		1890748	3215898
		1890967	3215898
		1890759	3215898
		1765627	3215898
	Found 17 invalid actor IDs.
Done.

Now I have to replace them with "Unknown user" I think

Ladsgroup claimed this task.

Fixed.

Zabe reopened this task as Open.EditedMay 23 2022, 8:30 PM

Still seen (05a8fdb8-3bd8-44bd-b83d-590acb56b14e).

[{reqId}] {exception_url}   InvalidArgumentException: Actor name can not be empty for 0 and 36635239

It seems like other wikis than enwikibooks are also affected.

I think something is corrupting or inserting bad data into actor table. Most wikis have non-zero response to querying actors with empty string as name :/ Can it be the checkuser changes?

The error showed up at enwiki, where we are not yet writing to cuc_actor (and thus it should also not write to the actor table), thus I can't see how it could be the checkuser changes.

Non-zero response to querying actors with empty string as name are generally a surprise since ActorStore::validateActorForInsertion should catch insertions tries where the name is an empty string.

On the other hand the actor ids with the name being an empty string are relatively "low", so that they are certainly not newly inserted and I don't really know the old code.

What about renames? It can possibly make such changes.

What about renames? It can possibly make such changes.

Could be, but tbh I have no idea how we could confirm that. Maybe we should add a check to RenameuserSQL and throw if the new name is an empty string.

I have taken a look at these actors on a few wikis and they always have some very old revision associated with them (from like 2003 and before) and most of the time no revisions from after 2005 and usually no revisions after 2011 (with dewiki being an exception where a handful of revisions up to 2016 are associated with that actor). So maybe this is some older data corruption?

The only other place (I found) where kind of unprotected writes to the actor table happen is User::saveSettings, but that would have also resulted in an empty string in the user table.

Just noting that these still happen from time to time (14 in the last 24 hours).

Still seen (05a8fdb8-3bd8-44bd-b83d-590acb56b14e).

[{reqId}] {exception_url}   InvalidArgumentException: Actor name can not be empty for 0 and 36635239

It seems like other wikis than enwikibooks are also affected.

MariaDB [enwiki_p]> select * from actor where actor_name = '';
+----------+------------+------------+
| actor_id | actor_user | actor_name |
+----------+------------+------------+
| 36635239 |       NULL |            |
+----------+------------+------------+
1 row in set (0.008 sec)

The actor_user = null indicates mediawiki is treating as anonymous/ip,

MariaDB [enwiki_p]> select count(*) from revision_userindex where rev_actor = 36635239;
+----------+
| count(*) |
+----------+
|      120 |
+----------+
1 row in set (0.004 sec)

One version is http://en.wikipedia.org/?oldid=280354, which shows "Unknown user"

MigrateActors has insertted the non-usable user names (UserNameUtils::isUsable) without further validation, that can also bring in the empty string (or other invalid user names with trailing spaces, T200055)

Running the findMissingActors with type=broken looks like the only way to get this fixed.

According to https://wikitech.wikimedia.org/wiki/Server_Admin_Log/Archive_37 the migration starts january 2019, when there are dumps from before that we could look if there was a real user name or also the empy string (import from UseModWiki?)

brennen subscribed.

Still seeing a handful of these in 1.42.0-wmf.1.

Assuming it's the same issue, this has increased in frequency with deploy of 1.42.0-wmf.9 (T350085) to group2.

2023-12-14-13:45:44.png (250×638 px, 16 KB)

Error
labels.normalized_message
[{reqId}] {exception_url}   InvalidArgumentException: Actor name can not be empty for 0 and 181278
error.stack_trace
from /srv/mediawiki/php-1.42.0-wmf.9/includes/user/ActorStore.php(171)
#0 /srv/mediawiki/php-1.42.0-wmf.9/includes/block/DatabaseBlockStore.php(700): MediaWiki\User\ActorStore->newActorFromRowFields(integer, string, string)
#1 /srv/mediawiki/php-1.42.0-wmf.9/includes/block/DatabaseBlockStore.php(521): MediaWiki\Block\DatabaseBlockStore->newFromRow(Wikimedia\Rdbms\DBConnRef, stdClass)
#2 /srv/mediawiki/php-1.42.0-wmf.9/includes/block/DatabaseBlockStore.php(800): MediaWiki\Block\DatabaseBlockStore->newLoad(MediaWiki\User\User, integer, boolean, MediaWiki\User\User)
#3 /srv/mediawiki/php-1.42.0-wmf.9/includes/block/DatabaseBlockStore.php(769): MediaWiki\Block\DatabaseBlockStore->newListFromTarget(MediaWiki\User\User, MediaWiki\User\User, boolean)
#4 /srv/mediawiki/php-1.42.0-wmf.9/includes/page/Article.php(1448): MediaWiki\Block\DatabaseBlockStore->newFromTarget(MediaWiki\User\User, MediaWiki\User\User)
#5 /srv/mediawiki/php-1.42.0-wmf.9/includes/page/Article.php(650): Article->showMissingArticle()
#6 /srv/mediawiki/php-1.42.0-wmf.9/includes/page/Article.php(559): Article->generateContentOutput(MediaWiki\User\User, ParserOptions, integer, MediaWiki\Output\OutputPage, array)
#7 /srv/mediawiki/php-1.42.0-wmf.9/includes/actions/ViewAction.php(78): Article->view()
#8 /srv/mediawiki/php-1.42.0-wmf.9/includes/MediaWiki.php(585): ViewAction->show()
#9 /srv/mediawiki/php-1.42.0-wmf.9/includes/MediaWiki.php(365): MediaWiki->performAction(Article, MediaWiki\Title\Title)
#10 /srv/mediawiki/php-1.42.0-wmf.9/includes/MediaWiki.php(962): MediaWiki->performRequest()
#11 /srv/mediawiki/php-1.42.0-wmf.9/includes/MediaWiki.php(615): MediaWiki->main()
#12 /srv/mediawiki/php-1.42.0-wmf.9/index.php(50): MediaWiki->run()
#13 /srv/mediawiki/php-1.42.0-wmf.9/index.php(46): wfIndexMain()
#14 /srv/mediawiki/w/index.php(3): require(string)
#15 {main}

Change 984259 had a related patch set uploaded (by Ahmon Dancy; author: Ahmon Dancy):

[operations/puppet@production] logspam: Consolidate Actor name can not be empty for 0 and...

https://gerrit.wikimedia.org/r/984259

Change 984259 merged by Dzahn:

[operations/puppet@production] logspam: Consolidate Actor name can not be empty for 0 and...

https://gerrit.wikimedia.org/r/984259

Assuming it's the same issue, this has increased in frequency with deploy of 1.42.0-wmf.9 (T350085) to group2.

2023-12-14-13:45:44.png (250×638 px, 16 KB)

This seems slightly different, there were two separate logs with this same message—a WARNING and an ERROR.

The error seems to have been happening on Wikipedia user pages. The WARNING happens...all the time.

Looking at the logs for the ERROR today, they seem to have stopped at ~ 2023-12-21 15:19. Which aligns with @kostajh deploying gerrit:984841.

@kostajh — are these two things related?

I assume they are related but can’t look more closely now.