Page MenuHomePhabricator

mwext-php72-phan-docker job fails on WikimediaMessages: A dependency error was encountered while installing the extension "MinervaNeue": Could not find the registration file for the extension "MobileFrontend"
Closed, ResolvedPublic

Description

I saw this in https://integration.wikimedia.org/ci/job/mwext-php72-phan-docker/11177/console
For patch https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/WikimediaMessages/+/535295/

23:56:02 A dependency error was encountered while installing the extension "MinervaNeue": Could not find the registration file for the extension "MobileFrontend"
23:56:02 [12387160f4db169a2121e2f1] [no req]   Wikimedia\Services\ServiceDisabledException from line 423 of /workspace/src/includes/libs/services/ServiceContainer.php: Service disabled: DBLoadBalancerFactory
23:56:02 Backtrace:
23:56:02 #0 /workspace/src/includes/MediaWikiServices.php(577): Wikimedia\Services\ServiceContainer->getService(string)
23:56:02 #1 /workspace/src/maintenance/doMaintenance.php(123): MediaWiki\MediaWikiServices->getDBLoadBalancerFactory()
23:56:02 #2 /workspace/src/maintenance/install.php(193): require_once(string)
23:56:02 #3 {main}

Event Timeline

Krinkle triaged this task as Unbreak Now! priority.Sep 10 2019, 12:50 AM
Krinkle added subscribers: hashar, Anomie.

Seems to be caused by T225512: install.php --with-extensions silently ignores extensions whose dependencies are not satisfied

Change 534641 merged by jenkins-bot:
[mediawiki/core@master] Revert and fix "Revert "Modify -—with-extensions to throw extension dependency errors""

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

And I wrote a quick announce to wikitech-l about having to define the requirements in CI config in addition of extension.json: https://lists.wikimedia.org/pipermail/wikitech-l/2019-September/092522.html

I don't think this had the desired effect - From a patch to WikimediaMessages

https://integration.wikimedia.org/ci/job/mwext-php72-phan-docker/11177/console

22:56:02 A dependency error was encountered while installing the extension "MinervaNeue": Could not find the registration file for the extension "MobileFrontend"
22:56:02 [12387160f4db169a2121e2f1] [no req]   Wikimedia\Services\ServiceDisabledException from line 423 of /workspace/src/includes/libs/services/ServiceContainer.php: Service disabled: DBLoadBalancerFactory
22:56:02 Backtrace:
22:56:02 #0 /workspace/src/includes/MediaWikiServices.php(577): Wikimedia\Services\ServiceContainer->getService(string)
22:56:02 #1 /workspace/src/maintenance/doMaintenance.php(123): MediaWiki\MediaWikiServices->getDBLoadBalancerFactory()
22:56:02 #2 /workspace/src/maintenance/install.php(193): require_once(string)
22:56:02 #3 {main}
22:56:02 Traceback (most recent call last):
22:56:02   File "/usr/local/bin/quibble", line 11, in <module>
22:56:02     load_entry_point('quibble==0.0.0', 'console_scripts', 'quibble')()
22:56:02   File "/usr/local/lib/python3.5/dist-packages/quibble/cmd.py", line 465, in main
22:56:02     cmd.execute(plan)
22:56:02   File "/usr/local/lib/python3.5/dist-packages/quibble/cmd.py", line 440, in execute
22:56:02     command.execute()
22:56:02   File "/usr/local/lib/python3.5/dist-packages/quibble/commands.py", line 428, in execute
22:56:02     mwdir=self.mw_install_path
22:56:02   File "/usr/local/lib/python3.5/dist-packages/quibble/mediawiki/maintenance.py", line 63, in install
22:56:02     'Install failed with exit code: %s' % p.returncode)
hashar renamed this task from A dependency error in CI tests to mwext-php72-phan-docker job fails on WikimediaMessages: A dependency error was encountered while installing the extension "MinervaNeue": Could not find the registration file for the extension &#34;MobileFrontend&#34;.Sep 10 2019, 7:51 AM
hashar added a subscriber: Jdforrester-WMF.

@Reedy mentioned the issue on https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/534641/

22:56:02 A dependency error was encountered while installing the extension "MinervaNeue": Could not find the registration file for the extension &#34;MobileFrontend&#34;

@hashar wrote:

That is on the phan job which has different set of dependencies :-\ For WikimediaMessage CI injects:

phan_dependencies = {
    'WikimediaMessages': ['GuidedTour', 'ORES', 'skins/MinervaNeue']
}

WikimediaMessages does not refer to MobileFrontend at all so Phan works just fine. But MinervaNeue does require MobileFrontend and thus fail the installer.

