Page MenuHomePhabricator

Installer doesn't handle connection error in SHOW ENGINES gracefully
Open, Needs TriagePublic


Reported by @Urbanecm on irc.

MysqlInstaller::getEngines() doesn't check the $status return of getConnection(). This can result in a very confusing error.

At the very least, this should throw an exception using the $status value in the event no connection is available.

Based on irc conversation, probably trigerrable when doing an update with incorrect mysql credentials in the LocalSettings.php.

Event Timeline

Here are the current error messages I get (when using mysql Ver 15.1 Distrib 10.1.34-MariaDB, for debian-linux-gnu (x86_64)):

Wrong password:

Cannot access the database: :real_connect(): (HY000/1045): Access denied for user 'admin'@'localhost' (using password: YES)

Wrong database server:

Cannot access the database: :real_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known

If you put "oracle" in place of "mysql" it crashes with "Call to undefined function oci_error()".