Page MenuHomePhabricator

InvalidArgumentException from line 46 of /srv/mediawiki/php-1.43.0-wmf.7/includes/libs/rdbms/expression/Expression.php: The array of values must be a list when running MediaModeration scanning script
Closed, ResolvedPublic1 Estimated Story PointsPRODUCTION ERROR

Description

The MediaModeration scanning script keeps crashing on production with an error with the error "array of values must be a list". This restriction was introduced in 9ae6fbda79effc2b6b4bfa02673959793d42c9f9 and was found today as the script was restarted which caused the code to start running on wmf.7 instead of wmf.6 (which did not have this patch).

Error
message
InvalidArgumentException from line 46 of /srv/mediawiki/php-1.43.0-wmf.7/includes/libs/rdbms/expression/Expression.php: The array of values must be a list
trace
InvalidArgumentException from line 46 of /srv/mediawiki/php-1.43.0-wmf.7/includes/libs/rdbms/expression/Expression.php: The array of values must be a list
#0 /srv/mediawiki/php-1.43.0-wmf.7/includes/libs/rdbms/database/DBConnRef.php(529): Wikimedia\Rdbms\Expression->__construct('mms_sha1', '!=', Array)
#1 /srv/mediawiki/php-1.43.0-wmf.7/extensions/MediaModeration/src/Services/MediaModerationDatabaseLookup.php(160): Wikimedia\Rdbms\DBConnRef->expr('mms_sha1', '!=', Array)
#2 /srv/mediawiki/php-1.43.0-wmf.7/extensions/MediaModeration/src/Services/MediaModerationDatabaseLookup.php(191): MediaWiki\Extension\MediaModeration\Services\MediaModerationDatabaseLookup->newSelectQueryBuilderForScan('19700101000000', 'ASC', Array, NULL)
#3 /srv/mediawiki/php-1.43.0-wmf.7/extensions/MediaModeration/maintenance/scanFilesInScanTable.php(239): MediaWiki\Extension\MediaModeration\Services\MediaModerationDatabaseLookup->getSha1ValuesForScan(200, '19700101000000', 'ASC', Array, NULL)
#4 /srv/mediawiki/php-1.43.0-wmf.7/extensions/MediaModeration/maintenance/scanFilesInScanTable.php(110): MediaWiki\Extension\MediaModeration\Maintenance\ScanFilesInScanTable->generateSha1ValuesForScan()
#5 /srv/mediawiki/php-1.43.0-wmf.7/maintenance/includes/MaintenanceRunner.php(696): MediaWiki\Extension\MediaModeration\Maintenance\ScanFilesInScanTable->execute()
#6 /srv/mediawiki/php-1.43.0-wmf.7/maintenance/run.php(51): MediaWiki\Maintenance\MaintenanceRunner->run()
#7 /srv/mediawiki/multiversion/MWScript.php(158): require_once('/srv/mediawiki/...')
#8 {main}
Impact

Cannot run scanning script on wmf.7.

Notes

Also the last checked timestamp is wrong. This needs to be investigated.

Event Timeline

Change #1038338 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/MediaModeration@master] Ensure excluded SHA-1s have numeric keys for scanFilesInScanTable.php

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

Change #1038310 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/MediaModeration@wmf/1.43.0-wmf.7] Ensure excluded SHA-1s have numeric keys for scanFilesInScanTable.php

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

Change #1038310 merged by jenkins-bot:

[mediawiki/extensions/MediaModeration@wmf/1.43.0-wmf.7] Ensure excluded SHA-1s have numeric keys for scanFilesInScanTable.php

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

Change #1038338 merged by jenkins-bot:

[mediawiki/extensions/MediaModeration@master] Ensure excluded SHA-1s have numeric keys for scanFilesInScanTable.php

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

Sorry about that, I guess I should have made this one a warning as well.

Mentioned in SAL (#wikimedia-operations) [2024-06-03T14:39:22Z] <dreamyjazz@deploy1002> Started scap: Backport for [[gerrit:1038310|Ensure excluded SHA-1s have numeric keys for scanFilesInScanTable.php (T366473)]]

Mentioned in SAL (#wikimedia-operations) [2024-06-03T14:41:43Z] <dreamyjazz@deploy1002> dreamyjazz: Backport for [[gerrit:1038310|Ensure excluded SHA-1s have numeric keys for scanFilesInScanTable.php (T366473)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-06-03T14:51:26Z] <dreamyjazz@deploy1002> Finished scap: Backport for [[gerrit:1038310|Ensure excluded SHA-1s have numeric keys for scanFilesInScanTable.php (T366473)]] (duration: 12m 04s)

Skipping QA as this is a small change which is already been tested as it's been deployed to production and being used in the script.