Page MenuHomePhabricator

TypeError: Argument 1 passed to MediaWiki\Extension\CentralAuth\CentralDomainUtils::getWikiPageUrl() must be of the type string, null given
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   TypeError: Argument 1 passed to MediaWiki\Extension\CentralAuth\CentralDomainUtils::getWikiPageUrl() must be of the type string, null given, called in /srv/mediawiki/php-1.44.0-wmf.19/extensions/CentralAuth/includes/CentralDoma
FrameLocationCall
from/srv/mediawiki/php-1.44.0-wmf.19/extensions/CentralAuth/includes/CentralDomainUtils.php(135)
#0/srv/mediawiki/php-1.44.0-wmf.19/extensions/CentralAuth/includes/CentralDomainUtils.php(126)MediaWiki\Extension\CentralAuth\CentralDomainUtils->getWikiPageUrl(null, string)
#1/srv/mediawiki/php-1.44.0-wmf.19/extensions/CentralAuth/includes/Special/SpecialCentralAutoLogin.php(725)MediaWiki\Extension\CentralAuth\CentralDomainUtils->getUrl(string, string, MediaWiki\Request\WebRequest, array)
#2/srv/mediawiki/php-1.44.0-wmf.19/extensions/CentralAuth/includes/Special/SpecialCentralAutoLogin.php(341)MediaWiki\Extension\CentralAuth\Special\SpecialCentralAutoLogin->do302Redirect(string, string, array)
#3/srv/mediawiki/php-1.44.0-wmf.19/includes/specialpage/SpecialPage.php(729)MediaWiki\Extension\CentralAuth\Special\SpecialCentralAutoLogin->execute(string)
#4/srv/mediawiki/php-1.44.0-wmf.19/includes/specialpage/SpecialPageFactory.php(1737)MediaWiki\SpecialPage\SpecialPage->run(string)
#5/srv/mediawiki/php-1.44.0-wmf.19/includes/actions/ActionEntryPoint.php(503)MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, MediaWiki\Context\RequestContext)
#6/srv/mediawiki/php-1.44.0-wmf.19/includes/actions/ActionEntryPoint.php(145)MediaWiki\Actions\ActionEntryPoint->performRequest()
#7/srv/mediawiki/php-1.44.0-wmf.19/includes/MediaWikiEntryPoint.php(202)MediaWiki\Actions\ActionEntryPoint->execute()
#8/srv/mediawiki/php-1.44.0-wmf.19/index.php(58)MediaWiki\MediaWikiEntryPoint->run()
#9/srv/mediawiki/w/index.php(3)require(string)
#10{main}
Impact

Unknown

Notes

Event Timeline

Only one error in the last 7 days (logstash).

Caused by $wgCentralAuthLoginWiki being null on the shared domain - I forgot why we did that, but this endpoint (Special:CentralAutoLogin/start) shouldn't be called on the shared domain.

Anyway, not a big deal. At most, impacts central autologin or edge login, but probably not even that in normal scenarios.

Change #1125489 had a related patch set uploaded (by D3r1ck01; author: Derick Alangi):

[mediawiki/extensions/CentralAuth@master] CentralDomainUtils: `getWikiPageUrl()` only accepts string as wiki ID

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

Change #1125491 had a related patch set uploaded (by D3r1ck01; author: Derick Alangi):

[operations/mediawiki-config@master] Set `$wgCentralAuthLoginWiki` to correct default as documented

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

Change #1125491 merged by jenkins-bot:

[operations/mediawiki-config@master] Set `$wgCentralAuthLoginWiki` to correct default as documented

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

