Bug 492825 - Media wiki doesn't report the version of PostGres correctly.
Media wiki doesn't report the version of PostGres correctly.
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: mediawiki (Show other bugs)
10
x86_64 Linux
low Severity high
: ---
: ---
Assigned To: Axel Thimm
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-30 03:39 EDT by Austin
Modified: 2009-12-18 04:08 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-12-18 04:08:56 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Austin 2009-03-30 03:39:16 EDT
Description of problem:
Cannot configure mediawiki to use a postgres database.

Version-Release number of selected component (if applicable):
mediawiki-1.14.0-45.fc10.x86_64

How reproducible:
Every time.

Steps to Reproduce:
1. Install mediawiki
2. Mapped the /usr/share/mediawiki directory into the URL address space of /wiki using an alias.
3. Launched a browser at http://servername/wiki and clicked on "configure".
4. Entered in some basic details, changed over to use a postgres database, and clicked "Install Media Wiki"
  
Actual results:
    * PHP 5.2.6 installed
    * Found database drivers for: MySQL PostgreSQL
    * PHP server API is apache2handler; ok, using pretty URLs (index.php/Page_Title)
    * Have XML / Latin1-UTF-8 conversion support.
    * Session save path (/var/lib/php/session) appears to be valid.
    * PHP's memory_limit is 32M.
    * Couldn't find Turck MMCache, eAccelerator, APC or XCache; cannot use these for object caching.
    * Found GNU diff3: /usr/bin/diff3.
    * Found ImageMagick: /usr/bin/convert; image thumbnailing will be enabled if you enable uploads.
    * Found GD graphics library built-in.
    * Installation directory: /usr/share/mediawiki
    * Script URI path: /wiki
    * Installing MediaWiki with php file extensions
    * Environment checked. You can install MediaWiki.
    *

      Generating configuration file...
    * Database type: PostgreSQL
    * Loading class: DatabasePostgres
    * Attempting to connect to database "wikidb" as "wikiuser"... error: No database connection
    * Checking the version of Postgres...
      Warning: pg_version(): supplied argument is not a valid PostgreSQL link resource in /usr/share/mediawiki/includes/db/DatabasePostgres.php on line 1074
      FAILED. Required version is 8.1. You have 7.3 or earlier


Expected results:
For it to work

Additional info:
# rpm -qa postgres*
postgresql-libs-8.3.7-1.fc10.x86_64
postgresql-python-8.3.7-1.fc10.x86_64
postgresql-8.3.7-1.fc10.x86_64
postgresql-server-8.3.7-1.fc10.x86_64
Comment 1 Austin 2009-03-30 03:43:58 EDT
I'm not sure about the "No database connection" part either.

# netstat -nap | grep postmaster
tcp        0      0 127.0.0.1:5432              0.0.0.0:*                   LISTEN      1992/postmaster
udp        0      0 127.0.0.1:42712             127.0.0.1:42712             ESTABLISHED 1992/postmaster
unix  2      [ ACC ]     STREAM     LISTENING     7420   1992/postmaster     /tmp/.s.PGSQL.5432
Comment 2 John Doyle 2009-05-11 07:02:16 EDT
This may be related to https://bugzilla.wikimedia.org/show_bug.cgi?id=16937 and http://bugs.php.net/bug.php?id=48181
Comment 3 Ricky Zhou 2009-06-22 00:07:13 EDT
As mentioned in John's bug link, this will be fixed with either mediawiki 1.15.0 or php 5.3 are out.  I'm also pinging the EPEL maintainer about the possibility of backporting the fix: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/50473
Comment 4 Ricky Zhou 2009-06-22 00:31:09 EDT
I'm sorry, I'm actually mistaken, I just confirmed that this is still broken with 1.15.0.  I'm looking into it more.
Comment 5 Ricky Zhou 2009-06-22 00:36:54 EDT
Aaand I'm an idiot, it actually is fixed, sorry for the noise.  I'm going to test backporting this to 1.14.0 for EPEL now.
Comment 6 Ricky Zhou 2009-06-22 01:01:36 EDT
Hey, Austin, I was actually unable to reproduce the problem using the stock mediawiki 1.14.0 tarball on F11.  I did get the impression on the upstream bug that most people were reporting this occurring in windows.  One instance where I did see the error message that you described was when I an incorrect username, password, or database host in the setup script.  Can you still reproduce this problem using information that you have confirmed works using:

psql -U userame -h host wikidb

I'm setting this to needinfo for so that we can get info for reproducing this.
Comment 7 Axel Thimm 2009-07-24 16:19:26 EDT
Austin, have you tested this again? There is also mediawiki 1.15.1 in the repo, which may have fixed this for you.
Comment 8 Austin 2009-08-02 20:00:51 EDT
Sorry for not responding sooner - forgot my account details here.

