Page MenuHomePhabricator

Warning: Invalid argument supplied for foreach() in /srv/mediawiki/php-1.31.0-wmf.2/extensions/Collection/includes/DataProvider.php on line 152
Closed, ResolvedPublic3 Estimated Story PointsPRODUCTION ERROR

Description

Seen recently spiking in fatalmonitor logstash

[Exception ErrorException] (/srv/mediawiki/php-1.31.0-wmf.2/extensions/Collection/includes/DataProvider.php:152) PHP Warning: Invalid argument supplied for foreach()    
  #0 /srv/mediawiki/php-1.31.0-wmf.2/extensions/Collection/includes/DataProvider.php(152): MWExceptionHandler::handleError(integer, string, string, integer, array, array)
  #1 /srv/mediawiki/php-1.31.0-wmf.2/extensions/Collection/includes/BookRenderingMediator.php(70): MediaWiki\Extensions\Collection\DataProvider->fetchMetadata(array)    
  #2 /srv/mediawiki/php-1.31.0-wmf.2/extensions/Collection/includes/BookRenderingMediator.php(102): MediaWiki\Extensions\Collection\BookRenderingMediator->getBook(array)
  #3 /srv/mediawiki/php-1.31.0-wmf.2/extensions/Collection/SpecialRenderBook.php(53): MediaWiki\Extensions\Collection\BookRenderingMediator->getBookFromCache(array)

Event Timeline

Adding @Jdlrobson since we touched this extension during SWAT recently

Change 383941 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/Collection@master] Handle and debug case where API returns no pages

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

Looks like the issue here is the pages array is not defined. Seemed easy to I wrote a patch.

phuedx subscribed.

I've left a couple of minor questions on rECOL943316349253: Handle and debug case where API returns no pages. Moving to Needs More Work so that folk know that it's been reviewed.

ovasileva triaged this task as Medium priority.Oct 17 2017, 4:35 PM
ovasileva set the point value for this task to 3.Oct 17 2017, 4:38 PM
phuedx raised the priority of this task from Medium to Unbreak Now!.Oct 17 2017, 4:45 PM

We tend to treat unhandled exceptions as UBN! This is semi-documented in our SWAT policy.

Change 383941 merged by jenkins-bot:
[mediawiki/extensions/Collection@master] Handle and debug case where API returns no pages

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

Jdlrobson lowered the priority of this task from Unbreak Now! to High.Oct 17 2017, 5:57 PM
Jdlrobson removed a project: Patch-For-Review.

I don't believe this is unbreak now status.
Provided T178289 is swatted, this error will not be possible in production. Thus I suggest we focus on addressing that problem to avoid a SWAT here.
Please feel free to disagree.

It's not possible for this to happen in production now.

T178289 has been swatted making this code unreachable.

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:09 PM