Page MenuHomePhabricator

PHP Warning: Trying to access array offset on null
Closed, DuplicatePublicPRODUCTION ERROR

Description

Error
  • mwversion: 1.45.0-wmf.25
  • timestamp: 2025-11-04T22:03:51.875Z
  • phpversion: 8.3.26
  • reqId: 1248ea3a-4fec-4322-b68d-253a1958c330
  • Find reqId in Logstash
normalized_message
[{reqId}] {exception_url}   PHP Warning: Trying to access array offset on null
FrameLocationCall
from/srv/mediawiki/php-1.45.0-wmf.25/vendor/james-heinrich/getid3/getid3/module.audio-video.mpeg.php(508)
#0/srv/mediawiki/php-1.45.0-wmf.25/vendor/james-heinrich/getid3/getid3/module.audio-video.mpeg.php(508)MediaWiki\Exception\MWExceptionHandler::handleError(int, string, string, int)
#1/srv/mediawiki/php-1.45.0-wmf.25/vendor/james-heinrich/getid3/getid3/getid3.php(781)getid3_mpeg->Analyze()
#2/srv/mediawiki/php-1.45.0-wmf.25/extensions/TimedMediaHandler/includes/Handlers/ID3Handler/ID3Handler.php(39)getID3->analyze(string)
#3/srv/mediawiki/php-1.45.0-wmf.25/extensions/TimedMediaHandler/includes/Handlers/ID3Handler/ID3Handler.php(58)MediaWiki\TimedMediaHandler\Handlers\ID3Handler\ID3Handler->getID3(string)
#4/srv/mediawiki/php-1.45.0-wmf.25/includes/media/MediaHandler.php(231)MediaWiki\TimedMediaHandler\Handlers\ID3Handler\ID3Handler->getMetadata(Wikimedia\FileBackend\FSFile\FSFile, string)
#5/srv/mediawiki/php-1.45.0-wmf.25/includes/utils/MWFileProps.php(77)MediaHandler->getSizeAndMetadataWithFallback(Wikimedia\FileBackend\FSFile\FSFile, string)
#6/srv/mediawiki/php-1.45.0-wmf.25/includes/upload/UploadBase.php(514)MWFileProps->getPropsFromPath(string, string)
#7/srv/mediawiki/php-1.45.0-wmf.25/includes/upload/UploadBase.php(534)UploadBase->getFileProps()
#8/srv/mediawiki/php-1.45.0-wmf.25/includes/upload/UploadFromChunks.php(457)UploadBase->verifyPartialFile()
#9/srv/mediawiki/php-1.45.0-wmf.25/includes/upload/UploadFromChunks.php(323)UploadFromChunks->verifyChunk()
#10/srv/mediawiki/php-1.45.0-wmf.25/includes/api/ApiUpload.php(377)UploadFromChunks->addChunk(string, int, int)
#11/srv/mediawiki/php-1.45.0-wmf.25/includes/api/ApiUpload.php(246)MediaWiki\Api\ApiUpload->getChunkResult(array)
#12/srv/mediawiki/php-1.45.0-wmf.25/includes/api/ApiUpload.php(162)MediaWiki\Api\ApiUpload->getContextResult()
#13/srv/mediawiki/php-1.45.0-wmf.25/includes/api/ApiMain.php(2038)MediaWiki\Api\ApiUpload->execute()
#14/srv/mediawiki/php-1.45.0-wmf.25/includes/api/ApiMain.php(946)MediaWiki\Api\ApiMain->executeAction()
#15/srv/mediawiki/php-1.45.0-wmf.25/includes/api/ApiMain.php(917)MediaWiki\Api\ApiMain->executeActionWithErrorHandling()
#16/srv/mediawiki/php-1.45.0-wmf.25/includes/api/ApiEntryPoint.php(138)MediaWiki\Api\ApiMain->execute()
#17/srv/mediawiki/php-1.45.0-wmf.25/includes/MediaWikiEntryPoint.php(184)MediaWiki\Api\ApiEntryPoint->execute()
#18/srv/mediawiki/php-1.45.0-wmf.25/api.php(30)MediaWiki\MediaWikiEntryPoint->run()
#19/srv/mediawiki/w/api.php(3)require(string)
#20{main}
Impact

TBD

Notes

These have picked up over the last day or so and are present only on the 8.3 deployment of mw-api-ext. They generally happen in clusters, corresponding to one or more POSTs followed by one or more GETs, presumably as phases of an file upload - see here for the cluster from which the above came.

