Page MenuHomePhabricator

MobileFrontend's Watchlist is causing 500 server error on beta cluster
Closed, ResolvedPublic

Description

https://en.m.wikipedia.beta.wmflabs.org/wiki/Special:Watchlist

Screen Shot 2018-10-04 at 4.09.33 PM.png (278×746 px, 34 KB)

QA steps

Locally

Add the following to LocalSettings and verify you are getting a 500.

$wgHooks['ChangesListSpecialPageQuery'][] = function ( $name, $tables, $fields, $conds, $query_options, $join_conds, $opts  ) {
	return true;
};

Verify the fix makes it go away.

On beta cluster

Can you access the watchlist at https://en.wikipedia.beta.wmflabs.org/wiki/Special:Watchlist?

Event Timeline

Jdlrobson triaged this task as Unbreak Now! priority.Oct 4 2018, 11:01 PM

As a logged in user tapping modified, I see the following:

https://en.m.wikipedia.beta.wmflabs.org/w/index.php?title=Special:Watchlist&watchlistview=feed&filter=all
PHP fatal error: 
Argument 5 passed to Wikibase\Client\Hooks\ChangesListSpecialPageHookHandlers::onChangesListSpecialPageQuery() must be an instance of array, null given

My empty watchlist works though.

I wonder why this isn't showing up in the logstash.

I wonder why this isn't showing up in the logstash.

Are you checking https://logstash-beta.wmflabs.org/ ?

I didn't realize we had a separate one for beta. I wish our Gerrit / tooling errors went there instead of prod!

Krinkle subscribed.

(Not in a production branch yet, marking as blocker for the next branch instead.)

Change 464814 had a related patch set uploaded (by Pmiazga; owner: Pmiazga):
[mediawiki/extensions/MobileFrontend@master] Pass query_options to the ChangesListSpecialPageQuery hook

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

Change 464814 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Pass query_options to the ChangesListSpecialPageQuery hook

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

New issues now
https://en.m.wikipedia.beta.wmflabs.org/w/index.php?title=Special:Watchlist&mobileaction=toggle_view_mobile

[W7eX5QpEEj4AAD7IPo4AAAAA] /w/index.php?title=Special:Watchlist&mobileaction=toggle_view_mobile MWException from line 146 of /srv/mediawiki/php-master/includes/FormOptions.php: Invalid option hidepageedits

Backtrace:

#0 /srv/mediawiki/php-master/includes/FormOptions.php(181): FormOptions->validateName(string, boolean)
#1 /srv/mediawiki/php-master/includes/FormOptions.php(402): FormOptions->getValue(string)
#2 /srv/mediawiki/php-master/extensions/Flow/Hooks.php(2181): FormOptions->offsetGet(string)
#3 /srv/mediawiki/php-master/includes/Hooks.php(174): FlowHooks::onChangesListSpecialPageQuery(string, array, array, array, array, array, FormOptions)
#4 /srv/mediawiki/php-master/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#5 /srv/mediawiki/php-master/extensions/MobileFrontend/includes/specials/SpecialMobileWatchlist.php(285): Hooks::run(string, array)
#6 /srv/mediawiki/php-master/extensions/MobileFrontend/includes/specials/SpecialMobileWatchlist.php(72): SpecialMobileWatchlist->doFeedQuery()
#7 /srv/mediawiki/php-master/extensions/MobileFrontend/includes/specials/MobileSpecialPage.php(58): SpecialMobileWatchlist->executeWhenAvailable(NULL)
#8 /srv/mediawiki/php-master/extensions/MobileFrontend/includes/specials/MobileSpecialPageFeed.php(26): MobileSpecialPage->execute(NULL)
#9 /srv/mediawiki/php-master/includes/specialpage/SpecialPage.php(569): MobileSpecialPageFeed->execute(NULL)
#10 /srv/mediawiki/php-master/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run(NULL)
#11 /srv/mediawiki/php-master/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#12 /srv/mediawiki/php-master/includes/MediaWiki.php(868): MediaWiki->performRequest()
#13 /srv/mediawiki/php-master/includes/MediaWiki.php(525): MediaWiki->main()
#14 /srv/mediawiki/php-master/index.php(42): MediaWiki->run()
#15 /srv/mediawiki/w/index.php(3): include(string)
#16 {main}

Yeah, it may the problem as different things expect some fields to be present in the FormOptions, even we don't use it, we will have to define same set options as ChangesListSpecialPage, maybe we can re-use the ChangesListSpecialPage class (initialize it just to get the options), but honestly that is one big hack. I didn't get this error as I don't have Flow extension installed.

Let me do a step back, my question is -> do we need to call that hook? /cc @Jdlrobson

Change 464850 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/Flow@master] Hide Flow changes from Special:Watchlist on mobile

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

Let me do a step back, my question is -> do we need to call that hook? /cc @Jdlrobson

Was added by the one and only Brion Vibber so I'm guessing so!
I think it's a little dangerous for Hook users to call methods which may throw exceptions without the exception handling so it makes sense to fix this in Flow.

Change 464870 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Drop hook usage in Watchlist mobile

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

Change 464850 merged by jenkins-bot:
[mediawiki/extensions/Flow@master] UBN: Hide Flow changes from Special:Watchlist on mobile

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

Confirmed that functionality is now restored locally and on Beta Cluster.

Jdlrobson lowered the priority of this task from Unbreak Now! to Medium.Oct 5 2018, 8:48 PM

Fatals are no longer happening but we need to work out what to do with this hook inside mobilefrontend.

We decided to drop the hook usage anyway, if something goes wrong and mobile watchlist becomes unusable we are able to quickly bring back the old behavior by setting the MFWatchlistRunsChangesListSpecialPageQuery config option to true.

Change 464870 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Drop hook usage in Watchlist mobile via off feature flag

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

Testing is being taken care of in T206047.
I'll sign this off as I need to make sure we schedule revisiting this config flag (and maybe removing it) later.