Page MenuHomePhabricator

PostgreSQL installer ignores port specification
Closed, ResolvedPublic

Description

The PostgreSQL installer (both web and CLI) ignores the port specification for the database server. It always assumes the default port 5432. This fix works for me:

--- includes/installer/PostgresInstaller.php    2020/02/17 08:12:10     1.1
+++ includes/installer/PostgresInstaller.php    2020/02/17 08:12:28
@@ -270,6 +270,7 @@
                        try {
                                $p = [
                                        'host' => $this->getVar( 'wgDBserver' ),
+                                       'port' => $this->getVar( 'wgDBport' ),
                                        'user' => $user,
                                        'password' => $password,
                                        'dbname' => $db

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 17 2020, 8:17 AM

Hi @joernc_unibi, thanks for taking a look at the code and welcome to Wikimedia Phabricator!

You are very welcome to use developer access to submit the proposed code changes as a Git branch directly into Gerrit which makes it easier to review and provide feedback. If you don't want to set up Git/Gerrit, you can also use the Gerrit Patch Uploader. Thanks again!

I tried the Gerrit patch uploader, but either I chose the wrong project ("mediawiki"), and/or the wrong prefix for the file to patch. The patch as shown above was rejected. As I am not a developer, I'd rather prefer someone else would submit this change if it is considered useful.

Is this a duplicate of T30162: Installer does not respect initial DBport declaration? I can help get your patch into Gerrit either way.

This might solve T30162, at least that's the only task I could find mentioning the same problem. But as that task has been dragging on for ages, I'm not sure if it hasn't moved on to different topics. Especially considering that the fix seems so obvious... That's why I opened a new task. Any help in getting this bug fixed is appreciated.

Change 574911 had a related patch set uploaded (by saper; owner: saper):
[mediawiki/core@master] PostgreSQL installer should not ignore port setting

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

I just checked in 1.35.0 rc0, and this bug is still present. Why????? Could someone please just commit this?

Change 574911 merged by jenkins-bot:
[mediawiki/core@master] installer: PostgreSQL installer should respect a custom port

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

Change 619607 had a related patch set uploaded (by Legoktm; owner: saper):
[mediawiki/core@REL1_35] installer: PostgreSQL installer should respect a custom port

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

Legoktm closed this task as Resolved.Aug 12 2020, 6:04 AM
Legoktm assigned this task to joernc_unibi.

I just checked in 1.35.0 rc0, and this bug is still present. Why????? Could someone please just commit this?

Sorry, I missed following up on this. It's now merged and will be backported for 1.35. Thanks for the patch :)

Change 619607 merged by jenkins-bot:
[mediawiki/core@REL1_35] installer: PostgreSQL installer should respect a custom port

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

Sorry, I missed following up on this. It's now merged and will be backported for 1.35. Thanks for the patch :)

No problem, I didn't want to sound angry. Thanks for importing this patch and especially backporting it to 1.35.