Last modified: 2014-10-17 11:26:53 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T47225, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 45225 - Installation using non-standard PostgreSQL port fails with "7.3 or earlier" error message
Installation using non-standard PostgreSQL port fails with "7.3 or earlier" e...
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.19.3
PC Linux
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
aklapper-moreinfo
:
Depends on:
Blocks: postgres
  Show dependency treegraph
 
Reported: 2013-02-21 11:46 UTC by dale
Modified: 2014-10-17 11:26 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description dale 2013-02-21 11:46:11 UTC
In file DatabasePostgresq.php, function getServerVersion() the version_compare fails and reports that the version is 7.3 or earlier.

This is not just incorrect but misleading during installation.

The call to pg_version() is made with $this->mConn which is null.

A test for $this->mConn == null would avoid the misleading error message.

===================

        function getServerVersion() {
                if ( !isset( $this->numeric_version ) ) {
                        if ($this->mConn == null) {
                           $this->numeric_version = 'No database connection';
                        } else {
                        $versionInfo = pg_version( $this->mConn );
                        if ( version_compare( $versionInfo['client'], '7.4.0', 'lt' ) ) {
                                // Old client, abort install
                                $this->numeric_version = '7.3 or earlier';
                        } elseif ( isset( $versionInfo['server'] ) ) {
                                // Normal client
                                $this->numeric_version = $versionInfo['server'];
                        } else {
                                // Bug 16937: broken pgsql extension from PHP<5.3
                                $this->numeric_version = pg_parameter_status( $this->mConn, 'server_version' );
                        }
                        }
                }
                return $this->numeric_version;
        }

===================
Comment 1 Marcin Cieślak 2013-03-08 11:49:32 UTC
Are you getting some error message in the installer?
Comment 2 dale 2013-03-08 12:03:28 UTC
The error message is that the postgres version is "7.3 or earlier".

However, as in my original post, that is misleading because the database connection was null. Therefore the pg_version() function failed.

Based on other errors I saw, what I suspect is happening is that the install ignores the Postgres setup on the initial install page. The page where it asks for IP and port for the database. 

On Debian this is mostly port 5433 NOT 5432. However, the install code ignores this and tries to connect to the database on the default port. This will fail.

To work around this I found all occurrences of 5432 and edited/changed them to 5433 and the install worked.
Comment 3 dale 2013-03-08 12:05:01 UTC
Two fixes IMO.

1) use the port specified on the install page

2) check for null on the database connection
Comment 4 Marcin Cieślak 2013-03-08 12:45:26 UTC
One thing here is that you might run into bug 28162 which mean port number
is not accepted unless the page is reload (for example, by using "Back"
and "Continue" button).

I have changed my PostgreSQL server port number to 5433, used back and continue
buttons to really save it and then it installed the MediaWiki normally without
issues.

Even when PostgreSQL server was not running or some permission were wrong I got appropriate error messages and not the "wrong server version error".

I think the problem is somewhere else, are you using mediawiki downloaded from mediawiki.org? If not, can you try that one?

I was using version tagged in git (5186d6f5b7da98e43ddf2a194f58cf9c391800a6)
in my testing.
Comment 5 Andre Klapper 2014-08-22 12:43:00 UTC
dale: If this is still a problem, could you answer comment 4, please?
Comment 6 Andre Klapper 2014-10-17 11:26:53 UTC
Unfortunately closing this report as no further information has been provided.

dale: Please feel free to reopen this report if you can provide the information asked for in comment 4 and if this still happens. Thanks!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links