Page MenuHomePhabricator

InvalidArgumentException: Invalid user parameter in EchoEvent::create
Closed, ResolvedPublicPRODUCTION ERROR

Description

normalized_message
/w/index.php?title=Especial:Restaurar&action=submit   InvalidArgumentException: Invalid user parameter
exception.trace
from /srv/mediawiki/php-1.36.0-wmf.31/extensions/Echo/includes/model/Event.php(173)
#0 /srv/mediawiki/php-1.36.0-wmf.31/extensions/Echo/includes/EchoHooks.php(831): EchoEvent::create(array)
#1 /srv/mediawiki/php-1.36.0-wmf.31/includes/HookContainer/HookContainer.php(333): EchoHooks::onLinksUpdateAfterInsert(LinksUpdate, string, array)
#2 /srv/mediawiki/php-1.36.0-wmf.31/includes/HookContainer/HookContainer.php(140): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
#3 /srv/mediawiki/php-1.36.0-wmf.31/includes/HookContainer/HookRunner.php(2380): MediaWiki\HookContainer\HookContainer->run(string, array)
#4 /srv/mediawiki/php-1.36.0-wmf.31/includes/deferred/LinksUpdate.php(518): MediaWiki\HookContainer\HookRunner->onLinksUpdateAfterInsert(LinksUpdate, string, array)
#5 /srv/mediawiki/php-1.36.0-wmf.31/includes/deferred/LinksUpdate.php(237): LinksUpdate->incrTableUpdate(string, string, array, array)
#6 /srv/mediawiki/php-1.36.0-wmf.31/includes/deferred/LinksUpdate.php(194): LinksUpdate->doIncrementalUpdate()
#7 /srv/mediawiki/php-1.36.0-wmf.31/includes/deferred/DeferredUpdates.php(513): LinksUpdate->doUpdate()
#8 /srv/mediawiki/php-1.36.0-wmf.31/includes/deferred/RefreshSecondaryDataUpdate.php(101): DeferredUpdates::attemptUpdate(LinksUpdate, Wikimedia\Rdbms\LBFactoryMulti)
#9 /srv/mediawiki/php-1.36.0-wmf.31/includes/deferred/DeferredUpdates.php(513): RefreshSecondaryDataUpdate->doUpdate()
#10 /srv/mediawiki/php-1.36.0-wmf.31/includes/deferred/DeferredUpdates.php(390): DeferredUpdates::attemptUpdate(RefreshSecondaryDataUpdate, Wikimedia\Rdbms\LBFactoryMulti)
#11 /srv/mediawiki/php-1.36.0-wmf.31/includes/deferred/DeferredUpdates.php(221): DeferredUpdates::run(RefreshSecondaryDataUpdate, Wikimedia\Rdbms\LBFactoryMulti, Monolog\Logger, BufferingStatsdDataFactory, string)
#12 /srv/mediawiki/php-1.36.0-wmf.31/includes/deferred/DeferredUpdatesScope.php(264): DeferredUpdates::{closure}(RefreshSecondaryDataUpdate, integer)
#13 /srv/mediawiki/php-1.36.0-wmf.31/includes/deferred/DeferredUpdatesScope.php(196): DeferredUpdatesScope->processStageQueue(integer, integer, Closure)
#14 /srv/mediawiki/php-1.36.0-wmf.31/includes/deferred/DeferredUpdates.php(242): DeferredUpdatesScope->processUpdates(integer, Closure)
#15 /srv/mediawiki/php-1.36.0-wmf.31/includes/MediaWiki.php(1117): DeferredUpdates::doUpdates(string)
#16 /srv/mediawiki/php-1.36.0-wmf.31/includes/MediaWiki.php(853): MediaWiki->restInPeace()
#17 /srv/mediawiki/php-1.36.0-wmf.31/includes/MediaWiki.php(865): MediaWiki->{closure}()
#18 /srv/mediawiki/php-1.36.0-wmf.31/includes/MediaWiki.php(587): MediaWiki->doPostOutputShutdown()
#19 /srv/mediawiki/php-1.36.0-wmf.31/index.php(53): MediaWiki->run()
#20 /srv/mediawiki/php-1.36.0-wmf.31/index.php(46): wfIndexMain()
#21 /srv/mediawiki/w/index.php(3): require(string)
#22 {main}
Impact

Noticed during wmf.31 group2 train deployment. Seemingly emanating from a LinksUpdate deferred update, all from the same URL. Impact is unknown.

Notes

Details

Request ID
YC7Qb0z0GirrIag1ElqZQgAAAJI
Request URL
/w/index.php?title=Especial:Restaurar&action=submit

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Mentioned in SAL (#wikimedia-operations) [2021-02-18T21:29:37Z] <marxarelli> 1.36.0-wmf.31 rolled back due to T275161 and new logspam (T271345)

It looks like the underlying cause is $linksUpdate->getRevisionRecord() failing to retrieve a revision record. I don't know how common that is, but null is a valid return from getRevisionRecord. We could adjust the Echo hook code to ensure there's a user from getRevisionRecord() but wonder if that might be hiding something more important.

One of the pages that is triggering this has been deleted. I don't have permission to view its history but the history of the edits to that page might help with diagnosing this.

The RevisionRecord::getUser contract is to return UserIdentity, not specifically User implementation of the interface. We've changed the RevisionStore to start returning UserIdentityValue object instead of returning the full User object. EchoEvent::create check needs to be adjusted to be prepared to get different implementations of UserIdentity interface. You can convert from UserIdentity to User via UserFactory::newFromUserIdentity.

Change 665199 had a related patch set uploaded (by Kosta Harlan; owner: Kosta Harlan):
[mediawiki/extensions/Echo@master] Echo::create: Convert UserIdentityValue to plain User

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

Jdforrester-WMF raised the priority of this task from High to Unbreak Now!.Feb 19 2021, 4:24 AM
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

We blocked (indeed, rolled back) the train on this -> UBN!

Change 665199 merged by jenkins-bot:
[mediawiki/extensions/Echo@master] Echo::create: Convert UserIdentityValue to plain User

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

Change 665177 had a related patch set uploaded (by Jforrester; owner: Kosta Harlan):
[mediawiki/extensions/Echo@wmf/1.36.0-wmf.31] Echo::create: Convert UserIdentityValue to plain User

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

Change 665177 merged by jenkins-bot:
[mediawiki/extensions/Echo@wmf/1.36.0-wmf.31] Echo::create: Convert UserIdentityValue to plain User

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

Mentioned in SAL (#wikimedia-operations) [2021-02-19T19:01:14Z] <dduvall@deploy1001> Synchronized php-1.36.0-wmf.31/extensions/Echo/includes/model/Event.php: backport: [[gerrit:665177|Echo::create: Convert UserIdentityValue to plain User (T275161)]] (duration: 01m 20s)

dduvall claimed this task.