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

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

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