Page MenuHomePhabricator

PHP Deprecated: strtr(): Passing null to parameter #1 ($string) of type string is deprecated
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
message
[{reqId}] {exception_url}   PHP Deprecated: strtr(): Passing null to parameter #1 ($string) of type string is deprecated
trace
from /srv/mediawiki/php-1.44.0-wmf.13/includes/libs/objectcache/MemcachedBagOStuff.php(75)
#0 [internal function]: MWExceptionHandler::handleError(int, string, string, int)
#1 /srv/mediawiki/php-1.44.0-wmf.13/includes/libs/objectcache/MemcachedBagOStuff.php(75): strtr(null, string, string)
#2 /srv/mediawiki/php-1.44.0-wmf.13/includes/libs/objectcache/BagOStuff.php(580): Wikimedia\ObjectCache\MemcachedBagOStuff->makeKeyInternal(string, array)
#3 /srv/mediawiki/php-1.44.0-wmf.13/extensions/ConfirmEdit/includes/Store/CaptchaCacheStore.php(33): Wikimedia\ObjectCache\BagOStuff->makeKey(string, null)
#4 /srv/mediawiki/php-1.44.0-wmf.13/extensions/ConfirmEdit/includes/SimpleCaptcha/SimpleCaptcha.php(1128): MediaWiki\Extension\ConfirmEdit\Store\CaptchaCacheStore->retrieve(null)
#5 /srv/mediawiki/php-1.44.0-wmf.13/extensions/ConfirmEdit/includes/SimpleCaptcha/SimpleCaptcha.php(1070): MediaWiki\Extension\ConfirmEdit\SimpleCaptcha\SimpleCaptcha->retrieveCaptcha(null)
#6 /srv/mediawiki/php-1.44.0-wmf.13/extensions/ConfirmEdit/includes/FancyCaptcha/FancyCaptcha.php(451): MediaWiki\Extension\ConfirmEdit\SimpleCaptcha\SimpleCaptcha->passCaptcha(null, null, MediaWiki\User\User)
#7 /srv/mediawiki/php-1.44.0-wmf.13/extensions/ConfirmEdit/includes/SimpleCaptcha/SimpleCaptcha.php(1034): MediaWiki\Extension\ConfirmEdit\FancyCaptcha\FancyCaptcha->passCaptcha(null, null, MediaWiki\User\User)
#8 /srv/mediawiki/php-1.44.0-wmf.13/extensions/ConfirmEdit/includes/SimpleCaptcha/SimpleCaptcha.php(1003): MediaWiki\Extension\ConfirmEdit\SimpleCaptcha\SimpleCaptcha->passCaptchaLimited(null, null, MediaWiki\User\User)
#9 /srv/mediawiki/php-1.44.0-wmf.13/extensions/ConfirmEdit/includes/SimpleCaptcha/SimpleCaptcha.php(848): MediaWiki\Extension\ConfirmEdit\SimpleCaptcha\SimpleCaptcha->passCaptchaLimitedFromRequest(MediaWiki\Request\WebRequest, MediaWiki\User\User)
#10 /srv/mediawiki/php-1.44.0-wmf.13/extensions/ConfirmEdit/includes/SimpleCaptcha/SimpleCaptcha.php(884): MediaWiki\Extension\ConfirmEdit\SimpleCaptcha\SimpleCaptcha->doConfirmEdit(WikiPage, MediaWiki\Content\WikitextContent, string, MediaWiki\Context\DerivativeContext, MediaWiki\User\User)
#11 /srv/mediawiki/php-1.44.0-wmf.13/extensions/ConfirmEdit/includes/Hooks.php(82): MediaWiki\Extension\ConfirmEdit\SimpleCaptcha\SimpleCaptcha->confirmEditMerged(MediaWiki\Context\DerivativeContext, MediaWiki\Content\WikitextContent, MediaWiki\Status\Status, string, MediaWiki\User\User, bool)
#12 /srv/mediawiki/php-1.44.0-wmf.13/includes/HookContainer/HookContainer.php(155): MediaWiki\Extension\ConfirmEdit\Hooks->onEditFilterMergedContent(MediaWiki\Context\DerivativeContext, MediaWiki\Content\WikitextContent, MediaWiki\Status\Status, string, MediaWiki\User\User, bool)
#13 /srv/mediawiki/php-1.44.0-wmf.13/includes/HookContainer/HookRunner.php(1530): MediaWiki\HookContainer\HookContainer->run(string, array)
#14 /srv/mediawiki/php-1.44.0-wmf.13/includes/editpage/Constraint/EditFilterMergedContentHookConstraint.php(88): MediaWiki\HookContainer\HookRunner->onEditFilterMergedContent(MediaWiki\Context\DerivativeContext, MediaWiki\Content\WikitextContent, MediaWiki\Status\Status, string, MediaWiki\User\User, bool)
#15 /srv/mediawiki/php-1.44.0-wmf.13/includes/editpage/Constraint/EditConstraintRunner.php(83): MediaWiki\EditPage\Constraint\EditFilterMergedContentHookConstraint->checkConstraint()
#16 /srv/mediawiki/php-1.44.0-wmf.13/includes/editpage/EditPage.php(2445): MediaWiki\EditPage\Constraint\EditConstraintRunner->checkConstraints()
#17 /srv/mediawiki/php-1.44.0-wmf.13/includes/editpage/EditPage.php(1799): MediaWiki\EditPage\EditPage->internalAttemptSavePrivate(null, bool, bool)
#18 /srv/mediawiki/php-1.44.0-wmf.13/includes/editpage/EditPage.php(735): MediaWiki\EditPage\EditPage->attemptSave(null)
#19 /srv/mediawiki/php-1.44.0-wmf.13/includes/actions/EditAction.php(66): MediaWiki\EditPage\EditPage->edit()
#20 /srv/mediawiki/php-1.44.0-wmf.13/includes/actions/SubmitAction.php(38): EditAction->show()
#21 /srv/mediawiki/php-1.44.0-wmf.13/includes/actions/ActionEntryPoint.php(732): SubmitAction->show()
#22 /srv/mediawiki/php-1.44.0-wmf.13/includes/actions/ActionEntryPoint.php(509): MediaWiki\Actions\ActionEntryPoint->performAction(Article, MediaWiki\Title\Title)
#23 /srv/mediawiki/php-1.44.0-wmf.13/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest()
#24 /srv/mediawiki/php-1.44.0-wmf.13/includes/MediaWikiEntryPoint.php(202): MediaWiki\Actions\ActionEntryPoint->execute()
#25 /srv/mediawiki/php-1.44.0-wmf.13/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#26 /srv/mediawiki/w/index.php(3): require(string)
#27 {main}
Impact
Notes

