Page MenuHomePhabricator

"RuntimeException: Can't find provided data" when trying to use the web upgrader
Closed, ResolvedPublic

Description

I was testing https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1119893 and I tried to go through the upgrade flow to witness the success message at the end. I got this error at the "Upgrade existing installation" step:

image.png (1×1 px, 87 KB)

[5cccaa70f40e387841bd3812] /w/mw-config/index.php?page=Upgrade RuntimeException: Can't find provided data "VirtualDomains"

Backtrace:

from /var/www/html/w/includes/installer/DatabaseInstaller.php(272)
#0 /var/www/html/w/includes/installer/Task/Task.php(314): MediaWiki\Installer\DatabaseInstaller->getProvision()
#1 /var/www/html/w/includes/installer/Task/RestoredServicesProvider.php(38): MediaWiki\Installer\Task\Task->getVirtualDomains()
#2 /var/www/html/w/includes/installer/Installer.php(1496): MediaWiki\Installer\Task\RestoredServicesProvider->execute()
#3 /var/www/html/w/includes/installer/WebInstaller.php(1249): MediaWiki\Installer\Installer->restoreServices()
#4 /var/www/html/w/includes/installer/WebInstallerUpgrade.php(59): MediaWiki\Installer\WebInstaller->doUpgrade()
#5 /var/www/html/w/includes/installer/WebInstaller.php(254): MediaWiki\Installer\WebInstallerUpgrade->execute()
#6 /var/www/html/w/mw-config/index.php(93): MediaWiki\Installer\WebInstaller->execute()
#7 /var/www/html/w/mw-config/index.php(43): wfInstallerMain()
#8 {main}

Details

Event Timeline

I experienced this locally as well during development of that same patch. I worked around it at the time by editing getVirtualDomains and returning an empty array, so as to keep the patch focussed on one thing.

With git-blame, I traced it to https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1083932 (rMWed068bb69c2d: installer: Add TaskRunner and more task classes) and T374591: Installer Task abstraction. Prior to that, upgrades still work fine for me locally.

At glance, it seems during development of that patch, the handling of VirtualDomains changed from being an implicit part of DBLoadBalancerFactory, to a separately injected concept recognised as top-level dependency. This dependency was then "provided" in the installer (via includes/installer/Task/ExtensionsProvider.php). The only place where I see the dependency declared but not provided is includes/installer/Task/RestoredServicesProvider.php. I'm guessing this provider is used instead of, or in front of, the ExtensionsProvider.php provider, when running the "Upgrade" step in the web installer on existing installs.

tstarling triaged this task as High priority.

We'd be so much better off just starting up normally, like what update.php does, rather than starting out with no settings or services and then attempting to construct them later.

There's a mode allowing you to upgrade with no LocalSettings.php and then regenerate it, but I asked if anyone used that on wikitech-l and I just got crickets.

I guess it can be hacked up somehow to resolve the bug in the short term.

We'd be so much better off just starting up normally, like what update.php does, rather than starting out with no settings or services and then attempting to construct them later.

I filed T387428 for this.

Change #1123086 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] installer: Migrate web upgrade to the task framework

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

Change #1123086 merged by jenkins-bot:

[mediawiki/core@master] installer: Migrate web upgrade to the task framework

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

Works now, thanks.