Page MenuHomePhabricator

Pages transcluding Special:ManageMentors are sometimes being rendered in the default skin
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:
This error does not occur every time.

image.png (987×1 px, 180 KB)

https://performance.wikimedia.org/excimer/profile/ad3ee062fa3da77f
image.png (893×1 px, 318 KB)

Incorrectly rendered as vector2022.
ReqId = 5c73572e-0de9-4682-85cd-1a6153624060

Event Timeline

Func subscribed.

Looks like a special page transclusion issue again. Recently: T343384

Func renamed this task from Unknown skin rendering error on certain pages of the Chinese Wikipedia to Pages transcluding Special:ManageMentors are sometimes being rendered in the default skin.Sep 19 2023, 1:55 PM

The following deprecation message was captured after applying patch 958540:

PHP Deprecated: Use of RequestContext::getMain while called from MediaWiki\SpecialPage\SpecialPageFactory::capturePath is deprecated since 1.41. [Called from GrowthExperiments\WelcomeSurveyHooks::onSpecialPageBeforeExecute]
#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, string)
#1 /path/to/mediawiki/REL1_40/includes/debug/MWDebug.php(382): trigger_error(string, integer)
#2 /path/to/mediawiki/REL1_40/includes/debug/MWDebug.php(352): MWDebug::sendRawDeprecated(string, boolean, string)
#3 /path/to/mediawiki/REL1_40/includes/GlobalFunctions.php(791): MWDebug::deprecatedMsg(string, boolean, boolean, integer)
#4 /path/to/mediawiki/REL1_40/includes/context/RequestContext.php(551): wfDeprecatedMsg(string)
#5 /path/to/mediawiki/REL1_40/extensions/GrowthExperiments/includes/WelcomeSurveyHooks.php(138): RequestContext::getMain()
#6 /path/to/mediawiki/REL1_40/includes/HookContainer/HookContainer.php(160): GrowthExperiments\WelcomeSurveyHooks->onSpecialPageBeforeExecute(GrowthExperiments\Specials\SpecialManageMentors, NULL)
#7 /path/to/mediawiki/REL1_40/includes/HookContainer/HookRunner.php(3729): MediaWiki\HookContainer\HookContainer->run(string, array)
#8 /path/to/mediawiki/REL1_40/includes/specialpage/SpecialPage.php(694): MediaWiki\HookContainer\HookRunner->onSpecialPageBeforeExecute(GrowthExperiments\Specials\SpecialManageMentors, NULL)
#9 /path/to/mediawiki/REL1_40/includes/specialpage/SpecialPageFactory.php(1475): SpecialPage->run(NULL)
#10 /path/to/mediawiki/REL1_40/includes/specialpage/SpecialPageFactory.php(1545): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext, boolean, MediaWiki\Linker\LinkRenderer)
#11 /path/to/mediawiki/REL1_40/includes/context/RequestContext.php(577): MediaWiki\SpecialPage\SpecialPageFactory->MediaWiki\SpecialPage\{closure}()
#12 /path/to/mediawiki/REL1_40/includes/specialpage/SpecialPageFactory.php(1541): RequestContext::withDeprecatedGetMainAccess(string, string, Closure)
#13 /path/to/mediawiki/REL1_40/includes/parser/Parser.php(3205): MediaWiki\SpecialPage\SpecialPageFactory->capturePath(MediaWiki\Title\Title, RequestContext, MediaWiki\Linker\LinkRenderer)
[removed as unimportant]

Change 958974 had a related patch set uploaded (by Func; author: Func):

[mediawiki/extensions/GrowthExperiments@master] WelcomeSurveyHooks: Use context of the SpecialPage object

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

Change 958974 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] WelcomeSurveyHooks: Use context of the SpecialPage object

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

Urbanecm_WMF subscribed.

Thanks @Func for the patch! Moving this for Growth QA.

Etonkovidova subscribed.

Checked on testwiki wmf.28 - transcluding Special:ManageMentors page doesn't switch UI to vector skin (checked the page https://zh.wikipedia.org/wiki/Wikipedia:Growth團隊功能/導師列表 too).

