Page MenuHomePhabricator

PHP Warning: Undefined array key "physicalWidth"
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error 1
  • mwversion: 1.46.0-wmf.22
  • timestamp: 2026-04-01T19:44:44.977Z
  • phpversion: 8.3.30
  • reqId: fb08da06-bce3-45b5-87ab-248e11238f58
  • Find reqId in Logstash
normalized_message
[{reqId}] {exception_url}   PHP Warning: Undefined array key "physicalWidth"
FrameLocationCall
from/srv/mediawiki/php-1.46.0-wmf.22/extensions/TimedMediaHandler/includes/TimedMediaHandler.php(168)
#0/srv/mediawiki/php-1.46.0-wmf.22/extensions/TimedMediaHandler/includes/TimedMediaHandler.php(168)MediaWiki\Exception\MWExceptionHandler::handleError(int, string, string, int)
#1/srv/mediawiki/php-1.46.0-wmf.22/includes/Page/ImagePage.php(718)MediaWiki\TimedMediaHandler\TimedMediaHandler->normaliseParams(MediaWiki\FileRepo\File\LocalFile, array)
#2/srv/mediawiki/php-1.46.0-wmf.22/includes/Page/ImagePage.php(437)MediaWiki\Page\ImagePage->getThumbPrevText(array, string)
#3/srv/mediawiki/php-1.46.0-wmf.22/includes/Page/ImagePage.php(141)MediaWiki\Page\ImagePage->openShowImage()
#4/srv/mediawiki/php-1.46.0-wmf.22/includes/Actions/ViewAction.php(71)MediaWiki\Page\ImagePage->view()
#5/srv/mediawiki/php-1.46.0-wmf.22/includes/Actions/ActionEntryPoint.php(752)MediaWiki\Actions\ViewAction->show()
#6/srv/mediawiki/php-1.46.0-wmf.22/includes/Actions/ActionEntryPoint.php(511)MediaWiki\Actions\ActionEntryPoint->performAction(MediaWiki\Page\ImagePage, MediaWiki\Title\Title)
#7/srv/mediawiki/php-1.46.0-wmf.22/includes/Actions/ActionEntryPoint.php(145)MediaWiki\Actions\ActionEntryPoint->performRequest()
#8/srv/mediawiki/php-1.46.0-wmf.22/includes/MediaWikiEntryPoint.php(180)MediaWiki\Actions\ActionEntryPoint->execute()
#9/srv/mediawiki/php-1.46.0-wmf.22/index.php(44)MediaWiki\MediaWikiEntryPoint->run()
#10/srv/mediawiki/w/index.php(3)require(string)
#11{main}
Error 2
  • mwversion: 1.46.0-wmf.22
  • timestamp: 2026-04-01T19:50:53.996Z
  • phpversion: 8.3.30
  • reqId: a1692a7f-1e17-4ab8-b9a9-0f45f262ea67
  • Find reqId in Logstash
normalized_message
[{reqId}] {exception_url}   TypeError: MediaWiki\TimedMediaHandler\TimedMediaHandler::getSteppedThumbWidth(): Argument #2 ($requestWidth) must be of type int, null given, called in /srv/mediawiki/php-1.46.0-wmf.22/extensions/TimedMediaHandler/includes/Tim
FrameLocationCall
from/srv/mediawiki/php-1.46.0-wmf.22/extensions/TimedMediaHandler/includes/TimedMediaHandler.php(193)
#0/srv/mediawiki/php-1.46.0-wmf.22/extensions/TimedMediaHandler/includes/TimedMediaHandler.php(167)MediaWiki\TimedMediaHandler\TimedMediaHandler->getSteppedThumbWidth(MediaWiki\FileRepo\File\LocalFile, null, int, int)
#1/srv/mediawiki/php-1.46.0-wmf.22/includes/Page/ImagePage.php(718)MediaWiki\TimedMediaHandler\TimedMediaHandler->normaliseParams(MediaWiki\FileRepo\File\LocalFile, array)
#2/srv/mediawiki/php-1.46.0-wmf.22/includes/Page/ImagePage.php(437)MediaWiki\Page\ImagePage->getThumbPrevText(array, string)
#3/srv/mediawiki/php-1.46.0-wmf.22/includes/Page/ImagePage.php(141)MediaWiki\Page\ImagePage->openShowImage()
#4/srv/mediawiki/php-1.46.0-wmf.22/includes/Actions/ViewAction.php(71)MediaWiki\Page\ImagePage->view()
#5/srv/mediawiki/php-1.46.0-wmf.22/includes/Actions/ActionEntryPoint.php(752)MediaWiki\Actions\ViewAction->show()
#6/srv/mediawiki/php-1.46.0-wmf.22/includes/Actions/ActionEntryPoint.php(511)MediaWiki\Actions\ActionEntryPoint->performAction(MediaWiki\Page\ImagePage, MediaWiki\Title\Title)
#7/srv/mediawiki/php-1.46.0-wmf.22/includes/Actions/ActionEntryPoint.php(145)MediaWiki\Actions\ActionEntryPoint->performRequest()
#8/srv/mediawiki/php-1.46.0-wmf.22/includes/MediaWikiEntryPoint.php(180)MediaWiki\Actions\ActionEntryPoint->execute()
#9/srv/mediawiki/php-1.46.0-wmf.22/index.php(44)MediaWiki\MediaWikiEntryPoint->run()
#10/srv/mediawiki/w/index.php(3)require(string)
#11{main}
Impact

