Page MenuHomePhabricator

Fatal error possible on Main Pages that use FeaturedFeeds
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

Request ID: W6vXEgrAIDwAAHfqD8MAAAAS

message
Wikimedia\Assert\ParameterAssertionException:
Bad value for parameter $dbkey: invalid DB key 'FeedItem/potd/20180917000000/nl_'
stacktrace
#0 /srv/mediawiki/php-1.32.0-wmf.23/includes/title/TitleValue.php(105): Wikimedia\Assert\Assert::parameter(boolean, string, string)
#1 /srv/mediawiki/php-1.32.0-wmf.23/includes/specialpage/SpecialPage.php(101): TitleValue->__construct(integer, string, string)
#2 /srv/mediawiki/php-1.32.0-wmf.23/includes/specialpage/SpecialPage.php(85): SpecialPage::getTitleValueFor(string, string, string)
#3 /srv/mediawiki/php-1.32.0-wmf.23/extensions/FeaturedFeeds/includes/FeaturedFeedChannel.php(179): SpecialPage::getTitleFor(string, string)
#4 /srv/mediawiki/php-1.32.0-wmf.23/extensions/FeaturedFeeds/includes/FeaturedFeedChannel.php(136): FeaturedFeedChannel->getFeedItem(integer)
#5 /srv/mediawiki/php-1.32.0-wmf.23/extensions/FeaturedFeeds/includes/FeaturedFeeds.php(185): FeaturedFeedChannel->getFeedItems()
#6 /srv/mediawiki/php-1.32.0-wmf.23/extensions/FeaturedFeeds/includes/FeaturedFeeds.php(34): FeaturedFeeds::getFeedsInternal(string)
#7 /srv/mediawiki/php-1.32.0-wmf.23/extensions/FeaturedFeeds/includes/FeaturedFeeds.php(97): FeaturedFeeds::getFeeds(string)
#8 /srv/mediawiki/php-1.32.0-wmf.23/includes/Hooks.php(174): FeaturedFeeds::beforePageDisplay(OutputPage, SkinVector)
#9 /srv/mediawiki/php-1.32.0-wmf.23/includes/Hooks.php(234): Hooks::callHook(string, array, array, NULL, string)
#10 /srv/mediawiki/php-1.32.0-wmf.23/includes/OutputPage.php(2450): Hooks::runWithoutAbort(string, array)
#11 /srv/mediawiki/php-1.32.0-wmf.23/includes/MediaWiki.php(875): OutputPage->output(boolean)
#12 /srv/mediawiki/php-1.32.0-wmf.23/includes/MediaWiki.php(887): Closure$MediaWiki::main()
#13 /srv/mediawiki/php-1.32.0-wmf.23/includes/MediaWiki.php(525): MediaWiki->main()
#14 /srv/mediawiki/php-1.32.0-wmf.23/index.php(42): MediaWiki->run()

Notes

This is showing up in the logs starting Sept 19 (1.32.0-wmf.20). While the problematic code is deployed on many wikis, it has currently only been triggered by users on commons.wikimedia.org.

The users in question were viewing the Commons main page, at https://commons.wikimedia.org/wiki/Main_Page. Just plainly, without any query parameters.

Viewing that url, the exception does not happen for me. So this must be dependant on some kind of cookie or user preference.

However, I'm able to consistently trigger it via https://commons.wikimedia.org/wiki/Main_Page?uselang=nl_.

As such, there are two problems here:

  • We have a fatal error exposed on a public GET url. This is a risk can that cause false alarms.
  • Somehow, our preferences system, or ULS, has likely caused some users to have an invalid language code of nl_ saved as their language code. Which works surprisingly fine on most pages, except pages that use FeaturedFeeds, in which case it gets a fatal error.

Event Timeline

Krinkle triaged this task as High priority.Sep 26 2018, 7:18 PM
Krinkle created this task.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 26 2018, 7:18 PM

Marking as High due to the risk of it being exposed at a simple/public url.

Krinkle added a subscriber: MaxSem.

CC-ing Reading-Infra and MaxSem per mw:Maintainer.

Change 463155 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/extensions/FeaturedFeeds@master] Add language code validation

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

Change 463168 had a related patch set uploaded (by Krinkle; owner: MaxSem):
[mediawiki/extensions/FeaturedFeeds@wmf/1.32.0-wmf.23] Add language code validation

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

Change 463155 merged by jenkins-bot:
[mediawiki/extensions/FeaturedFeeds@master] Add language code validation

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

Somehow, our preferences system, or ULS, has likely caused some users to have an invalid language code of nl_ saved as their language code

Language nl in variant undefined?

Change 463168 merged by jenkins-bot:
[mediawiki/extensions/FeaturedFeeds@wmf/1.32.0-wmf.23] Add language code validation

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

Mentioned in SAL (#wikimedia-operations) [2018-09-27T00:22:40Z] <krinkle@deploy1001> Synchronized php-1.32.0-wmf.23/extensions/FeaturedFeeds: T205573 (duration: 00m 59s)

Krinkle closed this task as Resolved.Sep 27 2018, 12:25 AM
Krinkle assigned this task to MaxSem.
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:08 PM