Bug 299232 - Akonadi postgresql backends does not seem to use Host config option but tries to connect locally instead
Summary: Akonadi postgresql backends does not seem to use Host config option but tries...
Status: RESOLVED WORKSFORME
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-02 11:12 UTC by Martin Steigerwald
Modified: 2012-05-02 13:01 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Steigerwald 2012-05-02 11:12:59 UTC
When I configure Akonadi to use an external PostgreSQL server it tries to connect to localhost and fails.

Reproducible: Always

Steps to Reproduce:
1. Configure externel PostgreSQL server with user and database.

postgres@somedbhost:~$ createuser --pwprompt akonadimartinsteigerwald
Enter password for new role: 
Enter it again: 
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) n
postgres@somedbhost:~$ createdb akonadimartinsteigerwald -O akonadimartinsteigerwald


2. Configure Akonadi to use external database

ms@mango:~/.config/akonadi> cat akonadiserverrc
[%General]
Driver=QPSQL

[QPSQL]
Name=akonadimartinsteigerwald
Host=somedbhost.somedomain
User=akonadimartinsteigerwald
Password=[…]
StartServer=false
Options=

[Debug]
Tracer=null

3. akonadictl start
Actual Results:  
And I get - where 1.2.3.4 is the (changed) IP address of the localhost.

ms@mango:~/.config/akonadi#4> akonadictl start
Starting Akonadi Server...
   done.
ms@mango:~/.config/akonadi> Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
Failed to use database "akonadimartinsteigerwald" 
Database error: "FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL on
FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL off
QPSQL: Unable to connect" 
Trying to create database now... 
QSqlDatabasePrivate::removeDatabase: connection 'initConnection' is still in use, all queries will cease to work.
Database error: Cannot open database.
Last driver error: "QPSQL: Unable to connect"
Last database error: "FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL on
FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL off
"
Unable to open database "FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL on
FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL off
QPSQL: Unable to connect"
"[
0: akonadiserver() [0x805ba75]
1: akonadiserver() [0x805be2f]
2: [0xb7732400]
3: [0xb7732424]
4: /lib/i386-linux-gnu/i686/cmov/libc.so.6(gsignal+0x51) [0xb6e68941]
5: /lib/i386-linux-gnu/i686/cmov/libc.so.6(abort+0x182) [0xb6e6bd72]
6: /usr/lib/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x136) [0xb74c9506]
]
"
ProcessControl: Application 'akonadiserver' returned with exit code 255 (Unknown error)
Failed to use database "akonadimartinsteigerwald" 
Database error: "FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL on
FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL off
QPSQL: Unable to connect" 
Trying to create database now... 
QSqlDatabasePrivate::removeDatabase: connection 'initConnection' is still in use, all queries will cease to work.
Database error: Cannot open database.
Last driver error: "QPSQL: Unable to connect"
Last database error: "FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL on
FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL off
"
Unable to open database "FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL on
FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL off
QPSQL: Unable to connect"
"[
0: akonadiserver() [0x805ba75]
1: akonadiserver() [0x805be2f]
2: [0xb76ec400]
3: [0xb76ec424]
4: /lib/i386-linux-gnu/i686/cmov/libc.so.6(gsignal+0x51) [0xb6e22941]
5: /lib/i386-linux-gnu/i686/cmov/libc.so.6(abort+0x182) [0xb6e25d72]
6: /usr/lib/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x136) [0xb7483506]
]
"
ProcessControl: Application 'akonadiserver' returned with exit code 255 (Unknown error)
Failed to use database "akonadimartinsteigerwald" 
Database error: "FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL on
FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL off
QPSQL: Unable to connect" 
Trying to create database now... 
QSqlDatabasePrivate::removeDatabase: connection 'initConnection' is still in use, all queries will cease to work.
Database error: Cannot open database.
Last driver error: "QPSQL: Unable to connect"
Last database error: "FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL on
FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL off
"
Unable to open database "FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL on
FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL off
QPSQL: Unable to connect"
"[
0: akonadiserver() [0x805ba75]
1: akonadiserver() [0x805be2f]
2: [0xb76ea400]
3: [0xb76ea424]
4: /lib/i386-linux-gnu/i686/cmov/libc.so.6(gsignal+0x51) [0xb6e20941]
5: /lib/i386-linux-gnu/i686/cmov/libc.so.6(abort+0x182) [0xb6e23d72]
6: /usr/lib/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x136) [0xb7481506]
]
"
ProcessControl: Application 'akonadiserver' returned with exit code 255 (Unknown error)
Failed to use database "akonadimartinsteigerwald" 
Database error: "FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL on
FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL off
QPSQL: Unable to connect" 
Trying to create database now... 
QSqlDatabasePrivate::removeDatabase: connection 'initConnection' is still in use, all queries will cease to work.
Database error: Cannot open database.
Last driver error: "QPSQL: Unable to connect"
Last database error: "FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL on
FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL off
"
Unable to open database "FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL on
FATAL:  no pg_hba.conf entry for host "1.2.3.4", user "akonadimartinsteigerwald", database "akonadimartinsteigerwald", SSL off
QPSQL: Unable to connect"
"[
0: akonadiserver() [0x805ba75]
1: akonadiserver() [0x805be2f]
2: [0xb77ca400]
3: [0xb77ca424]
4: /lib/i386-linux-gnu/i686/cmov/libc.so.6(gsignal+0x51) [0xb6f00941]
5: /lib/i386-linux-gnu/i686/cmov/libc.so.6(abort+0x182) [0xb6f03d72]
6: /usr/lib/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x136) [0xb7561506]
]
"
ProcessControl: Application 'akonadiserver' returned with exit code 255 (Unknown error)
"akonadiserver" crashed too often and will not be restarted! 

Expected Results:  
Akonadi PostgreSQL backends tries to connect to our db host either successfully or it fails and tells me why.

Akonadi on client - KDE is at KDE SC 4.7.4 except for KDEPIM which is still 4.4.5:

ms@mango:~> apt-show-versions | egrep "akonadi"             
akonadi-backend-mysql/wheezy uptodate 1.6.2-2
akonadi-backend-postgresql/wheezy uptodate 1.6.2-2
akonadi-backend-sqlite/wheezy uptodate 1.6.2-2+b1
akonadi-server/wheezy uptodate 1.6.2-2+b1
akonadiconsole/wheezy uptodate 4:4.4.11.1+l10n-1
[…]
libakonadiprotocolinternals1/wheezy uptodate 1.6.2-2+b1


On the server:

somedbserver:~# dpkg -l | grep postgresql | cut -c1-65
ii  postgresql-8.4                      8.4.10-0squeeze1         
ii  postgresql-client-8.4               8.4.10-0squeeze1         
ii  postgresql-client-common            113                      
ii  postgresql-common                   113
Comment 1 Christophe Marin 2012-05-02 12:40:16 UTC
Sounds like a bad configuration of your external postgres server.

Check in pg_hba.conf.  "1.2.3.4" must be allowed to access the server
Comment 2 Martin Steigerwald 2012-05-02 13:01:38 UTC
Thats it. I misunderstand the log output.

Its working now.