Page MenuHomePhabricator

InvalidArgumentException: Media handler BmpHandler returned NULL for metadata, should be array
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   InvalidArgumentException: Media handler BmpHandler returned NULL for metadata, should be array
exception.trace
from /srv/mediawiki/php-1.37.0-wmf.11/includes/media/MediaHandler.php(231)
#0 /srv/mediawiki/php-1.37.0-wmf.11/includes/utils/MWFileProps.php(88): MediaHandler->getSizeAndMetadataWithFallback(FSFile, string)
#1 /srv/mediawiki/php-1.37.0-wmf.11/includes/upload/UploadBase.php(552): MWFileProps->getPropsFromPath(string, string)
#2 /srv/mediawiki/php-1.37.0-wmf.11/includes/upload/UploadBase.php(485): UploadBase->verifyPartialFile()
#3 /srv/mediawiki/php-1.37.0-wmf.11/includes/upload/UploadBase.php(391): UploadBase->verifyFile()
#4 /srv/mediawiki/php-1.37.0-wmf.11/includes/upload/UploadFromFile.php(96): UploadBase->verifyUpload()
#5 /srv/mediawiki/php-1.37.0-wmf.11/includes/specials/SpecialUpload.php(550): UploadFromFile->verifyUpload()
#6 /srv/mediawiki/php-1.37.0-wmf.11/includes/specials/SpecialUpload.php(244): SpecialUpload->processUpload()
#7 /srv/mediawiki/php-1.37.0-wmf.11/includes/specialpage/SpecialPage.php(646): SpecialUpload->execute(NULL)
#8 /srv/mediawiki/php-1.37.0-wmf.11/includes/specialpage/SpecialPageFactory.php(1362): SpecialPage->run(NULL)
#9 /srv/mediawiki/php-1.37.0-wmf.11/includes/MediaWiki.php(314): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#10 /srv/mediawiki/php-1.37.0-wmf.11/includes/MediaWiki.php(917): MediaWiki->performRequest()
#11 /srv/mediawiki/php-1.37.0-wmf.11/includes/MediaWiki.php(551): MediaWiki->main()
#12 /srv/mediawiki/php-1.37.0-wmf.11/index.php(53): MediaWiki->run()
#13 /srv/mediawiki/php-1.37.0-wmf.11/index.php(46): wfIndexMain()
#14 /srv/mediawiki/w/index.php(3): require(string)
#15 {main}
Impact

Only one log entry seen in 30 minutes following group1 deployment.

Notes

Likely related to risky patch noted at T281152#7144507.

Event Timeline

Also seeing what are likely related:

Error
normalized_message
[{reqId}] {exception_url}   PHP Notice: Undefined index: metadata
exception.trace
from /srv/mediawiki/php-1.37.0-wmf.11/includes/media/MediaHandler.php(232)
#0 /srv/mediawiki/php-1.37.0-wmf.11/includes/media/MediaHandler.php(232): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.37.0-wmf.11/includes/utils/MWFileProps.php(88): MediaHandler->getSizeAndMetadataWithFallback(FSFile, string)
#2 /srv/mediawiki/php-1.37.0-wmf.11/includes/upload/UploadBase.php(552): MWFileProps->getPropsFromPath(string, string)
#3 /srv/mediawiki/php-1.37.0-wmf.11/includes/upload/UploadBase.php(485): UploadBase->verifyPartialFile()
#4 /srv/mediawiki/php-1.37.0-wmf.11/includes/upload/UploadBase.php(391): UploadBase->verifyFile()
#5 /srv/mediawiki/php-1.37.0-wmf.11/includes/upload/UploadFromFile.php(96): UploadBase->verifyUpload()
#6 /srv/mediawiki/php-1.37.0-wmf.11/includes/specials/SpecialUpload.php(550): UploadFromFile->verifyUpload()
#7 /srv/mediawiki/php-1.37.0-wmf.11/includes/specials/SpecialUpload.php(244): SpecialUpload->processUpload()
#8 /srv/mediawiki/php-1.37.0-wmf.11/includes/specialpage/SpecialPage.php(646): SpecialUpload->execute(NULL)
#9 /srv/mediawiki/php-1.37.0-wmf.11/includes/specialpage/SpecialPageFactory.php(1362): SpecialPage->run(NULL)
#10 /srv/mediawiki/php-1.37.0-wmf.11/includes/MediaWiki.php(314): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#11 /srv/mediawiki/php-1.37.0-wmf.11/includes/MediaWiki.php(917): MediaWiki->performRequest()
#12 /srv/mediawiki/php-1.37.0-wmf.11/includes/MediaWiki.php(551): MediaWiki->main()
#13 /srv/mediawiki/php-1.37.0-wmf.11/index.php(53): MediaWiki->run()
#14 /srv/mediawiki/php-1.37.0-wmf.11/index.php(46): wfIndexMain()
#15 /srv/mediawiki/w/index.php(3): require(string)
#16 {main}

