Page MenuHomePhabricator

An exception is thrown in web installer if mysql driver is not found, not allowing to choose a different database engine
Closed, ResolvedPublic

Description

Author: sajjad.gerami

Description:
In installation step 4 when MW is supposed to list available DBs it gives me this error:

[670fe058] /wiki/mw-config/index.php Exception from line 788 of /var/www/wiki/includes/db/Database.php: DatabaseBase::factory no viable database extension found for type 'mysql'

Backtrace:

#0 /var/www/wiki/includes/installer/WebInstallerPage.php(487): DatabaseBase::factory(string)
#1 /var/www/wiki/includes/installer/WebInstaller.php(275): WebInstaller_DBConnect->execute()
#2 /var/www/wiki/mw-config/index.php(61): WebInstaller->execute(array)
#3 /var/www/wiki/mw-config/index.php(29): wfInstallerMain()
#4 {main}

I don't have mysql installed and I don't want to use mysql. I want to install MW with PostgreSQL. but it seems it's looking for mysql and gives error when it can't find it or something.


MediaWiki 1.22.0
PostgreSQL 9.3.1
Debian testing (jessie) 3.11-2-amd64
apache2 2.4.6-3 amd64


Version: 1.22.0
Severity: blocker
OS: Linux
Platform: PC

Details

Reference
bz58167

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:30 AM
bzimport set Reference to bz58167.
bzimport added a subscriber: Unknown Object (MLST).

sajjad.gerami wrote:

Environmental checks

Basic checks will now be performed to see if this environment is suitable for MediaWiki installation. Remember to include this information if you seek support on how to complete the installation.
PHP 5.5.6-1 is installed.
Found ImageMagick: /usr/bin/convert.

Image thumbnailing will be enabled if you enable uploads.
Found the Git version control software: /usr/bin/git.
Using server name "http://localhost".
Using server URL "http://localhost/wiki".
Using the intl PECL extension for Unicode normalization.
The environment has been checked. You can install MediaWiki.

sajjad.gerami wrote:

after I installed mysql (apt-get install php5-mysql) I can see both mysql and postgres in db selection step. that's not a solution and more of a dirty workaround.

After uninstalling php5-mysql* extensions, commandline installer works, but WebInstaller gives:

[58644ce6] /pg/w/mw-config/index.php Exception from line 788 of /usr/home/saper/public_html/pg/w/includes/db/Database.php: DatabaseBase::factory no viable database extension found for type 'mysql'
Backtrace:
#0 /usr/home/saper/public_html/pg/w/includes/installer/WebInstallerPage.php(487): DatabaseBase::factory(string)
#1 /usr/home/saper/public_html/pg/w/includes/installer/WebInstaller.php(275): WebInstaller_DBConnect->execute()
#2 /usr/home/saper/public_html/pg/w/mw-config/index.php(61): WebInstaller->execute(array)
#3 /usr/home/saper/public_html/pg/w/mw-config/index.php(29): wfInstallerMain()
#4 {main}

Reverting Id1a3fc34e94006b880f58de83e5e7c70b21d26ed seems to help.... :/

  • Bug 58735 has been marked as a duplicate of this bug. ***

Change 103379 had a related patch set uploaded by btongminh:
Output plain text database name in installer if driver not installed

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

Another patch which changed the code path and can be a possible failure: I29df3fc9b3bf5743c1365f757e0cf899d5b96ae9 from Tim Starling

Tim Starling, can you have a look here? Thanks.

The issue is that on WebInstallerPage.php:487 the installer is trying to make an instance of *every* database type (not just the one the user wants). It does this only so it can call ->getSoftwareLink() on the object and get a link for displaying in the installer.

The fix for this would probably be to just catch the exception and not include links for database engines that are not supported.

An alternative solution would be to somehow move the extension_loaded() check outside of Database::factory, but that would probably be difficult without refactoring a lot of stuff.

(In reply to comment #7)

An alternative solution would be to somehow move the extension_loaded() check
outside of Database::factory, but that would probably be difficult without
refactoring a lot of stuff.

This error is blocking new installations and existing ones that want to upgrade.

Just an idea: Let's find a quick and easy way to prevent the error from happening, reverting the commit that broke it if needed, and plan to fix it "properly" for 1.23.0 ;)

Change 106489 had a related patch set uploaded by PleaseStand:
WebInstaller: Don't call getSoftwareLink()

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

Change 106490 had a related patch set uploaded by PleaseStand:
Clean up config-support-* messages

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

Change 106491 had a related patch set uploaded by PleaseStand:
Web installer: Remove support for old config-support-* translations

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

Change 106490 abandoned by PleaseStand:
Clean up config-support-* messages

Reason:
Squashed into I6dbc9d32, with message keys changed.

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

Change 106491 abandoned by PleaseStand:
Web installer: Remove support for old config-support-* translations

Reason:
Squashed into I6dbc9d32, with message keys changed.

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

Change 106489 merged by jenkins-bot:
WebInstaller: Don't call getSoftwareLink()

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

  • Bug 59999 has been marked as a duplicate of this bug. ***

Change 103379 abandoned by btongminh:
Output plain text database name in installer if driver not installed

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