Page MenuHomePhabricator

Notice: Undefined index: in SpecialMobileLanguages.php on line 68
Closed, ResolvedPublic2 Estimated Story Points

Description

New logstash error.

Notice: Undefined index: url in /srv/mediawiki/php-1.30.0-wmf.11/extensions/MobileFrontend/includes/specials/SpecialMobileLanguages.php on line 68

Has happened twice on ml.wikipedia.org and es.wikipedia.org:

https://logstash.wikimedia.org/app/kibana#/discover?_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:now-7d,mode:quick,to:now))&_a=(columns:!(_source),index:'logstash-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'message:%22Notice:%20Undefined%20index:%20url%22')),sort:!('@timestamp',desc))

e.g. This example
Offending code:

			foreach ( $page['langlinks'] as $code => $langObject ) {
				if ( !isset( $languageMap[$langObject['lang']] ) ) {
					// Bug T93500: DB might still have preantiquated rows with bogus languages
					unset( $languages[$code] );
					continue;
				}
				$langObject['langname'] = $languageMap[$langObject['lang']];
				$langObject['url'] = MobileContext::singleton()->getMobileUrl( $langObject['url'] );
				$languages[$code] = $langObject;
			}

If a language URL is not there, there's no point in rendering it. So we should add an A/C.
It's not clear why a language URL should not be present... but not sure about value of investigating this further.

Acceptance criteria

  • Any languages which do not have a URL will not be included in the results
  • We will log an info message when this scenario is encountered to help us understand what is happening better
  • We will add a unit test

Event Timeline

Jdlrobson created this task.Aug 2 2017, 6:40 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 2 2017, 6:40 PM
Jdlrobson triaged this task as Medium priority.Aug 8 2017, 3:15 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson set the point value for this task to 2.Aug 15 2017, 4:14 PM
Jdlrobson updated the task description. (Show Details)Aug 15 2017, 4:15 PM
Jdlrobson updated the task description. (Show Details)
pmiazga claimed this task.Aug 17 2017, 2:30 PM

Change 372473 had a related patch set uploaded (by Pmiazga; owner: Pmiazga):
[mediawiki/extensions/MobileFrontend@master] Verify the existance of url key when parsing lang objects

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

I created T173578 to investigate the root cause.

Change 372473 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Verify the existence of url key when parsing lang objects

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

phuedx removed pmiazga as the assignee of this task.Aug 22 2017, 1:51 PM

I'll sign this off.

Change 373292 had a related patch set uploaded (by Jdlrobson; owner: Pmiazga):
[mediawiki/extensions/MobileFrontend@wmf/1.30.0-wmf.14] Verify the existence of url key when parsing lang objects

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

Code looks good so I'm going to SWAT this and verify in production.
I can trigger the error by visiting this URL. After SWATing I will check the behaviour is consistent with what I'm seeing locally.

Change 373292 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@wmf/1.30.0-wmf.14] Verify the existence of url key when parsing lang objects

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

Mentioned in SAL (#wikimedia-operations) [2017-08-23T19:44:46Z] <thcipriani@tin> Synchronized php-1.30.0-wmf.14/extensions/MobileFrontend: [[gerrit:373292|Verify the existence of url key when parsing lang objects]] T172316 (duration: 00m 56s)

The change was fetched but the submodule wasn't updated for wmf.14. I can now confirm this is fixed and the errors have disappeared from logstash and is being logged.

Jdlrobson closed this task as Resolved.Aug 23 2017, 7:48 PM
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:10 PM