Page MenuHomePhabricator

PHP notice in hhvm.log
Closed, ResolvedPublic


Nov 7 00:57:26 mw1189: #012Notice: Undefined index: lastmodifiedby in /srv/mediawiki/php-1.25wmf6/extensions/MobileFrontend/includes/api/ApiMobileView.php on line 98

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:55 AM
bzimport set Reference to bz73109.
bzimport added a subscriber: Unknown Object (MLST).

bingle-admin wrote:

Prioritization and scheduling of this bug is tracked on Trello card

Sam Reed: are there any other notices originating from ApiMobileView.php at around the same time?

For this to happen ApiMobileView#getData, which returns the required data about a page, must return an empty array without the 'lastmodifiedby' key set. This can happen in one of two ways:

  1. the cache entry corresponding to the page has become invalid
  2. the page is a redirect to a page in a virtual namespace (NS_SPECIAL, NS_MEDIA)

Disregarding #1 because it feels a lot less likely than #2: there's nothing in ApiMobileView#execute protecting against #getData returning an empty array, so when it does, there'll be a whole bunch of undefined index notices triggered for the following indices:

  • lastmodified
  • lastmodifiedby
  • revision
  • id
  • languagecount
  • displaytitle
  • pageprops

gerritadmin wrote:

Change 172258 had a related patch set uploaded by Phuedx:
Die with an error if the title redirects to media

Just had a look again now, and grepping for "ApiMobileView" literally only finds the stuff on line 98, and nothing more if I grep for "MobileFrontend"

It's probably worth noting this will happen on zend on production too, just we don't surface these things in the logs...

gerritadmin wrote:

Change 172258 merged by jenkins-bot:
Fix "Undefined index" notices in ApiMobileView

The patch is merged, and should be online on since Wednesday. Sam, can you check the logs and reopen if there are still errors? :)