Mentioned in SAL (#wikimedia-operations) [2025-03-11T14:03:53Z] <lucaswerkmeister-wmde@deploy2002> Started scap sync-world: Backport for [[gerrit:1125491|Set $wgCentralAuthLoginWiki to correct default as documented (T388218)]]

Mentioned in SAL (#wikimedia-operations) [2025-03-11T14:06:48Z] <lucaswerkmeister-wmde@deploy2002> d3r1ck01, lucaswerkmeister-wmde: Backport for [[gerrit:1125491|Set $wgCentralAuthLoginWiki to correct default as documented (T388218)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2025-03-11T14:15:28Z] <lucaswerkmeister-wmde@deploy2002> Finished scap sync-world: Backport for [[gerrit:1125491|Set $wgCentralAuthLoginWiki to correct default as documented (T388218)]] (duration: 11m 35s)

Change #1126573 had a related patch set uploaded (by D3r1ck01; author: Derick Alangi):

[mediawiki/extensions/CentralAuth@master] SUL3: Fix default for `wgCentralAuthLoginWiki`

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

Change #1126573 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@master] SUL3: Fix default for `wgCentralAuthLoginWiki`

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

Error
normalized_message
[{reqId}] {exception_url}   TypeError: MediaWiki\Extension\CentralAuth\CentralDomainUtils::getWikiPageUrl(): Argument #1 ($wikiId) must be of type string, null given, called in /srv/mediawiki/php-1.44.0-wmf.20/extensions/CentralAuth/includes/CentralDomain
FrameLocationCall
from/srv/mediawiki/php-1.44.0-wmf.20/extensions/CentralAuth/includes/CentralDomainUtils.php(135)
#0/srv/mediawiki/php-1.44.0-wmf.20/extensions/CentralAuth/includes/CentralDomainUtils.php(126)MediaWiki\Extension\CentralAuth\CentralDomainUtils->getWikiPageUrl(null, string)
#1/srv/mediawiki/php-1.44.0-wmf.20/extensions/CentralAuth/includes/Special/SpecialCentralAutoLogin.php(725)MediaWiki\Extension\CentralAuth\CentralDomainUtils->getUrl(string, string, MediaWiki\Request\WebRequest, array)
#2/srv/mediawiki/php-1.44.0-wmf.20/extensions/CentralAuth/includes/Special/SpecialCentralAutoLogin.php(341)MediaWiki\Extension\CentralAuth\Special\SpecialCentralAutoLogin->do302Redirect(string, string, array)
#3/srv/mediawiki/php-1.44.0-wmf.20/includes/specialpage/SpecialPage.php(729)MediaWiki\Extension\CentralAuth\Special\SpecialCentralAutoLogin->execute(string)
#4/srv/mediawiki/php-1.44.0-wmf.20/includes/specialpage/SpecialPageFactory.php(1737)MediaWiki\SpecialPage\SpecialPage->run(string)
#5/srv/mediawiki/php-1.44.0-wmf.20/includes/actions/ActionEntryPoint.php(503)MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, MediaWiki\Context\RequestContext)
#6/srv/mediawiki/php-1.44.0-wmf.20/includes/actions/ActionEntryPoint.php(145)MediaWiki\Actions\ActionEntryPoint->performRequest()
#7/srv/mediawiki/php-1.44.0-wmf.20/includes/MediaWikiEntryPoint.php(202)MediaWiki\Actions\ActionEntryPoint->execute()
#8/srv/mediawiki/php-1.44.0-wmf.20/index.php(58)MediaWiki\MediaWikiEntryPoint->run()
#9/srv/mediawiki/w/index.php(3)require(string)
#10{main}
Impact
Notes

Change #1127648 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[operations/mediawiki-config@master] Fix some SUL3 shared domain settings

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

Reedy triaged this task as High priority.Mar 17 2025, 12:22 PM

Marking this as high as it seems (well, this error is coming up during scap) to be causing intermittant failures on beta

[09:56:42] <wmf-insecte> Project beta-scap-sync-world build #198208: FAILURE in 1 min 38 sec: https://integration.wikimedia.org/ci/job/beta-scap-sync-world/198208/
[10:06:58] <wmf-insecte> Yippee, build fixed!
[10:06:58] <wmf-insecte> Project beta-scap-sync-world build #198209: FIXED in 1 min 48 sec: https://integration.wikimedia.org/ci/job/beta-scap-sync-world/198209/
[10:16:50] <wmf-insecte> Project beta-scap-sync-world build #198210: FAILURE in 1 min 41 sec: https://integration.wikimedia.org/ci/job/beta-scap-sync-world/198210/
[10:27:01] <wmf-insecte> Yippee, build fixed!
[10:27:01] <wmf-insecte> Project beta-scap-sync-world build #198211: FIXED in 1 min 52 sec: https://integration.wikimedia.org/ci/job/beta-scap-sync-world/198211/
[10:27:57] <-- _joe_ (~joe@wikimedia/GLavagetto-WMF) has quit (Quit: 🫳🌿)
[10:28:53] --> _joe_ (~joe@wikimedia/GLavagetto-WMF) has joined #wikimedia-releng
[10:50:02] <wmf-insecte> maintenance-disconnect-full-disks build 684837 integration-agent-docker-1047 (/: 25%, /srv: 95%, /var/lib/docker: 23%): OFFLINE due to disk space
[10:55:02] <wmf-insecte> maintenance-disconnect-full-disks build 684838 integration-agent-docker-1047 (/: 25%, /srv: 58%, /var/lib/docker: 22%): RECOVERY disk space OK
[11:04:03] <wmf-insecte> Project beta-scap-sync-world build #198214: FAILURE in 2 min 1 sec: https://integration.wikimedia.org/ci/job/beta-scap-sync-world/198214/
[11:07:54] <wikibugs> (update) oblivian: Allow multiple kubernetes clusters to be used [repos/releng/scap] - https://gitlab.wikimedia.org/repos/releng/scap/-/merge_requests/681 (https://phabricator.wikimedia.org/T388761)
[11:08:09] <wmf-insecte> Yippee, build fixed!
[11:08:10] <wmf-insecte> Project beta-scap-sync-world build #198215: FIXED in 2 min 1 sec: https://integration.wikimedia.org/ci/job/beta-scap-sync-world/198215/
[11:08:39] <wikibugs> (update) oblivian: Allow multiple kubernetes clusters to be used [repos/releng/scap] - https://gitlab.wikimedia.org/repos/releng/scap/-/merge_requests/681 (https://phabricator.wikimedia.org/T388761)
[11:11:01] <-> jgleeson|afk is now known as jgleeson
[11:16:46] <wmf-insecte> Project beta-scap-sync-world build #198216: FAILURE in 1 min 36 sec: https://integration.wikimedia.org/ci/job/beta-scap-sync-world/198216/
[11:38:29] <wmf-insecte> Yippee, build fixed!
[11:38:29] <wmf-insecte> Project beta-scap-sync-world build #198217: FIXED in 13 min: https://integration.wikimedia.org/ci/job/beta-scap-sync-world/198217/
[11:49:38] <wikibugs> (PS2) Arthur taylor: Update list of phpunit config files to copy to log directory [integration/quibble] - https://gerrit.wikimedia.org/r/1113983 (https://phabricator.wikimedia.org/T378797)
[11:58:10] <wikibugs> (open) aklapper: Draft: Remove "Burnup Graph" project menu item code [repos/phabricator/extensions] (wmf/stable) - https://gitlab.wikimedia.org/repos/phabricator/extensions/-/merge_requests/53 (https://phabricator.wikimedia.org/T388664)
[11:59:55] --> aiko (uid541070@wikimedia/achou-wmf) has joined #wikimedia-releng
[12:06:39] <wmf-insecte> Project beta-scap-sync-world build #198221: FAILURE in 1 min 35 sec: https://integration.wikimedia.org/ci/job/beta-scap-sync-world/198221/
[12:06:44] <wikibugs> (CR) CI reject: [V:-1] Update list of phpunit config files to copy to log directory [integration/quibble] - https://gerrit.wikimedia.org/r/1113983 (https://phabricator.wikimedia.org/T378797) (owner: Arthur taylor)
[12:16:48] <wmf-insecte> Project beta-scap-sync-world build #198222: STILL FAILING in 1 min 40 sec: https://integration.wikimedia.org/ci/job/beta-scap-sync-world/198222/
[12:18:56] <Reedy> who broke it
[12:19:07] <Reedy> >12:16:48 [11 hits] TypeError: MediaWiki\Extension\CentralAuth\CentralDomainUtils::getWikiPageUrl(): Argument #1 ($wikiId) must be of type string, null given, called in /srv/mediawiki/php-master/extensions/CentralAuth/includes/CentralDomainUtils.p
Reedy renamed this task from TypeError: Argument 1 passed to MediaWiki\Extension\CentralAuth\CentralDomainUtils::getWikiPageUrl() must be of the type string, null given, called in /srv/mediawiki/php-1.44.0-wmf.19/extensions/CentralAuth/includes/CentralDoma to TypeError: Argument 1 passed to MediaWiki\Extension\CentralAuth\CentralDomainUtils::getWikiPageUrl() must be of the type string, null given.Mar 17 2025, 12:26 PM

rECAU8b7bb772f9ba: Do not trigger edge login on the shared domain would probably fix this (although the config change will fix it first). Still super rare in production though (50 instances in a week), not sure what's going on in beta.

Change #1127648 merged by jenkins-bot:

[operations/mediawiki-config@master] Fix some SUL3 shared domain settings

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

Mentioned in SAL (#wikimedia-operations) [2025-03-17T13:52:05Z] <tgr@deploy2002> Started scap sync-world: Backport for [[gerrit:1127648|Fix some SUL3 shared domain settings (T388218)]]

This is caused (or at least made much more frequent and user-impacting) by rECAUdb2f788461f6: Try both SUL2 and SUL3 central domain for autologin (and consequently blocking T384153: SUL3 Phase 3: All existing user login on group 0 and group 1 wikis).

The config change ran afoul of scap tests - we need to figure out if top-level autologin is a reasonable thing to happen when visiting the central login page, and then either block it or update scap tests to expect it.

An example of the error that blocked deployment is

Argument 1 passed to MediaWiki\Extension\CentralAuth\CentralDomainUtils::getWikiPageUrl() must be of the type string, null given, called in /srv/mediawiki/php-1.44.0-wmf.20/extensions/CentralAuth/includes/CentralDomainUtils.php on line 155
	
from /srv/mediawiki/php-1.44.0-wmf.20/extensions/CentralAuth/includes/CentralDomainUtils.php(164)
#0 /srv/mediawiki/php-1.44.0-wmf.20/extensions/CentralAuth/includes/CentralDomainUtils.php(155): MediaWiki\Extension\CentralAuth\CentralDomainUtils->getWikiPageUrl(null, string)
#1 /srv/mediawiki/php-1.44.0-wmf.20/extensions/CentralAuth/includes/Special/SpecialCentralAutoLogin.php(757): MediaWiki\Extension\CentralAuth\CentralDomainUtils->getUrl(string, string, MediaWiki\Request\WebRequest, array)
#2 /srv/mediawiki/php-1.44.0-wmf.20/extensions/CentralAuth/includes/Special/SpecialCentralAutoLogin.php(393): MediaWiki\Extension\CentralAuth\Special\SpecialCentralAutoLogin->do302Redirect(string, string, array)
#3 /srv/mediawiki/php-1.44.0-wmf.20/includes/specialpage/SpecialPage.php(729): MediaWiki\Extension\CentralAuth\Special\SpecialCentralAutoLogin->execute(string)
#4 /srv/mediawiki/php-1.44.0-wmf.20/includes/specialpage/SpecialPageFactory.php(1737): MediaWiki\SpecialPage\SpecialPage->run(string)
#5 /srv/mediawiki/php-1.44.0-wmf.20/includes/actions/ActionEntryPoint.php(503): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, MediaWiki\Context\RequestContext)
#6 /srv/mediawiki/php-1.44.0-wmf.20/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest()
#7 /srv/mediawiki/php-1.44.0-wmf.20/includes/MediaWikiEntryPoint.php(202): MediaWiki\Actions\ActionEntryPoint->execute()
#8 /srv/mediawiki/php-1.44.0-wmf.20/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#9 /srv/mediawiki/w/index.php(3): require(string)
#10 {main}

/loginwiki/wiki/Special:CentralAutoLogin/checkLoggedIn?returnUrlToken=...&type=redirect&useformat=desktop&useformat=desktop&usesul3=1&wikiid=testwiki

So that's a top-level autologin URL with SUL3 enabled (originating from testwiki). Because the SUL2/SUL3 sync patch makes /checkLoggedIn on the shared domain fall back to /checkLoggedIn on loginwiki, it needs to be able to know about loginwiki when we are on the shared domain. So rOMWC97ddae5ece80: Fix some SUL3 shared domain settings definitely needs to happen. But deploying it resulted in an no-cookies request to https://auth.wikimedia.org/enwiki/wiki/Special:UserLogin (which is one of the scap tests) trigger top-level autologin, because CentralDomainUtils::isCentralDomain() is false (since SUL3 is disabled, the central domain is loginwiki, not the shared domain).

If that top-level autologin is fine, we need to update the scap check to expect a redirect instead. If it's not fine, starting top-level autologin should be suppressed while on the central domain. I think the latter makes more sense, just to keep things simple - if the local wiki sends you to to the shared domain and then the shared domain sends you to loginwiki for autologin, that becomes really hard to reason about. (There would be some functional value during the rollout, when we redirect someone for a credentials change. Not much though, and it'd only be useful for the next two weeks.) Also, just pragmatically, the scap tests are somewhere in puppet and so much more of a hassle to change.

Change #1128495 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/CentralAuth@master] Do not initiate central login on the passive central domain

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

Change #1128496 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[operations/mediawiki-config@master] Re-apply "Fix some SUL3 shared domain settings"

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

Change #1128495 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@master] Do not initiate central login on the passive central domain

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

Change #1128515 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/CentralAuth@wmf/1.44.0-wmf.20] Do not initiate central login on the passive central domain

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

Change #1125489 abandoned by Bartosz Dziewoński:

[mediawiki/extensions/CentralAuth@master] Check both active and passive central authentication domains

Reason:

We went with a different solution.

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

Change #1128515 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@wmf/1.44.0-wmf.20] Do not initiate central login on the passive central domain

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

Mentioned in SAL (#wikimedia-operations) [2025-03-17T21:06:58Z] <tgr@deploy2002> Started scap sync-world: Backport for [[gerrit:1128501|Do not trigger edge login on the shared domain]], [[gerrit:1128515|Do not initiate central login on the passive central domain (T388218)]]

Mentioned in SAL (#wikimedia-operations) [2025-03-17T21:10:43Z] <tgr@deploy2002> tgr: Backport for [[gerrit:1128501|Do not trigger edge login on the shared domain]], [[gerrit:1128515|Do not initiate central login on the passive central domain (T388218)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2025-03-17T21:32:51Z] <tgr@deploy2002> Finished scap sync-world: Backport for [[gerrit:1128501|Do not trigger edge login on the shared domain]], [[gerrit:1128515|Do not initiate central login on the passive central domain (T388218)]] (duration: 25m 53s)

Change #1128496 merged by jenkins-bot:

[operations/mediawiki-config@master] Re-apply "Fix some SUL3 shared domain settings"

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

Mentioned in SAL (#wikimedia-operations) [2025-03-17T21:36:03Z] <tgr@deploy2002> Started scap sync-world: Backport for [[gerrit:1128496|Re-apply "Fix some SUL3 shared domain settings" (T388218)]]

Mentioned in SAL (#wikimedia-operations) [2025-03-17T21:40:48Z] <tgr@deploy2002> tgr: Backport for [[gerrit:1128496|Re-apply "Fix some SUL3 shared domain settings" (T388218)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2025-03-17T22:40:38Z] <tgr@deploy2002> Finished scap sync-world: Backport for [[gerrit:1128496|Re-apply "Fix some SUL3 shared domain settings" (T388218)]] (duration: 64m 35s)

Anything left to do here? Or can this be marked as resolved?