Page MenuHomePhabricator

FeaturedFeedChannel must not contain a User object, since it cannot be serialized safely.
Closed, ResolvedPublic

Description

FeaturedFeedChannel gets serialized by FeatureFeeds for caching. It contains a User object, which is used to construct ParserOptions in the getFeedItem() method. The solution here would be to pass a User option (or ParserOptiosn) to getFeedItem() as a parameter.

This issue caused a production error, see T264363: Instances of User are not serializable!.

Event Timeline

Majavah added a subscriber: Majavah.

FeaturedFeedItem also caches (=serializes) a Title object

Change 661357 had a related patch set uploaded (by Majavah; owner: Majavah):
[mediawiki/extensions/FeaturedFeeds@master] Caching fixes

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

Change 661456 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] WANObjectCache: Log more info if async refresh failed.

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

Change 661673 had a related patch set uploaded (by Krinkle; owner: Aaron Schulz):
[mediawiki/core@master] objectcache: improve async cache key refresh exception logging

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

Change 662065 had a related patch set uploaded (by Daniel Kinzler; owner: Ppchelko):
[mediawiki/core@wmf/1.36.0-wmf.29] objectcache: Log more info when WANObjectCache async refresh fails

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

Change 661456 merged by jenkins-bot:
[mediawiki/core@master] objectcache: Log more info when WANObjectCache async refresh fails

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

Change 662065 merged by jenkins-bot:
[mediawiki/core@wmf/1.36.0-wmf.29] objectcache: Log more info when WANObjectCache async refresh fails

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

