Debian Bug report logs - #678541
roundcube-pgsql: roundcube cannot connect to postgresql after purge and complete reinstall

Package: roundcube; Maintainer for roundcube is Debian Roundcube Maintainers <pkg-roundcube-maintainers@alioth-lists.debian.net>; Source for roundcube is src:roundcube (PTS, buildd, popcon).

Reported by: Luc Maisonobe <luc@spaceroots.org>

Date: Fri, 22 Jun 2012 15:39:02 UTC

Severity: grave

Done: Vincent Bernat <bernat@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Roundcube Maintainers <pkg-roundcube-maintainers@lists.alioth.debian.org>:
Bug#678541; Package roundcube. (Fri, 22 Jun 2012 15:39:05 GMT) (full text, mbox, link).


Acknowledgement sent to Luc Maisonobe <luc@spaceroots.org>:
New Bug report received and forwarded. Copy sent to Debian Roundcube Maintainers <pkg-roundcube-maintainers@lists.alioth.debian.org>. (Fri, 22 Jun 2012 15:39:05 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Luc Maisonobe <luc@spaceroots.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: roundcube-pgsql: roundcube cannot connect to postgresql after purge and complete reinstall
Date: Fri, 22 Jun 2012 17:35:15 +0200
Package: roundcube
Version: 0.7.2-2
Severity: grave
Justification: renders package unusable

Dear Maintainer,
*** Please consider answering these questions, where appropriate ***

The problem appear after an upgrade from postgresql 8.x to 9.x and un upgrade from roundcube 0.5.x to 0.7.x.
After upgrade, when I try to load the rouncube web page from a brower, I get the error:

DATABASE ERROR: CONNECTION FAILED!

Unable to connect to the database!
Please contact your server-administrator.

Looking in the /var/log/roundcube/error log file, I noticed this kind of errors:

[12-Jun-2012 07:44:17 UTC] PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/roundcube/program/include/rcube_config.php on line 96
[12-Jun-2012 07:44:17 UTC] PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/roundcube/program/include/rcube_config.php on line 97
[12-Jun-2012 07:44:17 UTC] MDB2 Error: connect failed (-24): _doConnect: [Error message: unable to establish a connection]
[Native message: ]

[12-Jun-2012 07:44:17 UTC] PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/roundcube/program/include/main.inc on line 2178
[12-Jun-2012 07:44:17 +0000]: DB Error: _doConnect: [Error message: unable to establish a connection]
[Native message: ]
 ** pgsql(pgsql)://roundcube:xxx@localhost/roundcube in /usr/share/roundcube/program/include/rcube_mdb2.php on line 104 (GET /webmail/)
[12-Jun-2012 07:44:18 UTC] PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/roundcube/program/include/rcube_mdb2.php on line 603


So I tried to reconfigure roundcube database connection, without success. I also tried to completely
purge roundcube, remove all trace I could see from the previous configuration, and reinstall it
from scratch. I get the same errors (both in the web page and in the log file).

I tried to change the connection to the database (tried both unix socket and TCP/IP, tried both ident
and password for authentication). Nothing worked.

I tried to look at the posgresql pg_hba.conf file, it allowed peer method for local connections and md5 method
for host connection, both in IPv4 and IPv6. I tried to connect to the roundcube database from the
command line using a non-priviledged user, with command line "psql -h localhost -U roundcube roundcube". It
did succeed with the same password that was configured in the $dbpass setting in /etc/roundcube/debian-db.php.
When connecting to the database from the command line, the command /d does display the tables that were
created at some point by one of the attempts to reconfigure roundcube, so I guess the tables are here and
the access rights for the roundcube user are set up correctly.

However, I still get always the same errors from the web page.

I would have expected that reconfiguration would have allowed roundcube to connect properly to the
database, juste as psql command line tool do.

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (980, 'stable-updates'), (980, 'stable'), (90, 'experimental'), (90, 'unstable')
Architecture: armel (armv5tel)

Kernel: Linux 2.6.39.4-11
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages roundcube-pgsql depends on:
ii  php-mdb2-driver-pgsql                      1.5.0b2-1
ii  postgresql-client-9.1 [postgresql-client]  9.1.4-1

roundcube-pgsql recommends no packages.

Versions of packages roundcube-pgsql suggests:
pn  postgresql-server  <none>

Versions of packages roundcube-core depends on:
ii  apache2-mpm-prefork [httpd]  2.2.22-7
ii  dbconfig-common              1.8.47+nmu1
ii  debconf [debconf-2.0]        1.5.43
ii  libjs-jquery                 1.7.2+debian-1
ii  libjs-jquery-ui              1.8.ooops.20+dfsg-1
ii  libmagic1                    5.11-1
ii  php-auth                     1.6.2-1
ii  php-mail-mime                1.8.4-1
ii  php-mdb2                     2.5.0b3-2
ii  php-net-smtp                 1.6.1-1
ii  php-net-socket               1.0.9-2
ii  php5                         5.4.4~rc2-1
ii  php5-gd                      5.4.4~rc2-1
ii  php5-intl                    5.4.4~rc2-1
ii  php5-mcrypt                  5.4.4~rc2-1
ii  php5-pspell                  5.4.4~rc2-1
ii  tinymce                      3.4.8+dfsg0-1
ii  ucf                          3.0025+nmu3

Versions of packages roundcube-core suggests:
ii  php-auth-sasl      1.0.4-1
pn  php-crypt-gpg      <none>
ii  roundcube-plugins  0.7.2-2

Versions of packages roundcube depends on:
ii  roundcube-core  0.7.2-2

-- debconf information:
  roundcube/dbconfig-reinstall: false
  roundcube/mysql/method: unix socket
  roundcube/upgrade-error: abort
* roundcube/pgsql/authmethod-user: password
  roundcube/purge: false
* roundcube/dbconfig-install: true
* roundcube/db/dbname: roundcube
* roundcube/language: fr_FR
  roundcube/remove-error: abort
* roundcube/remote/newhost: localhost
  roundcube/pgsql/changeconf: false
* roundcube/restart-webserver: true
  roundcube/upgrade-backup: true
  roundcube/dbconfig-upgrade: true
* roundcube/install-error: ignore
* roundcube/remote/port:
  roundcube/mysql/admin-user: root
* roundcube/pgsql/method: tcp/ip
  roundcube/pgsql/manualconf:
* roundcube/hosts: ssl://smtp.spaceroots.org:993
  roundcube/db/basepath:
* roundcube/pgsql/authmethod-admin: password
  roundcube/dbconfig-remove:
* roundcube/pgsql/no-empty-passwords:
* roundcube/pgsql/admin-user: postgres
  roundcube/passwords-do-not-match:
  roundcube/internal/reconfiguring: false
* roundcube/reconfigure-webserver: apache2
* roundcube/database-type: pgsql
* roundcube/remote/host: localhost
  roundcube/internal/skip-preseed: true
* roundcube/db/app-user: roundcube
  roundcube/missing-db-package-error: abort




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Roundcube Maintainers <pkg-roundcube-maintainers@lists.alioth.debian.org>:
Bug#678541; Package roundcube. (Sat, 23 Jun 2012 10:24:03 GMT) (full text, mbox, link).


Acknowledgement sent to Vincent Bernat <bernat@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Roundcube Maintainers <pkg-roundcube-maintainers@lists.alioth.debian.org>. (Sat, 23 Jun 2012 10:24:08 GMT) (full text, mbox, link).


Message #10 received at 678541@bugs.debian.org (full text, mbox, reply):

From: Vincent Bernat <bernat@debian.org>
To: Luc Maisonobe <luc@spaceroots.org>
Cc: 678541@bugs.debian.org
Subject: Re: Bug#678541: roundcube-pgsql: roundcube cannot connect to postgresql after purge and complete reinstall
Date: Sat, 23 Jun 2012 12:22:15 +0200
[Message part 1 (text/plain, inline)]
 ❦ 22 juin 2012 17:35 CEST, Luc Maisonobe <luc@spaceroots.org> :

> The problem appear after an upgrade from postgresql 8.x to 9.x and un
> upgrade from roundcube 0.5.x to 0.7.x.  After upgrade, when I try to
> load the rouncube web page from a brower, I get the error:
>
> DATABASE ERROR: CONNECTION FAILED!
>
> Unable to connect to the database!
> Please contact your server-administrator.

After some investigation, it appears that PostgreSQL now listens only on
5433 (SSL) while PHP is not aware of this change. Setting `$dbport` to
`'5433'` solves the problem.

I don't know the correct way to fix this. I don't think this should be
fixed in roundcube. Either PHP should default to 5433 instead of 5432
(like psql is doing right now) or dbconfig-common should default to
5433.

I have filed a bug against php5-pgsql (#678626) about this. I am marking
this bug as being blocked but the new bug in the mean time.
-- 
Don't just echo the code with comments - make every comment count.
            - The Elements of Programming Style (Kernighan & Plauger)
[Message part 2 (application/pgp-signature, inline)]

Added blocking bug(s) of 678541: 678626 Request was from Vincent Bernat <bernat@debian.org> to control@bugs.debian.org. (Sat, 23 Jun 2012 10:24:18 GMT) (full text, mbox, link).


Reply sent to Vincent Bernat <bernat@debian.org>:
You have taken responsibility. (Sat, 23 Jun 2012 11:06:47 GMT) (full text, mbox, link).


Notification sent to Luc Maisonobe <luc@spaceroots.org>:
Bug acknowledged by developer. (Sat, 23 Jun 2012 11:06:51 GMT) (full text, mbox, link).


Message #17 received at 678541-done@bugs.debian.org (full text, mbox, reply):

From: Vincent Bernat <bernat@debian.org>
To: 678541-done@bugs.debian.org
Cc: Luc Maisonobe <luc@spaceroots.org>
Subject: Re: Bug#678541: roundcube-pgsql: roundcube cannot connect to postgresql after purge and complete reinstall
Date: Sat, 23 Jun 2012 13:05:47 +0200
[Message part 1 (text/plain, inline)]
 ❦ 23 juin 2012 12:22 CEST, Vincent Bernat <bernat@debian.org> :

>> The problem appear after an upgrade from postgresql 8.x to 9.x and un
>> upgrade from roundcube 0.5.x to 0.7.x.  After upgrade, when I try to
>> load the rouncube web page from a brower, I get the error:
>>
>> DATABASE ERROR: CONNECTION FAILED!
>>
>> Unable to connect to the database!
>> Please contact your server-administrator.
>
> After some investigation, it appears that PostgreSQL now listens only on
> 5433 (SSL) while PHP is not aware of this change. Setting `$dbport` to
> `'5433'` solves the problem.
>
> I don't know the correct way to fix this. I don't think this should be
> fixed in roundcube. Either PHP should default to 5433 instead of 5432
> (like psql is doing right now) or dbconfig-common should default to
> 5433.
>
> I have filed a bug against php5-pgsql (#678626) about this. I am marking
> this bug as being blocked but the new bug in the mean time.

I have been told in #678626 that PostgreSQL is listening on 5433 only if
there is some other version already installed. This allows to run both
versions in parallel.

Therefore, you can:

 1. Reconfigure the appropriate PostgreSQL instance to listen on port
    5432 (I suppose that the previous version has been uninstalled).
 2. dpkg-reconfigure -plow roundcube-core and  specify 5433 as the port
    to use.
-- 
Make sure comments and code agree.
            - The Elements of Programming Style (Kernighan & Plauger)
[Message part 2 (application/pgp-signature, inline)]

No longer marked as found in versions roundcube/0.7.2-2. Request was from Vincent Bernat <bernat@debian.org> to control@bugs.debian.org. (Sat, 23 Jun 2012 12:36:39 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Debian Roundcube Maintainers <pkg-roundcube-maintainers@lists.alioth.debian.org>:
Bug#678541; Package roundcube. (Sat, 23 Jun 2012 12:42:13 GMT) (full text, mbox, link).


Acknowledgement sent to luc <luc@spaceroots.org>:
Extra info received and forwarded to list. Copy sent to Debian Roundcube Maintainers <pkg-roundcube-maintainers@lists.alioth.debian.org>. (Sat, 23 Jun 2012 12:42:13 GMT) (full text, mbox, link).


Message #24 received at 678541@bugs.debian.org (full text, mbox, reply):

From: luc <luc@spaceroots.org>
To: <678541@bugs.debian.org>
Subject: Re: Bug#678541 closed by Vincent Bernat <bernat@debian.org> (Re: Bug#678541: roundcube-pgsql: roundcube cannot connect to postgresql after purge and complete reinstall)
Date: Sat, 23 Jun 2012 14:41:25 +0200
Thanks a lot!

As you had guessed, the previous version of postgresql had been 
removed, hence port 5432 was not used anymore.
I have reconfigured the only remaining version of postgresql to listen 
to the default 5432 port instead of the
5433 port it was using (probably as part of the postgresql update). For 
the record, the configuration is in the file
/etc/postgresql/<version number>/main/postgresql.conf and requires 
restarting postgresql using the command "invoke-rc.d postgresql 
restart".

Roundcube can now connect properly (and I am using it to post the final 
message).

Thanks again for the very quick answer, and sorry for the noise.

Luc





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 22 Jul 2012 07:28:23 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Jul 2 02:24:36 2023; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.