High warning logging rate

Notes

Probably related to https://gerrit.wikimedia.org/r/c/mediawiki/extensions/TimedMediaHandler/+/1266327

Event Timeline

dancy triaged this task as High priority.Apr 1 2026, 7:50 PM
dancy added a subscriber: Ladsgroup.

[Now redundant with task description]

That needs a wrapper to check for physicalWidth. Let me make a patch quickly for it.

Change #1266382 had a related patch set uploaded (by Ladsgroup; author: Ladsgroup):

[mediawiki/extensions/TimedMediaHandler@master] Only set the thumb step when width is given

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

I need to be afk for two hours, If anyone can backport this, I'd appreciate it otherwise I'll do it once I'm back

Change #1266382 merged by jenkins-bot:

[mediawiki/extensions/TimedMediaHandler@master] Only set the thumb step when width is given

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

Change #1266406 had a related patch set uploaded (by Scott French; author: Ladsgroup):

[mediawiki/extensions/TimedMediaHandler@wmf/1.46.0-wmf.21] Only set the thumb step when width is given

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

Change #1266407 had a related patch set uploaded (by Scott French; author: Ladsgroup):

[mediawiki/extensions/TimedMediaHandler@wmf/1.46.0-wmf.22] Only set the thumb step when width is given

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

Change #1266406 merged by jenkins-bot:

[mediawiki/extensions/TimedMediaHandler@wmf/1.46.0-wmf.21] Only set the thumb step when width is given

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

Change #1266407 merged by jenkins-bot:

[mediawiki/extensions/TimedMediaHandler@wmf/1.46.0-wmf.22] Only set the thumb step when width is given

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

Mentioned in SAL (#wikimedia-operations) [2026-04-01T21:35:00Z] <swfrench@deploy1003> Started scap sync-world: Backport for [[gerrit:1266406|Only set the thumb step when width is given (T422074)]], [[gerrit:1266407|Only set the thumb step when width is given (T422074)]]

Mentioned in SAL (#wikimedia-operations) [2026-04-01T21:36:56Z] <swfrench@deploy1003> swfrench: Backport for [[gerrit:1266406|Only set the thumb step when width is given (T422074)]], [[gerrit:1266407|Only set the thumb step when width is given (T422074)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-04-01T21:42:15Z] <swfrench@deploy1003> Finished scap sync-world: Backport for [[gerrit:1266406|Only set the thumb step when width is given (T422074)]], [[gerrit:1266407|Only set the thumb step when width is given (T422074)]] (duration: 07m 15s)

Spot-checked the file referenced in this example TypeError while in mw-debug, and indeed we went from

Screenshot From 2026-04-01 14-39-28.png (1,226×452 px, 57 KB)
... to actually showing the expected page.

Errors have stopped as of 21:42 UTC.

Thanks for the quick fix @Ladsgroup!

Leaving this open for now in case there's anything you want to follow up on here, @Ladsgroup.

Edit: And indeed T422071: Internal error (fatal exception of type « TypeError ») when browsing any video looks to be the same issue, and can probably be merged with this.

Thanks @Scott_French for deploying the fix!