Page MenuHomePhabricator

ApiUsageException: The file you submitted was empty.
Open, Needs TriagePublic

Description

Seen on a 1.35 patch to MediaWiki-extensions-Score - https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Score/+/733912/

https://integration.wikimedia.org/ci/job/quibble-composer-mysql-php73-noselenium-docker/21343/console

There were 2 errors:

1) Wikibase\MediaInfo\Tests\Integration\MultiLingualCaptionsTest::testEditCaptions
ApiUsageException: The file you submitted was empty.

/workspace/src/includes/api/ApiUsageException.php:71
/workspace/src/includes/api/ApiBase.php:1438
/workspace/src/includes/api/ApiUpload.php:648
/workspace/src/includes/api/ApiUpload.php:616
/workspace/src/includes/api/ApiUpload.php:87
/workspace/src/includes/api/ApiMain.php:1593
/workspace/src/includes/api/ApiMain.php:498
/workspace/src/tests/phpunit/includes/api/ApiTestCase.php:109
/workspace/src/extensions/WikibaseMediaInfo/tests/phpunit/integration/WBMIApiTestCase.php:63
/workspace/src/extensions/WikibaseMediaInfo/tests/phpunit/integration/WBMIApiTestCase.php:115
/workspace/src/extensions/WikibaseMediaInfo/tests/phpunit/integration/MultiLingualCaptionsTest.php:28
/workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:446
/workspace/src/maintenance/doMaintenance.php:107
=== Logs generated by test case
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[localisation] [debug] LocalisationCache using store LCStoreNull []
[localisation] [debug] LocalisationCache using store LCStoreNull []
[MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[UserOptionsManager] [debug] Loading options from database {"user_id":1}
[GlobalTitleFail] [info] RequestContext::getTitle called with no title set. {"exception":{}}
[DeferredUpdates] [debug] DeferredUpdates::run: started MWCallableUpdate_EchoHooks::onUserSaveSettings #439874 []
[DeferredUpdates] [debug] DeferredUpdates::run: ended MWCallableUpdate_EchoHooks::onUserSaveSettings #439874 []
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[DeferredUpdates] [debug] DeferredUpdates::run: started CdnCacheUpdate #441899 []
[squid] [info] CdnCacheUpdate::purge: http://127.0.0.1:9412/index.php/User:UTSysop http://127.0.0.1:9412/index.php?title=User:UTSysop&action=history {"private":false}
[DeferredUpdates] [debug] DeferredUpdates::run: ended CdnCacheUpdate #441899 []
[CentralAuthVerbose] [info] Loading state for global user TestUser 1a4737.3ea from DB {"private":false}
[CentralAuthVerbose] [info] Loading attached wiki list for global user TestUser 1a4737.3ea from DB {"private":false}
[CentralAuthVerbose] [info] Loading groups for global user TestUser 1a4737.3ea {"private":false}
[objectcache] [debug] fetchOrRegenerate(global:centralauth-user:13248cbd76242c71cef1226a7c249c92): miss, new value computed []
[CentralAuthVerbose] [info] Loading CentralAuthUser for user TestUser 1a4737.3ea from cache object {"private":false}
[localisation] [debug] LocalisationCache using store LCStoreNull []
[localisation] [debug] LocalisationCache using store LCStoreNull []
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[CentralAuthVerbose] [info] Loading state for global user Apitesteditor from DB {"private":false}
[CentralAuthVerbose] [info] Loading attached wiki list for global user Apitesteditor from DB {"private":false}
[CentralAuthVerbose] [info] Loading groups for global user Apitesteditor {"private":false}
[objectcache] [debug] fetchOrRegenerate(global:centralauth-user:c7c3ce6008fd368830a3ed99b27f34a9): miss, new value computed []
[CentralAuthVerbose] [info] Loading CentralAuthUser for user Apitesteditor from cache object {"private":false}
[localisation] [debug] LocalisationCache using store LCStoreNull []
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[GlobalTitleFail] [info] RequestContext::getTitle called with no title set. {"exception":{}}
[authevents] [info] Login attempt {"event":"login","successful":false,"loginType":"N\/A","status":"NeedToken"}
[exec] [debug] MediaWiki\Shell\Command::execute: /bin/bash '/workspace/src/includes/shell/limit.sh' ''\''/usr/bin/convert'\'' '\''-size'\'' '\''425x793'\'' '\''xc:rgb(26, 97, 150)'\'' '\''-draw'\'' '\''fill rgb(17, 194, 171)  polygon 26,705 34,729 18,729 26,705'\'' '\''-draw'\'' '\''fill rgb(230, 144, 188)  polygon 479,401 524,588 434,588 479,401'\'' '\''-draw'\'' '\''fill rgb(103, 15, 69)  polygon -97,107 58,283 -252,283 -97,107'\'' '\''-draw'\'' '\''fill rgb(239, 15, 86)  polygon 411,259 427,548 395,548 411,259'\'' '\''-draw'\'' '\''fill rgb(158, 102, 211)  polygon 427,755 477,980 377,980 427,755'\'' '\''-draw'\'' '\''fill rgb(180, 7, 154)  polygon 467,428 482,581 452,581 467,428'\'' '\''/tmp/MW_PHPUnit_Wikibase_MediaInfo_Tests_Integration_MultiLingualCapzUbIoo/2c2_20211025124328_1.png'\''' 'MW_INCLUDE_STDERR=;MW_CPU_LIMIT=180; MW_CGROUP='\'''\''; MW_MEM_LIMIT=307200; MW_FILE_SIZE_LIMIT=102400; MW_WALL_CLOCK_LIMIT=180; MW_USE_LOG_PIPE=yes' []
[exec] [error] Error running {command}: {error} {"command":"\/bin\/bash '\/workspace\/src\/includes\/shell\/limit.sh' ''\\''\/usr\/bin\/convert'\\'' '\\''-size'\\'' '\\''425x793'\\'' '\\''xc:rgb(26, 97, 150)'\\'' '\\''-draw'\\'' '\\''fill rgb(17, 194, 171)  polygon 26,705 34,729 18,729 26,705'\\'' '\\''-draw'\\'' '\\''fill rgb(230, 144, 188)  polygon 479,401 524,588 434,588 479,401'\\'' '\\''-draw'\\'' '\\''fill rgb(103, 15, 69)  polygon -97,107 58,283 -252,283 -97,107'\\'' '\\''-draw'\\'' '\\''fill rgb(239, 15, 86)  polygon 411,259 427,548 395,548 411,259'\\'' '\\''-draw'\\'' '\\''fill rgb(158, 102, 211)  polygon 427,755 477,980 377,980 427,755'\\'' '\\''-draw'\\'' '\\''fill rgb(180, 7, 154)  polygon 467,428 482,581 452,581 467,428'\\'' '\\''\/tmp\/MW_PHPUnit_Wikibase_MediaInfo_Tests_Integration_MultiLingualCapzUbIoo\/2c2_20211025124328_1.png'\\''' 'MW_INCLUDE_STDERR=;MW_CPU_LIMIT=180; MW_CGROUP='\\'''\\''; MW_MEM_LIMIT=307200; MW_FILE_SIZE_LIMIT=102400; MW_WALL_CLOCK_LIMIT=180; MW_USE_LOG_PIPE=yes'","error":"\nlibgomp: Thread creation failed: Resource temporarily unavailable\n","exitcode":1,"exception":{}}
[wfDebug] [debug] WebRequestUpload::getName: 2c2_20211025124328_1.png normalized to '2c2_20211025124328_1.png' {"private":false}
[wfDebug] [debug] WebRequestUpload::getName: 2c2_20211025124328_1.png normalized to '2c2_20211025124328_1.png' {"private":false}
[wfDebug] [debug] User::getBlockedStatus: checking blocked status for TestUser 1a4737.3ea {"private":false}
[wfDebug] [debug] ApiUpload::verifyUpload about to verify {"private":false}
[wfDebug] [debug] wfRecursiveRemoveDir( /tmp/MW_PHPUnit_Wikibase_MediaInfo_Tests_Integration_MultiLingualCapzUbIoo ) {"private":false}
===

2) Wikibase\MediaInfo\Tests\Integration\WatchlistTest::testWatchlist
ApiUsageException: The file you submitted was empty.