I don't think we have to run MediaWiki install for the Phan jobs, that should probably be skipped (quibble --skip-install).

@Jdforrester-WMF wrote:

Alternatively we could just make phan install regular + phan dependencies, instead of just the phan ones?

Change 535507 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/config@master] phan: stop installing MediaWiki

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

hashar claimed this task.

Fixed by no more installing MediaWiki (which is not needed) and thus the dependency check is entirely bypassed. If the extension code refers to code that is not shipped, Phan will complain and the dependency would have to be added to integration/config.git zuul/parameter_functions.py phan_dependencies.

Verified on WikimediaMessages changes:

@Jdforrester-WMF

Alternatively we could just make phan install regular + phan dependencies, instead of just the phan ones?

The Phan dependencies are a different set, that is because Phan is exhaustive in its check eg it would complain when you refer to a class to another extension, although that extension is not needed to pass tests or there is no integration test to cover that usage. Eg you might refer to code in BetaFeatures for example which Phan will complain about, while none the tests actually verify the BetaFeatures integration. There is thus no need to add BetaFeatures as a dependency for tests, which also save us from running a few more tests. Eventually that dependency mess will need to be solved differently / cleaned out, but that will be for later.

I have reviewed test failures for MediaWiki extensions and skins since the change got merged. The two WikimediaMessages changes were the only ones affected by this issue.

Change 535507 merged by jenkins-bot:
[integration/config@master] phan: stop installing MediaWiki

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

@Jdforrester-WMF

Alternatively we could just make phan install regular + phan dependencies, instead of just the phan ones?

The Phan dependencies are a different set, that is because Phan is exhaustive in its check eg it would complain when you refer to a class to another extension, although that extension is not needed to pass tests or there is no integration test to cover that usage. Eg you might refer to code in BetaFeatures for example which Phan will complain about, while none the tests actually verify the BetaFeatures integration. There is thus no need to add BetaFeatures as a dependency for tests, which also save us from running a few more tests. Eventually that dependency mess will need to be solved differently / cleaned out, but that will be for later.

Yes, I know that Phan needs us to provide extra dependencies that aren't tested in integration tests, and (theoretically) it doesn't need integration dependencies, but my suggestion was merging the lists (so that the Phan dependency list is a list of "extras").

Still happening for the mediawiki-phpbench-patch-docker job. E.g. https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/886356 / https://integration.wikimedia.org/ci/job/mediawiki-phpbench-patch-docker/3062/console

10:54:33 INFO:quibble.commands:>>> Start: Install MediaWiki, db=<MySQL /workspace/db/quibble-mysql-n6_hi1_n/socket> vendor=True
10:54:33 php maintenance/install.php --scriptpath= --server=http://127.0.0.1:9413 --dbtype=mysql --dbname=wikidb --dbuser=wikiuser --dbpass=secret --dbserver=localhost:/workspace/db/quibble-mysql-n6_hi1_n/socket --with-extensions --pass=testwikijenkinspass TestWiki WikiAdmin
10:54:33 A dependency error was encountered while installing the extension "GrowthExperiments": Could not find the registration file for the extension "VisualEditor"
10:54:33 
10:54:33 <<< Finish: Install MediaWiki, db=<MySQL /workspace/db/quibble-mysql-n6_hi1_n/socket> vendor=True, in 0.249 s
10:54:33 
10:54:33 INFO:quibble.commands:<<< Finish: Run Post-dependency install, pre-database dependent steps in parallel (concurrency=2):
10:54:33 * Install MediaWiki, db=<MySQL /workspace/db/quibble-mysql-n6_hi1_n/socket> vendor=True
10:54:33 * npm install in /workspace/src, in 0.323 s
10:54:33 INFO:backend.MySQL:Terminating MySQL
10:54:35 Traceback (most recent call last):
10:54:35   File "/usr/local/bin/quibble", line 10, in <module>
10:54:35     sys.exit(main())
10:54:35   File "/usr/local/lib/python3.7/dist-packages/quibble/cmd.py", line 803, in main
10:54:35     cmd.execute(plan, dry_run=args.dry_run)
10:54:35   File "/usr/local/lib/python3.7/dist-packages/quibble/cmd.py", line 514, in execute
10:54:35     quibble.commands.execute_command(command)
10:54:35   File "/usr/local/lib/python3.7/dist-packages/quibble/commands.py", line 26, in execute_command
10:54:35     command.execute()
10:54:35   File "/usr/local/lib/python3.7/dist-packages/quibble/commands.py", line 1036, in execute
10:54:35     raise error
10:54:35 Exception: Install failed with exit code: 1
10:54:36 Build step 'Execute shell' marked build as failure

Reopening, per above.