VOOZH about

URL: https://phabricator.wikimedia.org/T425988

⇱ ⚓ T425988 Deprecated: Accessing the language without explicitly setting it via MediaHandler:setLanguage, MediaHandler::getHandler, or MediaHandlerFactory::getHandler


Maniphest T425988

Deprecated: Accessing the language without explicitly setting it via MediaHandler:setLanguage, MediaHandler::getHandler, or MediaHandlerFactory::getHandler
Closed, ResolvedPublic

Description

Follow-up to T425740 and T425782. The reproduction steps in these tasks result in a deprecation warning now (instead of an exception):

https://beta-logs.wmcloud.org/app/discover#/doc/5f0c9be0-0b6f-11ec-9cde-3f4490e09a26/logstash-deploy-1-7.0.0-1-2026.05.11?id=hTFSGJ4BOEmKfgOiIOPQ

PHP Deprecated: Accessing the language without explicitly setting it via MediaHandler:setLanguage, MediaHandler::getHandler, or MediaHandlerFactory::getHandler was deprecated in 1.46. [Called from MediaWiki\Media\ImageHandler::getDimensionsString]

https://beta-logs.wmcloud.org/app/discover#/doc/5f0c9be0-0b6f-11ec-9cde-3f4490e09a26/logstash-deploy-1-7.0.0-1-2026.05.11?id=NQlaGJ4Bo2vdLX3jfq0Y

PHP Deprecated: Accessing the language without explicitly setting it via MediaHandler:setLanguage, MediaHandler::getHandler, or MediaHandlerFactory::getHandler was deprecated in 1.46. [Called from MediaWiki\Media\ImageHandler::getLongDesc]

Event Timeline

Comment Actions

After deploying 1.47.0-wmf.2 to the group0 wikis, we now see ~15000 deprecation errors logged per hour for this task.

I'd really appreciate reducing this level of noise before deploying to group1 tomorrow UTC morning.

Listing the errors here for findability, noisiest first:

Comment Actions

Change #1284897 had a related patch set uploaded (by MGChecker; author: MGChecker):

[mediawiki/core@master] Fix MediaHandler caching to not preserve language

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

Comment Actions

If we merge the attached patch, the warnings should subside. Once they do subside, we can re-revert to replace the deprecation warnings with RuntimeErrors.

dancy triaged this task as Unbreak Now! priority.May 12 2026, 6:14 PM
Comment Actions

The volume of warnings has moved us dangerously close to the point where scap deployments will start complaining about it. This is not a place we want to be so I increased this priority of this ticket to Unbreak Now.

Comment Actions

From a recent deployment

17:56:20 Waiting 20 seconds for production traffic...
17:56:40 Logstash checker counted 107 error(s) in the last 20 seconds. OK.

The threshold is 150.

Comment Actions

Change #1284897 merged by jenkins-bot:

[mediawiki/core@master] Fix MediaHandler caching to not preserve language

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

Comment Actions

Change #1286464 had a related patch set uploaded (by Jforrester; author: MGChecker):

[mediawiki/core@wmf/1.47.0-wmf.2] Fix MediaHandler caching to not preserve language

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

Comment Actions

Change #1286465 had a related patch set uploaded (by Jforrester; author: MGChecker):

[mediawiki/core@wmf/1.47.0-wmf.1] Fix MediaHandler caching to not preserve language

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

Comment Actions

Change #1286464 merged by jenkins-bot:

[mediawiki/core@wmf/1.47.0-wmf.2] Fix MediaHandler caching to not preserve language

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

Comment Actions

