Page MenuHomePhabricator

PHP Warning: array_merge(): Expected parameter 1 to be an array, null given
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
labels.normalized_message
[{reqId}] {exception_url}   PHP Warning: array_merge(): Expected parameter 1 to be an array, null given
FrameLocationCall
from/srv/mediawiki/php-1.43.0-wmf.26/extensions/CirrusSearch/includes/DataSender.php(195)
#0[internal function]MWExceptionHandler::handleError(int, string, string, int, array)
#1/srv/mediawiki/php-1.43.0-wmf.26/extensions/CirrusSearch/includes/DataSender.php(195)array_merge(null, array)
#2[internal function]CirrusSearch\DataSender::CirrusSearch\{closure}(null, array)
#3/srv/mediawiki/php-1.43.0-wmf.26/extensions/CirrusSearch/includes/DataSender.php(196)array_reduce(array, Closure)
#4/srv/mediawiki/php-1.43.0-wmf.26/extensions/CirrusSearch/includes/Job/ElasticaWrite.php(181)CirrusSearch\DataSender->sendWeightedTagsUpdate(string, string, array)
#5/srv/mediawiki/php-1.43.0-wmf.26/extensions/CirrusSearch/includes/Job/JobTraits.php(139)CirrusSearch\Job\ElasticaWrite->doJob()
#6/srv/mediawiki/php-1.43.0-wmf.26/extensions/CirrusSearch/includes/Updater.php(467)CirrusSearch\Job\CirrusGenericJob->run()
#7/srv/mediawiki/php-1.43.0-wmf.26/extensions/CirrusSearch/includes/Updater.php(275)CirrusSearch\Updater->pushElasticaWriteJobs(string, array, Closure)
#8/srv/mediawiki/php-1.43.0-wmf.26/extensions/CirrusSearch/includes/Updater.php(284)CirrusSearch\Updater->updateWeightedTags(MediaWiki\Page\PageIdentityValue, string, array, string)
#9/srv/mediawiki/php-1.43.0-wmf.26/extensions/GrowthExperiments/includes/NewcomerTasks/AddLink/LinkRecommendationHelper.php(100)CirrusSearch\Updater->resetWeightedTags(MediaWiki\Page\PageIdentityValue, array, string)
#10/srv/mediawiki/php-1.43.0-wmf.26/includes/deferred/MWCallableUpdate.php(52)GrowthExperiments\NewcomerTasks\AddLink\LinkRecommendationHelper->GrowthExperiments\NewcomerTasks\AddLink\{closure}(string)
#11/srv/mediawiki/php-1.43.0-wmf.26/includes/deferred/DeferredUpdates.php(460)MediaWiki\Deferred\MWCallableUpdate->doUpdate()
#12/srv/mediawiki/php-1.43.0-wmf.26/includes/deferred/DeferredUpdates.php(204)MediaWiki\Deferred\DeferredUpdates::attemptUpdate(MediaWiki\Deferred\MWCallableUpdate)
#13/srv/mediawiki/php-1.43.0-wmf.26/includes/deferred/DeferredUpdates.php(291)MediaWiki\Deferred\DeferredUpdates::run(MediaWiki\Deferred\MWCallableUpdate)
#14/srv/mediawiki/php-1.43.0-wmf.26/includes/deferred/DeferredUpdatesScope.php(243)MediaWiki\Deferred\DeferredUpdates::MediaWiki\Deferred\{closure}(MediaWiki\Deferred\MWCallableUpdate, int)
#15/srv/mediawiki/php-1.43.0-wmf.26/includes/deferred/DeferredUpdatesScope.php(172)MediaWiki\Deferred\DeferredUpdatesScope->processStageQueue(int, int, Closure)
#16/srv/mediawiki/php-1.43.0-wmf.26/includes/deferred/DeferredUpdates.php(310)MediaWiki\Deferred\DeferredUpdatesScope->processUpdates(int, Closure)
#17/srv/mediawiki/php-1.43.0-wmf.26/includes/MediaWikiEntryPoint.php(674)MediaWiki\Deferred\DeferredUpdates::doUpdates()
#18/srv/mediawiki/php-1.43.0-wmf.26/includes/MediaWikiEntryPoint.php(496)MediaWiki\MediaWikiEntryPoint->restInPeace()
#19/srv/mediawiki/php-1.43.0-wmf.26/includes/MediaWikiEntryPoint.php(454)MediaWiki\MediaWikiEntryPoint->doPostOutputShutdown()
#20/srv/mediawiki/php-1.43.0-wmf.26/includes/MediaWikiEntryPoint.php(209)MediaWiki\MediaWikiEntryPoint->postOutputShutdown()
#21/srv/mediawiki/php-1.43.0-wmf.26/index.php(58)MediaWiki\MediaWikiEntryPoint->run()
#22/srv/mediawiki/w/index.php(3)require(string)
#23{main}
Impact
Notes

8 of these in 1.43.0-wmf.27 (T375658). Spitballing some tags here.

Event Timeline

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

For this reqId, also getting:

Retrying connection to {elastic_host} after {attempts} attempts4
Search backend error during updating {numBulk} documents after {tookMs}: {error_message}2
Update weighted tag {weightedTagFieldName} for {weightedTagPrefix} in articles: {docIds}2
[{reqId}] {exception_url} PHP Warning: array_merge(): Expected parameter 1 to be an array, null given2
[{reqId}] {exception_url} PHP Warning: array_unique() expects parameter 1 to be array, null given2
[{reqId}] {exception_url} PHP Warning: implode(): Invalid arguments passed2
Inconsistent revision ID1

So maybe just fallout from a failure to connect.

Urbanecm_WMF subscribed.

[...]
So maybe just fallout from a failure to connect.

No, this is new code we added to eswiki only to attempt to fix a certain issue. Seems like we created a new one! Putting onto our sprint and removing Discovery, as the cause is in Growth-maintained code.

If the volume of those errors get unbearable, it is possible to disable our changes by setting GETempLinkRecommendationSwitchTagClearHook to false.

Michael subscribed.

Not sure the root cause lies with GrowthExperiments, but maybe we triggered a code-path that wasn't executed like that before. This seems similar to (though distinct from) T376715: 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 that I'll boldly add Discovery-Search and CirrusSearch back. Even if our code is wrong, it would probably be good to have those extra eyes on it.

Not sure the root cause lies with GrowthExperiments, but maybe we triggered a code-path that wasn't executed like that before. This seems similar to (though distinct from) T376715: 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 that I'll boldly add Discovery-Search and CirrusSearch back. Even if our code is wrong, it would probably be good to have those extra eyes on it.

Actually the fix on T376715: 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 might trigger more of these errors, seems to me like a logic error in cirrus, will take a look today.

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

[mediawiki/extensions/CirrusSearch@master] Do not attempt to unfold tag info when logging failures

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

Change #1081374 merged by jenkins-bot:

[mediawiki/extensions/CirrusSearch@master] Do not attempt to unfold tag info when logging failures

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

Change #1131015 had a related patch set uploaded (by Bartosz Dziewoński; author: DCausse):

[mediawiki/extensions/CirrusSearch@REL1_43] Do not attempt to unfold tag info when logging failures

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

Change #1131015 merged by jenkins-bot:

[mediawiki/extensions/CirrusSearch@REL1_43] Do not attempt to unfold tag info when logging failures

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