Page MenuHomePhabricator

Call to undefined method Wikimedia\Rdbms\DBQueryError::getText() in MysqlInstaller.php
Closed, ResolvedPublic

Description

The try-catch clauses in MysqlInstaller.php attempt to use the method ->getText() from the class DBQueryError, but neither this class nor its parents do declare such method. Trying to run the installer fails with an error message from PHP:
PHP Fatal error: Call to undefined method Wikimedia\Rdbms\DBQueryError::getText() in /home/mwuser/mediawiki/includes/installer/MysqlInstaller.php on line 597
Edit: This also appears to be the case in MssqlInstaller.php

Steps to reproduce:

Try running install.php with the dbuser and dbpass flags set to a user that already exists, with installdbuser an installdbpass set as well.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 15 2017, 1:06 PM
Mainframe98 updated the task description. (Show Details)May 15 2017, 1:13 PM

I've fixed this by replacing the calls to getText() with getMessage() similar to how PostgresInstaller.php does this.

Change 353894 had a related patch set uploaded (by Mainframe98; owner: Mainframe98):
[mediawiki/core@master] Replace calls to getText() on DBQueryError exceptions

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

Mainframe98 updated the task description. (Show Details)May 15 2017, 5:01 PM
Mainframe98 updated the task description. (Show Details)May 15 2017, 7:14 PM

Change 353894 merged by jenkins-bot:
[mediawiki/core@master] installer: Replace bad calls to getText() on DBQueryError exceptions

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

Change 355472 had a related patch set uploaded (by Chad; owner: Mainframe98):
[mediawiki/core@REL1_29] installer: Replace bad calls to getText() on DBQueryError exceptions

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

Change 355472 merged by jenkins-bot:
[mediawiki/core@REL1_29] installer: Replace bad calls to getText() on DBQueryError exceptions

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

Krinkle closed this task as Resolved.Sep 27 2017, 10:59 PM
Krinkle removed a project: Patch-For-Review.