Mentioned in SAL (#wikimedia-operations) [2026-05-12T19:27:38Z] <dancy@deploy1003> Started scap sync-world: Backport for [[gerrit:1286464|Fix MediaHandler caching to not preserve language (T425988 T425740 T425782)]]

Comment Actions

Mentioned in SAL (#wikimedia-operations) [2026-05-12T19:30:04Z] <dancy@deploy1003> jforrester, dancy: Backport for [[gerrit:1286464|Fix MediaHandler caching to not preserve language (T425988 T425740 T425782)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Comment Actions

Mentioned in SAL (#wikimedia-operations) [2026-05-12T19:34:45Z] <dancy@deploy1003> Finished scap sync-world: Backport for [[gerrit:1286464|Fix MediaHandler caching to not preserve language (T425988 T425740 T425782)]] (duration: 07m 07s)

Comment Actions

Change #1286508 had a related patch set uploaded (by MGChecker; author: MGChecker):

[mediawiki/core@master] Revert "Remove File::getHandler language fallback"

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

Comment Actions

Change #1286509 had a related patch set uploaded (by MGChecker; author: MGChecker):

[mediawiki/core@master] Revert^2 "Remove MediaHandler language fallback"

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

Comment Actions

Test wiki created on Patch demo by MGChecker using patch(es) linked to this task:
https://9e835d5acf.catalyst.wmcloud.org/w/

Comment Actions

The first revert I just uploaded here can be merged and deployed asap, and should make the warnings subside. The associated change was the direct cause for the warnings to surface.

Meanwhilee, I will take a look at the second patch to figure out what's actually going on.

Comment Actions

@MGChecker i'll try to backport 1286508 in a few minutes.

Comment Actions

Sounds good to me. Meanwhile, I found out that in a similar (yet more localised) manner as did, caches its handler, preserving the issue we found.

Experimental (but successfully tested) fix in the second changeset, but we can probably leave it with the first change for wmf2 while we put the proper fix under scrutiny.

Comment Actions

Change #1286508 merged by jenkins-bot:

[mediawiki/core@master] Revert "Remove File::getHandler language fallback"

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

Comment Actions

Change #1286515 had a related patch set uploaded (by C. Scott Ananian; author: MGChecker):

[mediawiki/core@wmf/1.47.0-wmf.2] Revert "Remove File::getHandler language fallback"

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

Comment Actions

Change #1286515 merged by jenkins-bot:

[mediawiki/core@wmf/1.47.0-wmf.2] Revert "Remove File::getHandler language fallback"

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

Comment Actions

Mentioned in SAL (#wikimedia-operations) [2026-05-12T23:33:36Z] <cscott@deploy1003> Started scap sync-world: Backport for [[gerrit:1286506|Re-enable unit tests with updated output]], [[gerrit:1286516|Re-enable ContentHolderTest with updated output]], [[gerrit:1286515|Revert "Remove File::getHandler language fallback" (T425988)]]

Comment Actions

Mentioned in SAL (#wikimedia-operations) [2026-05-12T23:39:14Z] <cscott@deploy1003> cscott: Backport for [[gerrit:1286506|Re-enable unit tests with updated output]], [[gerrit:1286516|Re-enable ContentHolderTest with updated output]], [[gerrit:1286515|Revert "Remove File::getHandler language fallback" (T425988)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Comment Actions

Are stats on the logging rate (semi-)publicly accessible?

Comment Actions

Mentioned in SAL (#wikimedia-operations) [2026-05-12T23:46:22Z] <cscott@deploy1003> Finished scap sync-world: Backport for [[gerrit:1286506|Re-enable unit tests with updated output]], [[gerrit:1286516|Re-enable ContentHolderTest with updated output]], [[gerrit:1286515|Revert "Remove File::getHandler language fallback" (T425988)]] (duration: 12m 45s)

Comment Actions

This has been deployed. https://logstash.wikimedia.org/goto/e61c8e222ac0415fedfd7d1f8792b100 showed 330,573 instances of this log over the past 24 hours, but none since deploying the revert.

dancy lowered the priority of this task from Unbreak Now! to Needs Triage.May 13 2026, 2:40 PM
Comment Actions

Thanks @MGChecker and @cscott!

Comment Actions

Change #1294483 had a related patch set uploaded (by MGChecker; author: MGChecker):

[mediawiki/core@REL1_46] Revert^2 "Remove MediaHandler language fallback"

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

Comment Actions

Change #1286509 merged by jenkins-bot:

[mediawiki/core@master] Revert^2 "Remove MediaHandler language fallback"

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

Comment Actions

Change #1294483 merged by jenkins-bot:

[mediawiki/core@REL1_46] Revert^2 "Remove MediaHandler language fallback"

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

MGChecker claimed this task.
MGChecker edited projects, added: MW-1.46-release; removed: Patch-For-Review, Commons.
Comment Actions

Change #1286465 abandoned by Hashar:

[mediawiki/core@wmf/1.47.0-wmf.1] Fix MediaHandler caching to not preserve language

Reason:

Abandoning per previous comment. The reason is the change targets 1.47.0-wmf.1 which is no more live in production (we are at wmf.4).

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

Comment Actions

Test wiki on Patch demo by MGChecker using patch(es) linked to this task was deleted:

Content licensed under Creative Commons Attribution-ShareAlike (CC BY-SA) 4.0 unless otherwise noted; code licensed under GNU General Public License (GPL) 2.0 or later and other open source licenses. By using this site, you agree to the Terms of Use, Privacy Policy, and Code of Conduct. · Wikimedia Foundation · Privacy Policy · Code of Conduct · Terms of Use · Disclaimer · CC-BY-SA · GPL · Credits