And

Error
normalized_message
[{reqId}] {exception_url}   PHP Notice: Undefined index: metadata
exception.trace
from /srv/mediawiki/php-1.37.0-wmf.11/includes/media/MediaHandler.php(230)
#0 /srv/mediawiki/php-1.37.0-wmf.11/includes/media/MediaHandler.php(230): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.37.0-wmf.11/includes/utils/MWFileProps.php(88): MediaHandler->getSizeAndMetadataWithFallback(FSFile, string)
#2 /srv/mediawiki/php-1.37.0-wmf.11/includes/upload/UploadBase.php(552): MWFileProps->getPropsFromPath(string, string)
#3 /srv/mediawiki/php-1.37.0-wmf.11/includes/upload/UploadBase.php(485): UploadBase->verifyPartialFile()
#4 /srv/mediawiki/php-1.37.0-wmf.11/includes/upload/UploadBase.php(391): UploadBase->verifyFile()
#5 /srv/mediawiki/php-1.37.0-wmf.11/includes/upload/UploadFromFile.php(96): UploadBase->verifyUpload()
#6 /srv/mediawiki/php-1.37.0-wmf.11/includes/specials/SpecialUpload.php(550): UploadFromFile->verifyUpload()
#7 /srv/mediawiki/php-1.37.0-wmf.11/includes/specials/SpecialUpload.php(244): SpecialUpload->processUpload()
#8 /srv/mediawiki/php-1.37.0-wmf.11/includes/specialpage/SpecialPage.php(646): SpecialUpload->execute(NULL)
#9 /srv/mediawiki/php-1.37.0-wmf.11/includes/specialpage/SpecialPageFactory.php(1362): SpecialPage->run(NULL)
#10 /srv/mediawiki/php-1.37.0-wmf.11/includes/MediaWiki.php(314): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#11 /srv/mediawiki/php-1.37.0-wmf.11/includes/MediaWiki.php(917): MediaWiki->performRequest()
#12 /srv/mediawiki/php-1.37.0-wmf.11/includes/MediaWiki.php(551): MediaWiki->main()
#13 /srv/mediawiki/php-1.37.0-wmf.11/index.php(53): MediaWiki->run()
#14 /srv/mediawiki/php-1.37.0-wmf.11/index.php(46): wfIndexMain()
#15 /srv/mediawiki/w/index.php(3): require(string)
#16 {main}

/cc @Ladsgroup @tstarling. Haven't looked closely at all, but seems likely continuation of edge cases from T275268 / change 693298.

I take a look but since I just got my 5G chip, I might not be able to focus properly.

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

[mediawiki/core@master] media: Return empty metadata in array in edge cases

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

There are three errors, some different but it's just one error bubbling up, they are in the same request.

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

[mediawiki/core@wmf/1.37.0-wmf.11] media: Handle lack of 'metadata' key from getSizeAndMetadata gracefully

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

Change 701457 merged by jenkins-bot:

[mediawiki/core@master] media: Handle lack of 'metadata' key from getSizeAndMetadata gracefully

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

Change 701718 merged by jenkins-bot:

[mediawiki/core@wmf/1.37.0-wmf.11] media: Handle lack of 'metadata' key from getSizeAndMetadata gracefully

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

Mentioned in SAL (#wikimedia-operations) [2021-06-28T12:29:57Z] <ladsgroup@deploy1002> Synchronized php-1.37.0-wmf.11/includes/media/MediaHandler.php: Backport: [[gerrit:701718|media: Handle lack of 'metadata' key from getSizeAndMetadata gracefully (T285490)]] (duration: 00m 56s)