Topic on Project:Support desk

port for postgres at initial setup ignored

11
Summary by PlavorSeol

Should be on Phabricator

91.245.215.230 (talkcontribs)

Hi,

I set up everything as described for mediawiki with apache2 and postgres9.4. Apache is up and running, and postgres has got a new, own db-cluster for itself (called mediawiki), listening on port 5433 and holding already the database wikidb owned by wikiuser.

Whatever I try on the initial page, that routine always connects to port 5432 instead of the manually entered one: 5433,

neither on 'host left blank' on 'localhost' on 127.0.0.1 or on ::1. In a wireshark trace I can see, that:

"Form item: "postgres_wgDBport" = "5433"

Key: postgres_wgDBport

Value: 5433"

In the log of Postgresql I see only connection to the cluster "main" listening on port: 5432. the log for the cluster on port 5433 is silent. if I turn down the "main" cluster the initial setup page reports the database is unavailable.

Supporting my focus on mediawiki is the error-message " accepting TCP/IP connections on port 5432?", despite 5433 is still in the field "Databaseport" .... Anything I could do on my own? I would be happy to have a mediwiki running...

- bullycamper

91.245.215.230 (talkcontribs)

I tried a few thing and this worked for me:

changing in maintenance.install.php and in includes/DefaultSettings.php the port both to 5433, but had later to copy the new generated LocaSettings.php by hand, since the automatic routine did not manage it (probably due to my changes).

87.123.63.88 (talkcontribs)

Do you want to open a bugreport and discuss this issue further there?

That way, the developers can think about how to fix this issue in future versions!

Ciencia Al Poder (talkcontribs)

Please do not edit DefaultSettings.php, but instead add your configuration overrides in LocaSettings.php

87.123.63.88 (talkcontribs)

During initial setup, LocalSettings.php is not yet there.

185.42.60.232 (talkcontribs)

I cant use different port but 5432, there is my LocalSettings.php configuration:

$wgDBtype = "postgres";

$wgDBserver = "127.0.0.1";

$wgDBport = 11111;

$wgDBname = "mydatabase";

$wgDBmwschema = "myscheme";

$wgDBuser = "postgres";

$wgDBpassword = "postgres";

Errors:

  • Cannot connect to database mydatabase: Cannot access the database: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?
  • Cannot connect to database template1: Cannot access the database: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?
  • Cannot connect to database postgres: Cannot access the database: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?
Makeev95 (talkcontribs)

I solved it by creating port link:

ln -s /var/run/postgresql/.s.PGSQL.$port /path/to/wiki/.s.PGSQL.5432

LocalSettings.php configuration:

$wgDBserver = "/path/to/wiki"

$wgDBport is blank

Ciencia Al Poder (talkcontribs)

This has been apparently fixed in MediaWiki 1.29. See task T30162

Makeev95 (talkcontribs)

I use MediaWiki 1.31, and there is still issue here

Ciencia Al Poder (talkcontribs)

Please report it again on the task T30162, otherwise it will never be fixed

Cédric Delayre (talkcontribs)

To fix this bug:

In /var/www/mediawiki-1.33.1/includes/installer/PostgresInstaller.php

function openConnectionToAnyDB()

add the following line

'port' => $this->getVar( 'wgDBport' ),

in the connection parameters and retry the configuration wizard.

Hope to have time to commit this fix...

Reply to "port for postgres at initial setup ignored"