Page MenuHomePhabricator

TypeError: Argument 3 passed to CirrusSearch\DataSender::sendWeightedTagsUpdate() must be of the type array, null given, called in /srv/mediawiki/php-1.43.0-wmf.25/extensions/CirrusSearch/includes/Job/ElasticaWrite.php on line
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   TypeError: Argument 3 passed to CirrusSearch\DataSender::sendWeightedTagsUpdate() must be of the type array, null given, called in /srv/mediawiki/php-1.43.0-wmf.25/extensions/CirrusSearch/includes/Job/ElasticaWrite.php on line
FrameLocationCall
from/srv/mediawiki/php-1.43.0-wmf.25/extensions/CirrusSearch/includes/DataSender.php(129)
#0/srv/mediawiki/php-1.43.0-wmf.25/extensions/CirrusSearch/includes/Job/ElasticaWrite.php(181)CirrusSearch\DataSender->sendWeightedTagsUpdate(string, string, null)
#1/srv/mediawiki/php-1.43.0-wmf.25/extensions/CirrusSearch/includes/Job/JobTraits.php(139)CirrusSearch\Job\ElasticaWrite->doJob()
#2/srv/mediawiki/php-1.43.0-wmf.25/extensions/CirrusSearch/includes/Updater.php(467)CirrusSearch\Job\CirrusGenericJob->run()
#3/srv/mediawiki/php-1.43.0-wmf.25/extensions/CirrusSearch/includes/Updater.php(275)CirrusSearch\Updater->pushElasticaWriteJobs(string, array, Closure)
#4/srv/mediawiki/php-1.43.0-wmf.25/extensions/GrowthExperiments/includes/NewcomerTasks/AddLink/LinkRecommendationUpdater.php(139)CirrusSearch\Updater->updateWeightedTags(MediaWiki\Page\PageIdentityValue, string)
#5/srv/mediawiki/php-1.43.0-wmf.25/extensions/GrowthExperiments/maintenance/refreshLinkRecommendations.php(291)GrowthExperiments\NewcomerTasks\AddLink\LinkRecommendationUpdater->processCandidate(MediaWiki\Title\Title, bool)
#6/srv/mediawiki/php-1.43.0-wmf.25/extensions/GrowthExperiments/maintenance/refreshLinkRecommendations.php(160)GrowthExperiments\Maintenance\RefreshLinkRecommendations->processCandidate(MediaWiki\Title\Title, bool)
#7/srv/mediawiki/php-1.43.0-wmf.25/maintenance/includes/MaintenanceRunner.php(703)GrowthExperiments\Maintenance\RefreshLinkRecommendations->execute()
#8/srv/mediawiki/php-1.43.0-wmf.25/maintenance/run.php(51)MediaWiki\Maintenance\MaintenanceRunner->run()
#9/srv/mediawiki/multiversion/MWScript.php(158)require_once(string)
#10{main}
Impact

Significant logspam (372 errors over the past 24 hours). Impact on the maintenance script is unknown.

Notes

Only seen on mwmaint2002 (presumably refreshLinkRecommendations only runs there).

Event Timeline

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

Impact on the maintenance script is unknown.

Looks like the error gets caught and logged in link RecommendationUpdater::processCandidate(), which is why the maintenance script continues running. Beyond that, I still don’t know what the impact of this is (presumably the pages that experience this error will be missing some kind of update).

Impact on the maintenance script is unknown.

Looks like the error gets caught and logged in link RecommendationUpdater::processCandidate(), which is why the maintenance script continues running. Beyond that, I still don’t know what the impact of this is (presumably the pages that experience this error will be missing some kind of update).

I didn't notice any user impact either. The rate of error is high >500 (see logstash filtered for the error for last 24 hours ).

Gehel triaged this task as High priority.Oct 14 2024, 2:48 PM
Gehel moved this task from needs triage to Current work on the Discovery-Search board.
Gehel edited projects, added Discovery-Search (Current work); removed Discovery-Search.

The type hint is from 24bffeae1592c4625ddebc451940d773b99b070b - in the old code the tagWeights was nullable, but not in the new created function.

Change #1081096 had a related patch set uploaded (by DCausse; author: DCausse):

[mediawiki/extensions/CirrusSearch@master] Do not pass null to DataSender::sendWeightedTagsUpdate $tagWeights

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

Change #1081096 merged by jenkins-bot:

[mediawiki/extensions/CirrusSearch@master] Do not pass null to DataSender::sendWeightedTagsUpdate $tagWeights

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

Impact on the maintenance script is unknown.

Looks like the error gets caught and logged in link RecommendationUpdater::processCandidate(), which is why the maintenance script continues running. Beyond that, I still don’t know what the impact of this is (presumably the pages that experience this error will be missing some kind of update).

User impact is that no new link-recommendation tasks are being added to the task pool for any wiki. The big wikis should have a large-enough pool for that not being much of an issue, the impact on wikis with a smaller pool might be more dire. That being said, the change to fix this should roll out with the next train and then hopefully we will see new link-recommendation tasks again.

@dcausse Is this something that can be back-ported on Monday, or should it better ride the train normally?

@dcausse Is this something that can be back-ported on Monday, or should it better ride the train normally?

Sure, I'll backport the patches on Monday esp. this particular issue, T377479 should be fine because my understanding is that it only happens in the error handling code path when elastic is unresponsive and the job should be retried, but I'll backport it anyways.

Change #1081396 had a related patch set uploaded (by DCausse; author: DCausse):

[mediawiki/extensions/CirrusSearch@wmf/1.43.0-wmf.27] Do not pass null to DataSender::sendWeightedTagsUpdate $tagWeights

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

Change #1081396 merged by jenkins-bot:

[mediawiki/extensions/CirrusSearch@wmf/1.43.0-wmf.27] Do not pass null to DataSender::sendWeightedTagsUpdate $tagWeights

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

Mentioned in SAL (#wikimedia-operations) [2024-10-21T09:16:23Z] <dcausse@deploy2002> Started scap sync-world: Backport for [[gerrit:1081402|Fix phan issue with getCounter returning NullMetric|CounterMetric]], [[gerrit:1081396|Do not pass null to DataSender::sendWeightedTagsUpdate $tagWeights (T376715)]]

Mentioned in SAL (#wikimedia-operations) [2024-10-21T09:27:08Z] <dcausse@deploy2002> dcausse: Backport for [[gerrit:1081402|Fix phan issue with getCounter returning NullMetric|CounterMetric]], [[gerrit:1081396|Do not pass null to DataSender::sendWeightedTagsUpdate $tagWeights (T376715)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-10-21T09:39:50Z] <dcausse@deploy2002> Finished scap sync-world: Backport for [[gerrit:1081402|Fix phan issue with getCounter returning NullMetric|CounterMetric]], [[gerrit:1081396|Do not pass null to DataSender::sendWeightedTagsUpdate $tagWeights (T376715)]] (duration: 23m 26s)

The fix is backported to 1.43.0-wmf.27, did not see any new instance of this error since.
Sadly I could not backport the fix T377479 yet since the corresponding patch on the master branch has not been +2ed yet.

Thank you! This backport enabled our maintenance script to add back task recommendations! 🙏

The last timestamp for the error is Oct 21, 2024 @ 09:38:19.928 (logstash link) - can this tak be closed?