Event Timeline

Arguably two errors here...

One, BagOStuff/MemcachedBagOStuff shouldn't be trying to cache with this key (probably), and/or not passing null to strtr

Two, ConfirmEdit probably shouldn't be going so far down its own rabbit hole of code with what I'm presuming is a missing captcha id/similar (ie null)...

Change #1114431 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@master] MemcachedBagOStuff: Null coalescing $component

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

Change #1114439 had a related patch set uploaded (by Máté Szabó; author: Máté Szabó):

[mediawiki/extensions/ConfirmEdit@master] SimpleCaptcha: Don't look up captcha if no ID was given

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

Change #1114431 merged by jenkins-bot:

[mediawiki/core@master] MemcachedBagOStuff: Null coalescing $component

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

Change #1114448 had a related patch set uploaded (by Jforrester; author: Reedy):

[mediawiki/core@wmf/1.44.0-wmf.13] MemcachedBagOStuff: Null coalescing $component

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

Change #1114439 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] SimpleCaptcha: Don't look up captcha if no ID was given

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

Change #1114450 had a related patch set uploaded (by Reedy; author: Máté Szabó):

[mediawiki/extensions/ConfirmEdit@REL1_43] SimpleCaptcha: Don't look up captcha if no ID was given

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

Change #1114451 had a related patch set uploaded (by Reedy; author: Máté Szabó):

[mediawiki/extensions/ConfirmEdit@REL1_42] SimpleCaptcha: Don't look up captcha if no ID was given

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

Change #1114452 had a related patch set uploaded (by Reedy; author: Máté Szabó):

[mediawiki/extensions/ConfirmEdit@REL1_39] SimpleCaptcha: Don't look up captcha if no ID was given

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

Change #1114454 had a related patch set uploaded (by Jforrester; author: Máté Szabó):

[mediawiki/extensions/ConfirmEdit@wmf/1.44.0-wmf.13] SimpleCaptcha: Don't look up captcha if no ID was given

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

Change #1114452 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@REL1_39] SimpleCaptcha: Don't look up captcha if no ID was given

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

