Page MenuHomePhabricator

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

Description

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

Bawolff created this task.Dec 18 2018, 5:07 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 18 2018, 5:07 PM
Setian added a subscriber: Setian.EditedFeb 23 2019, 12:15 PM

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()".