Mentioned in SAL (#wikimedia-operations) [2021-02-08T12:55:27Z] <daniel@deploy1001> Synchronized php-1.36.0-wmf.29/includes/libs/objectcache/wancache/WANObjectCache.php: Backport: [[gerrit:662065|objectcache: Log more info when WANObjectCache async refresh fails]] ([[phab:T264391]]) (duration: 01m 07s)

Change 661357 merged by jenkins-bot:
[mediawiki/extensions/FeaturedFeeds@master] Caching fixes

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

Change 662677 had a related patch set uploaded (by Tim Starling; owner: Majavah):
[mediawiki/extensions/FeaturedFeeds@wmf/1.36.0-wmf.29] Caching fixes

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

Change 662677 merged by jenkins-bot:
[mediawiki/extensions/FeaturedFeeds@wmf/1.36.0-wmf.29] Caching fixes

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

tstarling claimed this task.
hashar added a subscriber: hashar.

After promoting to group1:

/srv/mediawiki/php-1.36.0-wmf.29/extensions/FeaturedFeeds/includes/FeaturedFeedChannel.php:45
Call to a member function getCode() on string

from /srv/mediawiki/php-1.36.0-wmf.29/extensions/FeaturedFeeds/includes/FeaturedFeedChannel.php(45)
#0 /srv/mediawiki/php-1.36.0-wmf.29/extensions/FeaturedFeeds/includes/FeaturedFeedChannel.php(56): FeaturedFeedChannel->__construct(string, array, string)
#1 /srv/mediawiki/php-1.36.0-wmf.29/extensions/FeaturedFeeds/includes/FeaturedFeeds.php(249): FeaturedFeedChannel::fromArray(array)
#2 /srv/mediawiki/php-1.36.0-wmf.29/extensions/FeaturedFeeds/includes/FeaturedFeeds.php(60): FeaturedFeeds::getFeedsFromCached(array)
#3 /srv/mediawiki/php-1.36.0-wmf.29/extensions/FeaturedFeeds/includes/SpecialFeedItem.php(19): FeaturedFeeds::getFeeds(string)
#4 /srv/mediawiki/php-1.36.0-wmf.29/includes/specialpage/SpecialPage.php(645): SpecialFeedItem->execute(string)
#5 /srv/mediawiki/php-1.36.0-wmf.29/includes/specialpage/SpecialPageFactory.php(1405): SpecialPage->run(string)
#6 /srv/mediawiki/php-1.36.0-wmf.29/includes/MediaWiki.php(310): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#7 /srv/mediawiki/php-1.36.0-wmf.29/includes/MediaWiki.php(944): MediaWiki->performRequest()
#8 /srv/mediawiki/php-1.36.0-wmf.29/includes/MediaWiki.php(548): MediaWiki->main()
#9 /srv/mediawiki/php-1.36.0-wmf.29/index.php(53): MediaWiki->run()
#10 /srv/mediawiki/php-1.36.0-wmf.29/index.php(46): wfIndexMain()
#11 /srv/mediawiki/w/index.php(3): require(string)
#12 {main}

Change 662985 had a related patch set uploaded (by Majavah; owner: Majavah):
[mediawiki/extensions/FeaturedFeeds@master] Fix issues with recent caching update

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

Mentioned in SAL (#wikimedia-operations) [2021-02-09T15:06:32Z] <hashar@deploy1001> Synchronized php-1.36.0-wmf.29/extensions/FeaturedFeeds: Revert "Caching fixes" T264391 (duration: 01m 25s)

We went to revert the caching fix (https://gerrit.wikimedia.org/r/c/mediawiki/extensions/FeaturedFeeds/+/662956 ) and I have promoted to group 1 again.

We had ONE occurrence of:

Too few arguments to function FeaturedFeedChannel::__construct(), 3 passed in /srv/mediawiki/php-1.36.0-wmf.29/extensions/FeaturedFeeds/includes/FeaturedFeeds.php on line 214 and exactly 4 expected
/srv/mediawiki/php-1.36.0-wmf.29/extensions/FeaturedFeeds/includes/FeaturedFeedChannel.php:41

from /srv/mediawiki/php-1.36.0-wmf.29/extensions/FeaturedFeeds/includes/FeaturedFeedChannel.php(41)
#0 /srv/mediawiki/php-1.36.0-wmf.29/extensions/FeaturedFeeds/includes/FeaturedFeeds.php(214): FeaturedFeedChannel->__construct(string, array, Language)
#1 /srv/mediawiki/php-1.36.0-wmf.29/extensions/FeaturedFeeds/includes/FeaturedFeeds.php(118): FeaturedFeeds::getFeedsQuick(string)
#2 /srv/mediawiki/php-1.36.0-wmf.29/includes/HookContainer/HookContainer.php(333): FeaturedFeeds::beforePageDisplay(OutputPage, SkinVector)
#3 /srv/mediawiki/php-1.36.0-wmf.29/includes/HookContainer/HookContainer.php(140): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
#4 /srv/mediawiki/php-1.36.0-wmf.29/includes/HookContainer/HookRunner.php(1003): MediaWiki\HookContainer\HookContainer->run(string, array, array)
#5 /srv/mediawiki/php-1.36.0-wmf.29/includes/OutputPage.php(2618): MediaWiki\HookContainer\HookRunner->onBeforePageDisplay(OutputPage, SkinVector)
#6 /srv/mediawiki/php-1.36.0-wmf.29/includes/MediaWiki.php(951): OutputPage->output(boolean)
#7 /srv/mediawiki/php-1.36.0-wmf.29/includes/MediaWiki.php(964): MediaWiki->{closure}()
#8 /srv/mediawiki/php-1.36.0-wmf.29/includes/MediaWiki.php(548): MediaWiki->main()
#9 /srv/mediawiki/php-1.36.0-wmf.29/index.php(53): MediaWiki->run()
#10 /srv/mediawiki/php-1.36.0-wmf.29/index.php(46): wfIndexMain()
#11 /srv/mediawiki/w/index.php(3): require(string)
#12 {main}

The url for that single error was https://www.mediawiki.org/wiki/MediaWiki

Change 662964 had a related patch set uploaded (by Hashar; owner: Majavah):
[mediawiki/extensions/FeaturedFeeds@wmf/1.36.0-wmf.30] Revert "Caching fixes"

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

I tried on mwdebug hitting https://fr.wikipedia.org/wiki/Sp%C3%A9cial:FeedItem/featured/20210201000000/fr which apparently was not cached. Tried again after and it was much faster. But that did not result in any log message as far as i can tell :\

Change 662964 merged by jenkins-bot:
[mediawiki/extensions/FeaturedFeeds@wmf/1.36.0-wmf.30] Revert "Caching fixes"

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

Change 662965 had a related patch set uploaded (by 20after4; owner: Majavah):
[mediawiki/extensions/FeaturedFeeds@wmf/1.36.0-wmf.30] Fix issues with recent caching update

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

Change 662985 merged by jenkins-bot:
[mediawiki/extensions/FeaturedFeeds@master] Fix issues with recent caching update

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

Change 662965 abandoned by 20after4:
[mediawiki/extensions/FeaturedFeeds@wmf/1.36.0-wmf.30] Fix issues with recent caching update

Reason:

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

Change 662965 restored by 20after4:
[mediawiki/extensions/FeaturedFeeds@wmf/1.36.0-wmf.30] Fix issues with recent caching update

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

Change 662965 abandoned by 20after4:
[mediawiki/extensions/FeaturedFeeds@wmf/1.36.0-wmf.30] Fix issues with recent caching update

Reason:

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

Change 662965 restored by Thcipriani:
[mediawiki/extensions/FeaturedFeeds@wmf/1.36.0-wmf.30] Fix issues with recent caching update

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

Change 662965 merged by jenkins-bot:
[mediawiki/extensions/FeaturedFeeds@wmf/1.36.0-wmf.30] Fix issues with recent caching update

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

Mentioned in SAL (#wikimedia-operations) [2021-02-10T00:33:45Z] <ladsgroup@deploy1001> Synchronized php-1.36.0-wmf.30/extensions/FeaturedFeeds: [[gerrit:662965|Fix issues with recent caching update]] (T264391) (duration: 01m 10s)

Mentioned in SAL (#wikimedia-operations) [2021-02-10T00:42:17Z] <Amir1> changing frwiki to wmf.30 in mwdebug1002 to test T264391

mmodell added a subscriber: mmodell.

I guess so?

Change 661673 abandoned by Aaron Schulz:
[mediawiki/core@master] objectcache: improve async cache key refresh exception logging

Reason:
duplicate

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