Change #1114451 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@REL1_42] SimpleCaptcha: Don't look up captcha if no ID was given

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

Change #1114450 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@REL1_43] SimpleCaptcha: Don't look up captcha if no ID was given

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

Change #1114454 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@wmf/1.44.0-wmf.13] SimpleCaptcha: Don't look up captcha if no ID was given

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

Mentioned in SAL (#wikimedia-operations) [2025-01-28T08:43:29Z] <reedy@deploy2002> Started scap sync-world: Backport for [[gerrit:1110053|CommonSettings: Set 'lang=en' on Wikimedia Foundation entry in $wgFooterIcons (T383501)]], [[gerrit:1114454|SimpleCaptcha: Don't look up captcha if no ID was given (T384858)]], [[gerrit:1091818|noc: Expose MobileUrlCallback.php]], [[gerrit:1108179|Disable Dns Blacklist checks (T382987)]], [[gerrit:1088655|CommonSettings.php: Remove deprecated $wg

Mentioned in SAL (#wikimedia-operations) [2025-01-28T08:48:17Z] <reedy@deploy2002> reedy, jforrester: Backport for [[gerrit:1110053|CommonSettings: Set 'lang=en' on Wikimedia Foundation entry in $wgFooterIcons (T383501)]], [[gerrit:1114454|SimpleCaptcha: Don't look up captcha if no ID was given (T384858)]], [[gerrit:1091818|noc: Expose MobileUrlCallback.php]], [[gerrit:1108179|Disable Dns Blacklist checks (T382987)]], [[gerrit:1088655|CommonSettings.php: Remove deprecated $wgOATHAu

Mentioned in SAL (#wikimedia-operations) [2025-01-28T08:56:27Z] <reedy@deploy2002> Finished scap sync-world: Backport for [[gerrit:1110053|CommonSettings: Set 'lang=en' on Wikimedia Foundation entry in $wgFooterIcons (T383501)]], [[gerrit:1114454|SimpleCaptcha: Don't look up captcha if no ID was given (T384858)]], [[gerrit:1091818|noc: Expose MobileUrlCallback.php]], [[gerrit:1108179|Disable Dns Blacklist checks (T382987)]], [[gerrit:1088655|CommonSettings.php: Remove deprecated $w

Reedy reassigned this task from Reedy to mszabo.

Looks like this is still actually happening, it's just pushed the line count down a few lines...

Error
normalized_message
[{reqId}] {exception_url}   PHP Deprecated: strtr(): Passing null to parameter #1 ($string) of type string is deprecated
FrameLocationCall
from/srv/mediawiki/php-1.44.0-wmf.13/includes/libs/objectcache/MemcachedBagOStuff.php(75)
#0[internal function]MWExceptionHandler::handleError(int, string, string, int)
#1/srv/mediawiki/php-1.44.0-wmf.13/includes/libs/objectcache/MemcachedBagOStuff.php(75)strtr(null, string, string)
#2/srv/mediawiki/php-1.44.0-wmf.13/includes/libs/objectcache/BagOStuff.php(580)Wikimedia\ObjectCache\MemcachedBagOStuff->makeKeyInternal(string, array)
#3/srv/mediawiki/php-1.44.0-wmf.13/extensions/ConfirmEdit/includes/Store/CaptchaCacheStore.php(33)Wikimedia\ObjectCache\BagOStuff->makeKey(string, null)
#4/srv/mediawiki/php-1.44.0-wmf.13/extensions/ConfirmEdit/includes/SimpleCaptcha/SimpleCaptcha.php(1134)MediaWiki\Extension\ConfirmEdit\Store\CaptchaCacheStore->retrieve(null)
#5/srv/mediawiki/php-1.44.0-wmf.13/extensions/ConfirmEdit/includes/FancyCaptcha/FancyCaptcha.php(450)MediaWiki\Extension\ConfirmEdit\SimpleCaptcha\SimpleCaptcha->retrieveCaptcha(null)
#6/srv/mediawiki/php-1.44.0-wmf.13/extensions/ConfirmEdit/includes/SimpleCaptcha/SimpleCaptcha.php(1034)MediaWiki\Extension\ConfirmEdit\FancyCaptcha\FancyCaptcha->passCaptcha(null, null, MediaWiki\User\User)
#7/srv/mediawiki/php-1.44.0-wmf.13/extensions/ConfirmEdit/includes/SimpleCaptcha/SimpleCaptcha.php(1003)MediaWiki\Extension\ConfirmEdit\SimpleCaptcha\SimpleCaptcha->passCaptchaLimited(null, null, MediaWiki\User\User)
#8/srv/mediawiki/php-1.44.0-wmf.13/extensions/ConfirmEdit/includes/SimpleCaptcha/SimpleCaptcha.php(848)MediaWiki\Extension\ConfirmEdit\SimpleCaptcha\SimpleCaptcha->passCaptchaLimitedFromRequest(MediaWiki\Request\DerivativeRequest, MediaWiki\User\User)
#9/srv/mediawiki/php-1.44.0-wmf.13/extensions/ConfirmEdit/includes/SimpleCaptcha/SimpleCaptcha.php(884)MediaWiki\Extension\ConfirmEdit\SimpleCaptcha\SimpleCaptcha->doConfirmEdit(WikiPage, MediaWiki\Content\WikitextContent, string, MediaWiki\Context\DerivativeContext, MediaWiki\User\User)
#10/srv/mediawiki/php-1.44.0-wmf.13/extensions/ConfirmEdit/includes/Hooks.php(82)MediaWiki\Extension\ConfirmEdit\SimpleCaptcha\SimpleCaptcha->confirmEditMerged(MediaWiki\Context\DerivativeContext, MediaWiki\Content\WikitextContent, MediaWiki\Status\Status, string, MediaWiki\User\User, bool)
#11/srv/mediawiki/php-1.44.0-wmf.13/includes/HookContainer/HookContainer.php(155)MediaWiki\Extension\ConfirmEdit\Hooks->onEditFilterMergedContent(MediaWiki\Context\DerivativeContext, MediaWiki\Content\WikitextContent, MediaWiki\Status\Status, string, MediaWiki\User\User, bool)
#12/srv/mediawiki/php-1.44.0-wmf.13/includes/HookContainer/HookRunner.php(1530)MediaWiki\HookContainer\HookContainer->run(string, array)
#13/srv/mediawiki/php-1.44.0-wmf.13/includes/editpage/Constraint/EditFilterMergedContentHookConstraint.php(88)MediaWiki\HookContainer\HookRunner->onEditFilterMergedContent(MediaWiki\Context\DerivativeContext, MediaWiki\Content\WikitextContent, MediaWiki\Status\Status, string, MediaWiki\User\User, bool)
#14/srv/mediawiki/php-1.44.0-wmf.13/includes/editpage/Constraint/EditConstraintRunner.php(83)MediaWiki\EditPage\Constraint\EditFilterMergedContentHookConstraint->checkConstraint()
#15/srv/mediawiki/php-1.44.0-wmf.13/includes/editpage/EditPage.php(2445)MediaWiki\EditPage\Constraint\EditConstraintRunner->checkConstraints()
#16/srv/mediawiki/php-1.44.0-wmf.13/includes/editpage/EditPage.php(1799)MediaWiki\EditPage\EditPage->internalAttemptSavePrivate(null, bool, bool)
#17/srv/mediawiki/php-1.44.0-wmf.13/includes/api/ApiEditPage.php(537)MediaWiki\EditPage\EditPage->attemptSave(null)
#18/srv/mediawiki/php-1.44.0-wmf.13/includes/api/ApiMain.php(1973)MediaWiki\Api\ApiEditPage->execute()
#19/srv/mediawiki/php-1.44.0-wmf.13/includes/api/ApiMain.php(941)MediaWiki\Api\ApiMain->executeAction()
#20/srv/mediawiki/php-1.44.0-wmf.13/includes/api/ApiMain.php(912)MediaWiki\Api\ApiMain->executeActionWithErrorHandling()
#21/srv/mediawiki/php-1.44.0-wmf.13/includes/api/ApiEntryPoint.php(152)MediaWiki\Api\ApiMain->execute()
#22/srv/mediawiki/php-1.44.0-wmf.13/includes/MediaWikiEntryPoint.php(202)MediaWiki\Api\ApiEntryPoint->execute()
#23/srv/mediawiki/php-1.44.0-wmf.13/api.php(44)MediaWiki\MediaWikiEntryPoint->run()
#24/srv/mediawiki/w/api.php(3)require(string)
#25{main}
Impact
Notes

Because FancyCaptcha overrides passCaptcha, calling retrieveCaptcha before it calls parent::passCaptcha...

	/**
	 * Delete a solved captcha image, if $wgCaptchaDeleteOnSolve is true.
	 * @inheritDoc
	 */
	protected function passCaptcha( $index, $word, $user ) {
		global $wgCaptchaDeleteOnSolve;

		// get the captcha info before it gets deleted
		$info = $this->retrieveCaptcha( $index );
		$pass = parent::passCaptcha( $index, $word, $user );

		if ( $pass && $wgCaptchaDeleteOnSolve ) {
			$this->getBackend()->quickDelete( [
				'src' => $this->imagePath( $info['salt'], $info['hash'] )
			] );
		}

		return $pass;
	}

Change #1114658 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@master] BagOStuff: Update makeKeyInternal to accept/handle null

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

Change #1114662 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/ConfirmEdit@master] FancyCaptcha: Return early in passCaptcha if not using Delete on Solve

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

^ The FancyCaptcha patch doesn't actually fully fix the issue, but would fix it for WMF production as we're not using delete on solve... The prior patch would then take effect.

However, for anyone using delete on solve (which the WMF probably should be, but that's another issue), it just kicks the can further down the road.

Change #1114658 merged by jenkins-bot:

[mediawiki/core@master] BagOStuff: Update makeKeyInternal to accept/handle null

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

Change #1114662 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] FancyCaptcha: Return early in passCaptcha in numerous cases

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

Change #1115395 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/ConfirmEdit@wmf/1.44.0-wmf.14] FancyCaptcha: Return early in passCaptcha in numerous cases

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

Change #1115396 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/ConfirmEdit@wmf/1.44.0-wmf.13] FancyCaptcha: Return early in passCaptcha in numerous cases

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

Change #1115397 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/ConfirmEdit@REL1_43] FancyCaptcha: Return early in passCaptcha in numerous cases

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

Change #1115399 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/ConfirmEdit@REL1_42] FancyCaptcha: Return early in passCaptcha in numerous cases

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

Change #1115400 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/ConfirmEdit@REL1_39] FancyCaptcha: Return early in passCaptcha in numerous cases

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

Change #1115400 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@REL1_39] FancyCaptcha: Return early in passCaptcha in numerous cases

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

Change #1115396 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@wmf/1.44.0-wmf.13] FancyCaptcha: Return early in passCaptcha in numerous cases

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

Change #1115395 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@wmf/1.44.0-wmf.14] FancyCaptcha: Return early in passCaptcha in numerous cases

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

Change #1115399 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@REL1_42] FancyCaptcha: Return early in passCaptcha in numerous cases

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

Change #1115397 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@REL1_43] FancyCaptcha: Return early in passCaptcha in numerous cases

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

Change #1114448 abandoned by Reedy:

[mediawiki/core@wmf/1.44.0-wmf.13] MemcachedBagOStuff: Null coalescing $component

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

Mentioned in SAL (#wikimedia-operations) [2025-01-30T15:43:22Z] <reedy@deploy2002> Started scap sync-world: Backport for [[gerrit:1115396|FancyCaptcha: Return early in passCaptcha in numerous cases (T384858)]], [[gerrit:1115395|FancyCaptcha: Return early in passCaptcha in numerous cases (T384858)]], [[gerrit:1115429|MultiUsernameFilter: Don't try to split ids if they're not a string (T385169)]], [[gerrit:1115430|MultiUsernameFilter: Don't try to split ids if they're not a string (T

Mentioned in SAL (#wikimedia-operations) [2025-01-30T15:46:19Z] <reedy@deploy2002> reedy: Backport for [[gerrit:1115396|FancyCaptcha: Return early in passCaptcha in numerous cases (T384858)]], [[gerrit:1115395|FancyCaptcha: Return early in passCaptcha in numerous cases (T384858)]], [[gerrit:1115429|MultiUsernameFilter: Don't try to split ids if they're not a string (T385169)]], [[gerrit:1115430|MultiUsernameFilter: Don't try to split ids if they're not a string (T385169)]], [[gerri

Mentioned in SAL (#wikimedia-operations) [2025-01-30T15:52:53Z] <reedy@deploy2002> Finished scap sync-world: Backport for [[gerrit:1115396|FancyCaptcha: Return early in passCaptcha in numerous cases (T384858)]], [[gerrit:1115395|FancyCaptcha: Return early in passCaptcha in numerous cases (T384858)]], [[gerrit:1115429|MultiUsernameFilter: Don't try to split ids if they're not a string (T385169)]], [[gerrit:1115430|MultiUsernameFilter: Don't try to split ids if they're not a string (