Page MenuHomePhabricator

Wikibase\...: TypeError: Argument 1 passed to GrowthExperiments\...\LinkRecommendationStore::__construct() must implement interface ...\IDatabase, null given
Closed, ResolvedPublic

Description

https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/690007
https://integration.wikimedia.org/ci/job/wmf-quibble-vendor-mysql-php72-docker/63694/console

20:37:53 1) Wikibase\Repo\Tests\GlobalStateFactoryMethodsResourceTest::testHookHandler with data set #4 ('EntityDataPurger')
20:37:53 TypeError: Argument 1 passed to GrowthExperiments\NewcomerTasks\AddLink\LinkRecommendationStore::__construct() must implement interface Wikimedia\Rdbms\IDatabase, null given, called in /workspace/src/extensions/GrowthExperiments/ServiceWiring.php on line 200
20:37:53 
20:37:53 /workspace/src/extensions/GrowthExperiments/includes/NewcomerTasks/AddLink/LinkRecommendationStore.php:39
20:37:53 /workspace/src/extensions/GrowthExperiments/ServiceWiring.php:200
20:37:53 /workspace/src/vendor/wikimedia/services/src/ServiceContainer.php:447
20:37:53 /workspace/src/vendor/wikimedia/services/src/ServiceContainer.php:416
20:37:53 /workspace/src/includes/MediaWikiServices.php:268
20:37:53 /workspace/src/vendor/wikimedia/services/src/ServiceContainer.php:424
20:37:53 /workspace/src/vendor/wikimedia/object-factory/src/ObjectFactory/ObjectFactory.php:209
20:37:53 /workspace/src/vendor/wikimedia/object-factory/src/ObjectFactory/ObjectFactory.php:150
20:37:53 /workspace/src/includes/HookContainer/HookContainer.php:465
20:37:53 /workspace/src/includes/HookContainer/HookContainer.php:156
20:37:53 /workspace/src/includes/HookContainer/HookRunner.php:3677
20:37:53 /workspace/src/includes/specialpage/SpecialPageFactory.php:1099
20:37:53 /workspace/src/includes/specialpage/SpecialPageFactory.php:1114
20:37:53 /workspace/src/includes/specialpage/SpecialPageFactory.php:1486
20:37:53 /workspace/src/includes/specialpage/SpecialPage.php:124
20:37:53 /workspace/src/includes/specialpage/SpecialPage.php:109
20:37:53 /workspace/src/extensions/Wikibase/repo/WikibaseRepo.ServiceWiring.php:677
20:37:53 /workspace/src/vendor/wikimedia/services/src/ServiceContainer.php:447
20:37:53 /workspace/src/vendor/wikimedia/services/src/ServiceContainer.php:416
20:37:53 /workspace/src/includes/MediaWikiServices.php:268
20:37:53 /workspace/src/vendor/wikimedia/services/src/ServiceContainer.php:424
20:37:53 /workspace/src/vendor/wikimedia/object-factory/src/ObjectFactory/ObjectFactory.php:209
20:37:53 /workspace/src/vendor/wikimedia/object-factory/src/ObjectFactory/ObjectFactory.php:150
20:37:53 /workspace/src/extensions/Wikibase/repo/tests/phpunit/includes/GlobalStateFactoryMethodsResourceTest.php:56
20:37:53 /workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:449
20:37:53 === Logs generated by test case
20:37:53 [objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
20:37:53 [localisation] [debug] LocalisationCache using store LCStoreNull []
20:37:53 [localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
20:37:53 [objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
20:37:53 [objectcache] [debug] MainObjectStash using store {class} {"class":"HashBagOStuff"}
20:37:53 ===

Event Timeline

The test triggers the SpecialPage_initList hook in HomepageHooks, which has LinkRecommendationStore as a dependency, which fetches a DB handle from the load balancer as its dependency, and presumably the Wikibase test mocks something related to that?

The test triggers the SpecialPage_initList hook in HomepageHooks, which has LinkRecommendationStore as a dependency, which fetches a DB handle from the load balancer as its dependency, and presumably the Wikibase test mocks something related to that?

Yes, looks that way:

	protected function setUp(): void {
		parent::setUp();

		// Factory methods should never access the database or do http requests
		// https://phabricator.wikimedia.org/T243729
		$this->disallowDBAccess();
		$this->disallowHttpAccess();
	}

from repo/tests/phpunit/includes/GlobalStateFactoryMethodsResourceTest.php.

Change 690032 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/Wikibase@master] repo: Mock getLazyConnectionRef

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

Change 690032 merged by Gergő Tisza:

[mediawiki/extensions/Wikibase@master] repo: Mock getLazyConnectionRef

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

Change 689899 had a related patch set uploaded (by Jforrester; author: Kosta Harlan):

[mediawiki/extensions/Wikibase@wmf/1.37.0-wmf.4] repo: Mock getLazyConnectionRef

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

Change 689900 had a related patch set uploaded (by Jforrester; author: Kosta Harlan):

[mediawiki/extensions/Wikibase@wmf/1.37.0-wmf.5] repo: Mock getLazyConnectionRef

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

kostajh triaged this task as Unbreak Now! priority.May 12 2021, 9:23 PM
kostajh moved this task from Incoming to Code Review on the Growth-Team (Current Sprint) board.

Change 689899 abandoned by Gergő Tisza:

[mediawiki/extensions/Wikibase@wmf/1.37.0-wmf.4] repo: Mock getLazyConnectionRef

Reason:

needs to be squashed

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

Change 690045 had a related patch set uploaded (by Gergő Tisza; author: Kosta Harlan):

[mediawiki/extensions/Wikibase@master] Backport CI fixes

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

Change 689900 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@wmf/1.37.0-wmf.5] repo: Mock getLazyConnectionRef

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

Change 690045 merged by Gergő Tisza:

[mediawiki/extensions/Wikibase@master] Backport CI fixes

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

Change 690066 had a related patch set uploaded (by Gergő Tisza; author: Kosta Harlan):

[mediawiki/extensions/Wikibase@wmf/1.37.0-wmf.4] Backport CI fixes

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

Change 690066 merged by Gergő Tisza:

[mediawiki/extensions/Wikibase@wmf/1.37.0-wmf.4] Backport CI fixes

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

Tgr assigned this task to kostajh.