Page MenuHomePhabricator

Installer does not respect initial DBport declaration
Closed, DuplicatePublic

Description

When installing using Postgres, a change to the database port field is not respected, and always tries the default, 5432. A reload or retry does pick up the new port.


Version: 1.18.x
Severity: minor
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=45225

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.
StatusSubtypeAssignedTask
InvalidNone
DuplicateNone

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:27 PM
bzimport set Reference to bz28162.
bzimport added a subscriber: Unknown Object (MLST).

Temporary fix for 1.17 in r89859. Leaving open pending fix in trunk.

karun.84 wrote:

patch to include constructor in installer

Hello,
I have begun working on a patch to change the constructor for open(...) for the database to include the port number.
Currently the installer works correctly with the patch. However once installed, MediaWiki is unable to connect to the database.

Is someone able to point me into the right direction with this?

Regards
Karun

attachment 28162.patch ignored as obsolete

Verified the two line change to phase3/includes/installer/PostgresInstaller.php in r89859 fixes this for me, FWIW.

sumanah wrote:

Karun, it would be great if you would submit this into Git and Gerrit:

https://www.mediawiki.org/wiki/Git/Workflow#How_to_submit_a_patch

Push as a draft commit to Gerrit as https://gerrit.wikimedia.org/r/#/c/8906/

https://gerrit.wikimedia.org/r/gitweb?p=mediawiki%2Fcore.git;a=commit;h=b9757da0b051ca3b331b3626ce0874a3f838597a

Unfortunately, LocalBalancer.php fails on this:

$ php maintenance/eval.php

$z = wfGetDB(-2);

DB connection error: No database connection
Backtrace:
#0 /usr/home/saper/public_html/pg/w/includes/db/LoadBalancer.php(749): DatabaseBase->reportConnectionError('Unknown error (...')
#1 /usr/home/saper/public_html/pg/w/includes/db/LoadBalancer.php(509): LoadBalancer->reportConnectionError(Object(DatabasePostgres))
#2 /usr/home/saper/public_html/pg/w/includes/GlobalFunctions.php(3562): LoadBalancer->getConnection(-2, Array, false)
#3 /usr/home/saper/public_html/pg/w/maintenance/eval.php(72) : eval()'d code(1): wfGetDB(-2)
#4 /usr/home/saper/public_html/pg/w/maintenance/eval.php(72): eval()
#5 {main}

so I can't even run update.php

Needs more work on the LoadBalancer.php issue.

sumanah wrote:

Comment on attachment 9410
patch to include constructor in installer

Patch is now in Gerrit.

Change 8906 abandoned by Hashar:
(bug 28162) Installer ignores initial DBport

Reason:
Cleaning up very old change. Feel free to resurrect if there is any interest in finishing this.

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

This may require getting just the old patch and try to make it work.

Jdforrester-WMF subscribed.

Migrating from the old tracking task to a tag for PostgreSQL-related tasks.

Change 339594 had a related patch set uploaded (by Krinkle):
installer: Fix "relation 'user' does not exist" error for Postgres

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

Change 339594 merged by jenkins-bot:
installer: Fix "relation 'user' does not exist" error for Postgres

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

Krinkle claimed this task.
Ajanssens2 subscribed.

On versions 1.31 and 1.32 this is still present.

Screenshot from 2019-02-27 11-34-41_2.png (1×1 px, 219 KB)

Aklapper added a subscriber: Krinkle.

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

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

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

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