It seems to still happen, but it doesn't seem to happen in safemode.
normal reqId = 366bbc88-ad74-46d9-b8fb-06b7c57179a3 (skin=vector-2022)
safemode reqId = db24ffe6-0264-41b5-9b3b-3fd07491971f (skin=vector-2010)

Note: more stable way to reproduce is using action=purge

It seems to still happen, but it doesn't seem to happen in safemode.
normal reqId = 366bbc88-ad74-46d9-b8fb-06b7c57179a3 (skin=vector-2022)
safemode reqId = db24ffe6-0264-41b5-9b3b-3fd07491971f (skin=vector-2010)

I cannot reproduce that with my staff account. Assuming it only happens in safemode, it appears to be an issue within one of the gadgets on your wiki. Would you mind trying to individually disable gadgets in your preferences, and see which one causes this problem? We can then help you identify the cause in the gadget.

EDIT: My fault, I forgot to set my skin to something else than V22.I can reproduce this well, lemme investigate.

Change 962235 had a related patch set uploaded (by Func; author: Func):

[mediawiki/extensions/GrowthExperiments@master] SpecialManageMentors: Skip OOUI initialization when transcluding

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

Thank you @Func for your work on this task and for helping this task to see its end. This task is definitely one of the more difficult bugs to fix, considering it doesn't always happen, is tricky to reproduce locally and similar, so thank you for taking this on. Thanks to @SunAfterRain for reporting and thoroughly testing as well.

I have merged @Func's fix, hopefully it resolves the issue for good once deployed.

Change 962235 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] SpecialManageMentors: Skip OOUI initialization when transcluding

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

Change 963347 had a related patch set uploaded (by Urbanecm; author: Func):

[mediawiki/extensions/GrowthExperiments@wmf/1.41.0-wmf.29] SpecialManageMentors: Skip OOUI initialization when transcluding

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

Change 963348 had a related patch set uploaded (by Urbanecm; author: Func):

[mediawiki/extensions/GrowthExperiments@wmf/1.41.0-wmf.28] SpecialManageMentors: Skip OOUI initialization when transcluding

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

Change 963347 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@wmf/1.41.0-wmf.29] SpecialManageMentors: Skip OOUI initialization when transcluding

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

Change 963348 merged by Urbanecm:

[mediawiki/extensions/GrowthExperiments@wmf/1.41.0-wmf.28] SpecialManageMentors: Skip OOUI initialization when transcluding

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

Mentioned in SAL (#wikimedia-operations) [2023-10-04T20:46:55Z] <urbanecm@deploy2002> Started scap: Backport for [[gerrit:963347|SpecialManageMentors: Skip OOUI initialization when transcluding (T346760)]], [[gerrit:963348|SpecialManageMentors: Skip OOUI initialization when transcluding (T346760)]], [[gerrit:963349|Fix phan for GrowthExperiments (T347571)]]

Mentioned in SAL (#wikimedia-operations) [2023-10-04T20:48:20Z] <urbanecm@deploy2002> urbanecm: Backport for [[gerrit:963347|SpecialManageMentors: Skip OOUI initialization when transcluding (T346760)]], [[gerrit:963348|SpecialManageMentors: Skip OOUI initialization when transcluding (T346760)]], [[gerrit:963349|Fix phan for GrowthExperiments (T347571)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2023-10-04T20:54:45Z] <urbanecm@deploy2002> Finished scap: Backport for [[gerrit:963347|SpecialManageMentors: Skip OOUI initialization when transcluding (T346760)]], [[gerrit:963348|SpecialManageMentors: Skip OOUI initialization when transcluding (T346760)]], [[gerrit:963349|Fix phan for GrowthExperiments (T347571)]] (duration: 07m 49s)

@Func I took the liberty of backporting your patch to production, hope that's fine.

@Func @SunAfterRain Do you mind testing this again on zhwiki, and reporting in case this still happens? It appears to work fine on my end now.

@ Func @SunAfterRain Do you mind testing this again on zhwiki, and reporting in case this still happens? It appears to work fine on my end now.

It doesn't look like it happened again.