I used mediawiki from the repo, not the tarball. I can re-investigate for F11 shortly, and an F10 system a little later.

Still raising the need-info flag, as I've not supplied it yet.
Comment 9 Austin 2009-08-02 21:56:02 EDT
OK, trying again on a (relatively) clean F11 install. Adding to this update as I go:

1. Using mediawiki v1.14.0-45.fc11.i586 (default?)
2. Using Postgres-server v8.3.7-1.fc11.i586 (updated?)
3. # cd /var/www/html; ln -s ../wiki . # To bring it into the web space (no alias this time)
4. Visit http://server/wiki and receive "please setup the wiki first" message.
5. Click link to setup.
6. Enter details, including PostGreSQL DB, account passwords, and include root to setup the DB.
7. Click Install MediaWiki button.
8. Received "Could not connect to database as superuser" message.
9. Check Postgres by running psql as postgres and \du:
postgres=# \du
                               List of roles
 Role name | Superuser | Create role | Create DB | Connections | Member of
-----------+-----------+-------------+-----------+-------------+-----------
 postgres  | yes       | yes         | yes       | no limit    | {}
 root      | yes       | yes         | yes       | no limit    | {}
(2 rows)
10. enter confused state.
11. Check top of wiki page, and see:
# Database type: PostgreSQL
# Loading class: DatabasePostgres
# Attempting to connect to database "postgres" as superuser "root"... error: No database connection
12. More confusion - I just connected to check users...
# netstat -nap | grep postm
tcp        0      0 127.0.0.1:5432              0.0.0.0:*                   LISTEN      3025/postmaster

Just noticed that this is an i586 install and not the x86_64 version initially reported, but I don't have access to that system anymore. It's not reporting an incorrect version of Postgres, but it's not working either.

Will leave the need-info field marked as a reminder.
Comment 10 Austin 2009-08-02 22:05:55 EDT
OK, ignoring the "I can't do stuff as root" thing it tries to, I decided to create the wikiuser and database and untick the "use superuser" field.

root #> createuser -S -D -R -P -E wikiuser
Enter password for new role:
Enter it again:
root #> # createdb -O wikiuser wikidb

Re-running the web-installer, I now get:

# Database type: PostgreSQL
# Loading class: DatabasePostgres
# Attempting to connect to database "wikidb" as "wikiuser"... error: No database connection
# Checking the version of Postgres...
Warning: pg_version(): supplied argument is not a valid PostgreSQL link resource in /usr/share/mediawiki/includes/db/DatabasePostgres.php on line 1074
FAILED. Required version is 8.1. You have 7.3 or earlier

What's the "no database connection" thing still hovering about?

At least it comes up with the error message as initially reported.
Comment 11 Axel Thimm 2009-08-02 22:13:57 EDT
(In reply to comment #9)
> OK, trying again on a (relatively) clean F11 install. Adding to this update as
> I go:
> 
> 1. Using mediawiki v1.14.0-45.fc11.i586 (default?)

We have 1.15.1 in the updates now, can you please try that instead? (You possibly also have no other updates as well)

> # Attempting to connect to database "postgres" as superuser "root"... error: No
> database connection

When this happens, can you try to check what a tcpdump -i any port 5432 reports in another window?

> # netstat -nap | grep postm
> tcp        0      0 127.0.0.1:5432              0.0.0.0:*                  
> LISTEN      3025/postmaster

Just a shot in the dark, did you give localhost/127.0.0.1 as the database server to the mediawiki install or perhaps a non-localhost fqdn/ip? In the latter case the error would be OK, and you would need to connect to localhost, or if you want to multi-tier the setup you need to listen on more than the loopback device.
Comment 12 Orien 2009-09-12 19:25:49 EDT
I've just run into the same issue. In my case the cause was SELinux. In F11 SELinux is configured to prevent httpd from accessing databases by default. Check /var/log/audit/audit.log to see if this is the problem in your case. After adding the appropriate SELinux permission for httpd the configuration process was successful.
Comment 13 Axel Thimm 2009-10-24 02:27:11 EDT
Orien, could you quote your SELinux permission configuration? Dan, could we add this to the policy? Thanks!
Comment 14 Daniel Walsh 2009-10-26 11:04:22 EDT
Orien, did you need to turn on the httpd_can_network_connect_db boolean.

setsebool -P httpd_can_network_connect_db 1
Comment 15 Orien 2009-10-28 06:56:38 EDT
Axel, Dan, the only change I made to the default F11 SELinux configuration is to activate the httpd_can_network_connect_db boolean.
Comment 16 Bug Zapper 2009-11-18 04:57:42 EST
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 17 Bug Zapper 2009-12-18 04:08:56 EST
Fedora 10 changed to end-of-life (EOL) status on 2009-12-17. Fedora 10 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

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