Now, it is very possible that this is actually an artifact of workload (i.e., clients and the files they're uploading), rather than an issues specific to PHP 8.3. We're in an unusual state where the population of clients routed to 8.3 do very different things than those still on 8.1, largely owing to how enrollment works (i.e., cookies and javascript, so these tend to be real users rather than bots).

In any case, it would be great to get a second opinion on this.

Here's a stack trace from this event, which is one of the subsequent GETs in the same "cluster" hitting the same issue reported in the earlier POST:

FrameLocationCall
from/srv/mediawiki/php-1.45.0-wmf.25/vendor/james-heinrich/getid3/getid3/module.audio-video.mpeg.php(508)
#0/srv/mediawiki/php-1.45.0-wmf.25/vendor/james-heinrich/getid3/getid3/module.audio-video.mpeg.php(508)MediaWiki\Exception\MWExceptionHandler::handleError(int, string, string, int)
#1/srv/mediawiki/php-1.45.0-wmf.25/vendor/james-heinrich/getid3/getid3/getid3.php(781)getid3_mpeg->Analyze()
#2/srv/mediawiki/php-1.45.0-wmf.25/extensions/TimedMediaHandler/includes/Handlers/ID3Handler/ID3Handler.php(39)getID3->analyze(string)
#3/srv/mediawiki/php-1.45.0-wmf.25/extensions/TimedMediaHandler/includes/Handlers/ID3Handler/ID3Handler.php(58)MediaWiki\TimedMediaHandler\Handlers\ID3Handler\ID3Handler->getID3(string)
#4/srv/mediawiki/php-1.45.0-wmf.25/includes/media/MediaHandler.php(231)MediaWiki\TimedMediaHandler\Handlers\ID3Handler\ID3Handler->getMetadata(UploadStashFile, string)
#5/srv/mediawiki/php-1.45.0-wmf.25/includes/filerepo/file/UnregisteredLocalFile.php(191)MediaHandler->getSizeAndMetadataWithFallback(UploadStashFile, string)
#6/srv/mediawiki/php-1.45.0-wmf.25/includes/filerepo/file/UnregisteredLocalFile.php(117)MediaWiki\FileRepo\File\UnregisteredLocalFile->getSizeAndMetadata()
#7/srv/mediawiki/php-1.45.0-wmf.25/includes/filerepo/file/UnregisteredLocalFile.php(133)MediaWiki\FileRepo\File\UnregisteredLocalFile->cachePageDimensions(int)
#8/srv/mediawiki/php-1.45.0-wmf.25/extensions/TimedMediaHandler/includes/TimedMediaHandler.php(321)MediaWiki\FileRepo\File\UnregisteredLocalFile->getWidth()
#9/srv/mediawiki/php-1.45.0-wmf.25/extensions/TimedMediaHandler/includes/TimedMediaHandler.php(156)MediaWiki\TimedMediaHandler\TimedMediaHandler->isAudio(UploadStashFile)
#10/srv/mediawiki/php-1.45.0-wmf.25/includes/api/ApiQueryImageInfo.php(395)MediaWiki\TimedMediaHandler\TimedMediaHandler->normaliseParams(UploadStashFile, array)
#11/srv/mediawiki/php-1.45.0-wmf.25/includes/api/ApiQueryImageInfo.php(331)MediaWiki\Api\ApiQueryImageInfo->checkParameterNormalise(UploadStashFile, array)
#12/srv/mediawiki/php-1.45.0-wmf.25/includes/api/ApiQueryStashImageInfo.php(71)MediaWiki\Api\ApiQueryImageInfo->mergeThumbParams(UploadStashFile, array, string)
#13/srv/mediawiki/php-1.45.0-wmf.25/includes/api/ApiQuery.php(729)MediaWiki\Api\ApiQueryStashImageInfo->execute()
#14/srv/mediawiki/php-1.45.0-wmf.25/includes/api/ApiMain.php(2038)MediaWiki\Api\ApiQuery->execute()
#15/srv/mediawiki/php-1.45.0-wmf.25/includes/api/ApiMain.php(946)MediaWiki\Api\ApiMain->executeAction()
#16/srv/mediawiki/php-1.45.0-wmf.25/includes/api/ApiMain.php(917)MediaWiki\Api\ApiMain->executeActionWithErrorHandling()
#17/srv/mediawiki/php-1.45.0-wmf.25/includes/api/ApiEntryPoint.php(138)MediaWiki\Api\ApiMain->execute()
#18/srv/mediawiki/php-1.45.0-wmf.25/includes/MediaWikiEntryPoint.php(184)MediaWiki\Api\ApiEntryPoint->execute()
#19/srv/mediawiki/php-1.45.0-wmf.25/api.php(30)MediaWiki\MediaWikiEntryPoint->run()
#20/srv/mediawiki/w/api.php(3)require(string)
#21{main}