Page MenuHomePhabricator

PHP Warning: A non-numeric value encountered (from TMH ID3Handler)
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   PHP Warning: A non-numeric value encountered
exception.trace
from /srv/mediawiki/php-1.37.0-wmf.1/vendor/james-heinrich/getid3/getid3/getid3.php(1720)
#0 /srv/mediawiki/php-1.37.0-wmf.1/vendor/james-heinrich/getid3/getid3/getid3.php(1720): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.37.0-wmf.1/vendor/james-heinrich/getid3/getid3/getid3.php(649): getID3->ChannelsBitratePlaytimeCalculations()
#2 /srv/mediawiki/php-1.37.0-wmf.1/extensions/TimedMediaHandler/includes/handlers/ID3Handler/ID3Handler.php(32): getID3->analyze(string)
#3 /srv/mediawiki/php-1.37.0-wmf.1/extensions/TimedMediaHandler/includes/handlers/WAVHandler/WAVHandler.php(24): ID3Handler->getID3(string)
#4 /srv/mediawiki/php-1.37.0-wmf.1/includes/upload/UploadBase.php(515): WAVHandler->verifyUpload(string)
#5 /srv/mediawiki/php-1.37.0-wmf.1/includes/upload/UploadBase.php(391): UploadBase->verifyFile()
#6 /srv/mediawiki/php-1.37.0-wmf.1/includes/upload/UploadFromFile.php(96): UploadBase->verifyUpload()
#7 /srv/mediawiki/php-1.37.0-wmf.1/includes/api/ApiUpload.php(610): UploadFromFile->verifyUpload()
#8 /srv/mediawiki/php-1.37.0-wmf.1/includes/api/ApiUpload.php(87): ApiUpload->verifyUpload()
#9 /srv/mediawiki/php-1.37.0-wmf.1/includes/api/ApiMain.php(1652): ApiUpload->execute()
#10 /srv/mediawiki/php-1.37.0-wmf.1/includes/api/ApiMain.php(622): ApiMain->executeAction()
#11 /srv/mediawiki/php-1.37.0-wmf.1/includes/api/ApiMain.php(593): ApiMain->executeActionWithErrorHandling()
#12 /srv/mediawiki/php-1.37.0-wmf.1/api.php(90): ApiMain->execute()
#13 /srv/mediawiki/php-1.37.0-wmf.1/api.php(45): wfApiMain()
#14 /srv/mediawiki/w/api.php(3): require(string)
#15 {main}
Impact

There's a about 30 of these in the last four hours. Seems like a programming error to me.

Notes

Details

Request URL
https://commons.wikimedia.org/w/api.php

Event Timeline

Krinkle renamed this task from PHP Warning: A non-numeric value encountered to PHP Warning: A non-numeric value encountered (from TMH ID3Handler).May 6 2021, 11:02 PM
Krinkle moved this task from Untriaged to Older on the Wikimedia-production-error board.

Line numbers in getid3.php don't match the version provided by composer; this seems kinda weird.

Anyway seems like a bug in the library but likely harmless in that it'd at worst produce a warning and bad data for a corrupt file. I'll see if I can find files that repro it though, shouldn't be hard if they made it to upload.

Line numbers in getid3.php don't match the version provided by composer; this seems kinda weird.

rMWVD3e7600daeecd: Upgrading james-heinrich/getid3 (v1.9.20 => v1.9.21) happened in October 2021 (so ~5.5 months after this report); it might already been fixed (by upstream) if it's not been seen for a while. Or someone hasn't been uploading files that trigger the error :)

rMWVD3e7600daeecd: Upgrading james-heinrich/getid3 (v1.9.20 => v1.9.21) happened in October 2021 (so ~5.5 months after this report); it might already been fixed (by upstream) if it's not been seen for a while. Or someone hasn't been uploading files that trigger the error :)

Oh no, do we have duplicate dependency definitions between core and TMH? That probably explains why I'm not seeing matching versions when I modify the composer.json in the extension by reverting the whole ext to an earlier version!

rMWVD3e7600daeecd: Upgrading james-heinrich/getid3 (v1.9.20 => v1.9.21) happened in October 2021 (so ~5.5 months after this report); it might already been fixed (by upstream) if it's not been seen for a while. Or someone hasn't been uploading files that trigger the error :)

Oh no, do we have duplicate dependency definitions between core and TMH? That probably explains why I'm not seeing matching versions when I modify the composer.json in the extension by reverting the whole ext to an earlier version!

Yes, nothing in production reads your composer file (for security reasons), we manually build the vendor check-out in this repo so if you want something to change in production you have to submit a patch there.

Core doesn't depend on getid3, we just have it in vendor because of WMF deployment.

TMH has

	"require": {
		"james-heinrich/getid3": "^v1.9.19"
	},

And 1.9.21 would be satisfied by ^v1.9.19. It's been ^ for a while

Agh, it's the ^ that got me then. ;) sighhhh i hate non-specific versioning. always use specific versions.

Ok, I can confirm this bug happened with getid3 v1.9.19 but *not* with v.19.20 or v.19.21. :D So I'll consider that solved since our install comes up with the current one.