/workspace/src/includes/api/ApiUsageException.php:71
/workspace/src/includes/api/ApiBase.php:1438
/workspace/src/includes/api/ApiUpload.php:648
/workspace/src/includes/api/ApiUpload.php:616
/workspace/src/includes/api/ApiUpload.php:87
/workspace/src/includes/api/ApiMain.php:1593
/workspace/src/includes/api/ApiMain.php:498
/workspace/src/tests/phpunit/includes/api/ApiTestCase.php:109
/workspace/src/extensions/WikibaseMediaInfo/tests/phpunit/integration/WBMIApiTestCase.php:63
/workspace/src/extensions/WikibaseMediaInfo/tests/phpunit/integration/WBMIApiTestCase.php:115
/workspace/src/extensions/WikibaseMediaInfo/tests/phpunit/integration/WatchlistTest.php:52
/workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:446
/workspace/src/maintenance/doMaintenance.php:107
=== Logs generated by test case
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[localisation] [debug] LocalisationCache using store LCStoreNull []
[localisation] [debug] LocalisationCache using store LCStoreNull []
[MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[UserOptionsManager] [debug] Loading options from database {"user_id":1}
[GlobalTitleFail] [info] RequestContext::getTitle called with no title set. {"exception":{}}
[DeferredUpdates] [debug] DeferredUpdates::run: started MWCallableUpdate_EchoHooks::onUserSaveSettings #441410 []
[DeferredUpdates] [debug] DeferredUpdates::run: ended MWCallableUpdate_EchoHooks::onUserSaveSettings #441410 []
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[DeferredUpdates] [debug] DeferredUpdates::run: started CdnCacheUpdate #436964 []
[squid] [info] CdnCacheUpdate::purge: http://127.0.0.1:9412/index.php/User:UTSysop http://127.0.0.1:9412/index.php?title=User:UTSysop&action=history {"private":false}
[DeferredUpdates] [debug] DeferredUpdates::run: ended CdnCacheUpdate #436964 []
[CentralAuthVerbose] [info] Loading state for global user TestUser 1a4737.3f4 from DB {"private":false}
[CentralAuthVerbose] [info] Loading attached wiki list for global user TestUser 1a4737.3f4 from DB {"private":false}
[CentralAuthVerbose] [info] Loading groups for global user TestUser 1a4737.3f4 {"private":false}
[objectcache] [debug] fetchOrRegenerate(global:centralauth-user:912d993bbfdb0aeadf78ad720cd108ef): miss, new value computed []
[CentralAuthVerbose] [info] Loading CentralAuthUser for user TestUser 1a4737.3f4 from cache object {"private":false}
[localisation] [debug] LocalisationCache using store LCStoreNull []
[localisation] [debug] LocalisationCache using store LCStoreNull []
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[localisation] [debug] LocalisationCache using store LCStoreNull []
[UserOptionsManager] [debug] Loading options from database {"user_id":27}
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[GlobalTitleFail] [info] RequestContext::getTitle called with no title set. {"exception":{}}
[authevents] [info] Login attempt {"event":"login","successful":false,"loginType":"N\/A","status":"NeedToken"}
[exec] [debug] MediaWiki\Shell\Command::execute: /bin/bash '/workspace/src/includes/shell/limit.sh' ''\''/usr/bin/convert'\'' '\''-size'\'' '\''526x652'\'' '\''xc:rgb(153, 154, 243)'\'' '\''-draw'\'' '\''fill rgb(241, 136, 72)  polygon 606,-152 724,-16 488,-16 606,-152'\'' '\''-draw'\'' '\''fill rgb(47, 138, 111)  polygon 475,106 478,144 472,144 475,106'\'' '\''-draw'\'' '\''fill rgb(214, 218, 87)  polygon 588,92 720,239 456,239 588,92'\'' '\''-draw'\'' '\''fill rgb(152, 6, 42)  polygon 118,240 128,307 108,307 118,240'\'' '\''-draw'\'' '\''fill rgb(216, 155, 105)  polygon 225,-108 287,86 163,86 225,-108'\'' '\''-draw'\'' '\''fill rgb(233, 187, 21)  polygon -68,610 -31,811 -105,811 -68,610'\'' '\''/tmp/MW_PHPUnit_Wikibase_MediaInfo_Tests_Integration_WatchlistTest_IjvRz3/b88_20211025124328_1.png'\''' 'MW_INCLUDE_STDERR=;MW_CPU_LIMIT=180; MW_CGROUP='\'''\''; MW_MEM_LIMIT=307200; MW_FILE_SIZE_LIMIT=102400; MW_WALL_CLOCK_LIMIT=180; MW_USE_LOG_PIPE=yes' []
[exec] [error] Error running {command}: {error} {"command":"\/bin\/bash '\/workspace\/src\/includes\/shell\/limit.sh' ''\\''\/usr\/bin\/convert'\\'' '\\''-size'\\'' '\\''526x652'\\'' '\\''xc:rgb(153, 154, 243)'\\'' '\\''-draw'\\'' '\\''fill rgb(241, 136, 72)  polygon 606,-152 724,-16 488,-16 606,-152'\\'' '\\''-draw'\\'' '\\''fill rgb(47, 138, 111)  polygon 475,106 478,144 472,144 475,106'\\'' '\\''-draw'\\'' '\\''fill rgb(214, 218, 87)  polygon 588,92 720,239 456,239 588,92'\\'' '\\''-draw'\\'' '\\''fill rgb(152, 6, 42)  polygon 118,240 128,307 108,307 118,240'\\'' '\\''-draw'\\'' '\\''fill rgb(216, 155, 105)  polygon 225,-108 287,86 163,86 225,-108'\\'' '\\''-draw'\\'' '\\''fill rgb(233, 187, 21)  polygon -68,610 -31,811 -105,811 -68,610'\\'' '\\''\/tmp\/MW_PHPUnit_Wikibase_MediaInfo_Tests_Integration_WatchlistTest_IjvRz3\/b88_20211025124328_1.png'\\''' 'MW_INCLUDE_STDERR=;MW_CPU_LIMIT=180; MW_CGROUP='\\'''\\''; MW_MEM_LIMIT=307200; MW_FILE_SIZE_LIMIT=102400; MW_WALL_CLOCK_LIMIT=180; MW_USE_LOG_PIPE=yes'","error":"\nlibgomp: Thread creation failed: Resource temporarily unavailable\n","exitcode":1,"exception":{}}
[wfDebug] [debug] WebRequestUpload::getName: b88_20211025124328_1.png normalized to 'b88_20211025124328_1.png' {"private":false}
[wfDebug] [debug] WebRequestUpload::getName: b88_20211025124328_1.png normalized to 'b88_20211025124328_1.png' {"private":false}
[wfDebug] [debug] User::getBlockedStatus: checking blocked status for TestUser 1a4737.3f4 {"private":false}
[wfDebug] [debug] ApiUpload::verifyUpload about to verify {"private":false}
[wfDebug] [debug] wfRecursiveRemoveDir( /tmp/MW_PHPUnit_Wikibase_MediaInfo_Tests_Integration_WatchlistTest_IjvRz3 ) {"private":false}

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I note this test seems to be flaky and doesn't always fail...

Maybe the real cause is:

libgomp: Thread creation failed: Resource temporarily unavailable

That happens when random files are generated to upload in the tests, possible by the use of RandomImageGenerator in WBMIApiTestCase

https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/WikibaseMediaInfo/+/21562fa87eab0ac371f520cd51e7cb04b068371e/tests/phpunit/integration/WBMIApiTestCase.php#56

Curious it's intermittant, and only seemingly failing on REL1_35... No changes in the file.. And only on PHP 7.3.

I've not checked if it's always the same ci container

Change 734370 had a related patch set uploaded (by Reedy; author: Reedy):

[integration/config@master] Temporarily remove Wikibase et al from Score dependancies

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

Change 734370 merged by jenkins-bot:

[integration/config@master] Temporarily remove Wikibase et al from Score dependancies

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

I've dropped the Wikibase (et al) dependancies from Score in REL1_35 for now... It'd be nice to get this fixed, so we don't need the hack in CI until REL1_35 goes EOL in just under 2 years from now...

Change 734377 had a related patch set uploaded (by Reedy; author: Reedy):

[integration/config@master] Also remove WikibaseCirrusSearch from score/REL1_35

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

Change 734377 merged by jenkins-bot:

[integration/config@master] Also remove WikibaseCirrusSearch from score/REL1_35

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