Page MenuHomePhabricator

MW 1.31 install reports "InvalidArgumentException ... DatabaseDomain.php: Domain has too few or too many parts "
Closed, ResolvedPublic

Description

Trying to install MW 1.31 (using mw-31-00-git as dbname) fails with:

Install
Setting up database... done
Creating tables... done
Creating database user... done
Populating default interwiki table... done
Initialising statistics... done
Generating secret keys... done
Prevent running unneeded updates... done
Creating administrator user account... 
[9fafa63c00d1142f94cf4b4b] /mw-31-00-git/mw-config/index.php?page=Install InvalidArgumentException from line 80 of ...\mw-31-00-git\includes\libs\rdbms\database\DatabaseDomain.php: Domain has too few or too many parts.

Backtrace:

#0 ...\mw-31-00-git\includes\libs\rdbms\loadbalancer\LoadBalancer.php(938): Wikimedia\Rdbms\DatabaseDomain::newFromId(string)
#1 ...\mw-31-00-git\includes\libs\rdbms\loadbalancer\LoadBalancer.php(867): Wikimedia\Rdbms\LoadBalancer->openForeignConnection(integer, string, integer)
#2 ...\mw-31-00-git\includes\libs\rdbms\loadbalancer\LoadBalancer.php(746): Wikimedia\Rdbms\LoadBalancer->openConnection(integer, string, integer)
#3 ...\mw-31-00-git\includes\libs\rdbms\loadbalancer\LoadBalancer.php(831): Wikimedia\Rdbms\LoadBalancer->getConnection(integer, array, string, integer)
#4 ...\mw-31-00-git\includes\jobqueue\JobQueueDB.php(783): Wikimedia\Rdbms\LoadBalancer->getConnectionRef(integer, array, string, integer)
#5 ...\mw-31-00-git\includes\jobqueue\JobQueueDB.php(764): JobQueueDB->getDB(integer)
#6 ...\mw-31-00-git\includes\jobqueue\JobQueueDB.php(187): JobQueueDB->getMasterDB()
#7 ...\mw-31-00-git\includes\jobqueue\JobQueue.php(336): JobQueueDB->doBatchPush(array, integer)
#8 ...\mw-31-00-git\includes\jobqueue\JobQueue.php(306): JobQueue->batchPush(array, integer)
#9 ...\mw-31-00-git\includes\jobqueue\JobQueueGroup.php(154): JobQueue->push(array)
#10 ...\mw-31-00-git\includes\user\UserGroupMembership.php(162): JobQueueGroup->push(array)
#11 ...\mw-31-00-git\includes\user\User.php(3662): UserGroupMembership->insert(boolean)
#12 ...\mw-31-00-git\includes\installer\Installer.php(1666): User->addGroup(string)
#13 ...\mw-31-00-git\includes\installer\Installer.php(1575): Installer->createSysop(MysqlInstaller)
#14 ...\mw-31-00-git\includes\installer\WebInstallerInstall.php(44): Installer->performInstallation(array, array)
#15 ...\mw-31-00-git\includes\installer\WebInstaller.php(281): WebInstallerInstall->execute()
#16 ...\mw-31-00-git\mw-config\index.php(79): WebInstaller->execute(array)
#17 ...\mw-31-00-git\mw-config\index.php(38): wfInstallerMain()
#18 {main}

Event Timeline

Imarlier removed Krinkle as the assignee of this task.
Imarlier assigned this task to aaron.
Imarlier added a subscriber: Krinkle.
Imarlier subscribed.

This should definitely be fixed before 1.32.

Note that git master (19dd28798163) installs fine with postgres, which has the same DB domain patches as 1.32.

aaron changed the task status from Open to Stalled.Nov 19 2018, 8:36 PM
aaron triaged this task as Low priority.Nov 20 2018, 7:47 PM

@mwjames we believe that this is fixed, but we're waiting on confirmation of that. Could you please let us know if this is addressed for you?

Thanks!

FYI, I believe that @mwjames is still on hiatus until the end of this calendar year.

Both linked patches are in REL1_32, so I'm removing this as a 1.32 release blocker, but I think there still needs to be stuff backported to REL1_31.

Actually, it looks 51945dbca35944567480b6e6494c7c2fa0c75797 is what avoid problems with "bad" $wgDBname values here, which is 1.33 (master) only. The ambiguity of the hyphens is already special cased in master when the domain matches wfWikiId().

Backporting the WikiMap methods and the JobQueueGroup::push logic with REL 1.32 yields:

php maintenance/install.php --dbpath "/home/aaron" --dbname "mw-hyphen-db" --dbtype sqlite --pass vagrantvagrant HyphenWiki Aaron                                                                             PHP 7.2.10-0ubuntu0.18.04.1 is installed.                                                                               Warning: Could not find APCu or WinCache. Object caching is not enabled.                                                Could not find GD library or ImageMagick. Image thumbnailing will be disabled.                                          Found the Git version control software: /usr/bin/git.                                                                   Warning: No --scriptpath specified, using default: /wiki.                                                               Using server URL "/wiki".                                                                                               Warning: Your default directory for uploads (/mnt/c/OSS/core/images/) is not checked for vulnerability to arbitrary script execution during the CLI install.                                                                                    Using the intl PECL extension for Unicode normalization.                                                                The environment has been checked. You can install MediaWiki.                                                            Setting up database                                                                                                     done                                                                                                                    Creating tables                                                                                                         done                                                                                                                    Populating default interwiki table                                                                                      done                                                                                                                    Initializing statistics                                                                                                 done                                                                                                                    Generating secret keys                                                                                                  done                                                                                                                    Prevent running unneeded updates                                                                                        done                                                                                                                    Creating administrator user account                                                                                     done                                                                                                                    Creating main page with default content                                                                                 done                                                                                                                    MediaWiki has been successfully installed. You can now visit </wiki> to view your wiki. If you have questions, check out our frequently asked questions list: <https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ> or use one of the support forums linked on that page.

Likewise for REL 1.31.

I'll put the patches for both releases in gerrit.

Change 491660 had a related patch set uploaded (by Aaron Schulz; owner: Aaron Schulz):
[mediawiki/core@REL1_31] Backport WikiMap/JobQueueGroup logic to handle hyphenated DB names

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

Change 491661 had a related patch set uploaded (by Aaron Schulz; owner: Aaron Schulz):
[mediawiki/core@REL1_32] Backport WikiMap/JobQueueGroup logic to handle hyphenated DB names

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

Change 491661 merged by jenkins-bot:
[mediawiki/core@REL1_32] Backport WikiMap/JobQueueGroup logic to handle hyphenated DB names

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

Change 491660 merged by jenkins-bot:
[mediawiki/core@REL1_31] Backport WikiMap/JobQueueGroup logic to handle hyphenated DB names

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