This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Akonadi & postgresql

Tags: None
(comma "," separated)
skylendar
Registered Member
Posts
18
Karma
0
OS

Akonadi & postgresql

Tue Sep 06, 2011 1:31 pm
Hi all and thx for reading and possibly answering my post.

I'm using an external postgresql 9 server as the backend for akonadi. On the Akonaditray, the postgresql tab is correctly set, with database name, username and port number.
However, an internal postgres is fired when I click on 'start'. I had to manually edit ~/.config/akonadi/akonadiserverrc and to set StartServer=false and run akonadictl start, so that my external db is initialized.

How to tell Akonaditray to start and initialize the external server ?

Btw, akonadi doesn't work with postgres 9 when starting an internal server.

Thx again for answering.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Akonadi & postgresql

Thu Sep 08, 2011 6:59 am
I gather the external server is already started and running, with the needed user, password and database entered in? If so, then it should work fine. What error message does Akonadi give out when trying to start with an external PostgreSQL database?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
krop
KDE Developer
Posts
26
Karma
2
OS

Re: Akonadi & postgresql

Thu Sep 08, 2011 7:50 am
skylendar wrote:
Btw, akonadi doesn't work with postgres 9 when starting an internal server.



Make sure you use Qt >= 4.7.2. PSQL9 is not supported in older versions (see https://bugreports.qt.nokia.com/browse/QTBUG-14206)


skylendar
Registered Member
Posts
18
Karma
0
OS

Re: Akonadi & postgresql

Thu Sep 08, 2011 12:31 pm
Thx for answering.

Ok, I'm using Qt 4.7.1 from opensuse 11.4. When 12.1, things will be sorted out I think...

And of course postgres is running, with adequate user available etc...

When I click on 'start' on AkonadiTray for starting the server, even if Ideclared an external server, the internal server is fired instead, that stops because it is executed with -w and -t10 as the arguments, whereas pg 9.0 no longer supports them. This discrepancy is present even in akonadiserver 1.6.

But remember, when I declare StartServer=false in ~/.config/akonadi/akonadiserverrc, the correct external pg server is invoked. Nepomuk works.
krop
KDE Developer
Posts
26
Karma
2
OS

Re: Akonadi & postgresql

Thu Sep 08, 2011 1:01 pm
skylendar wrote:[...] the internal server is fired instead, that stops because it is executed with -w and -t10 as the arguments, whereas pg 9.0 no longer supports them. This discrepancy is present even in akonadiserver 1.6.


I'm not sure to understand. Postgres 9 accepts both parameters

Code: Select all
# pg_ctl --version
pg_ctl (PostgreSQL) 9.0.4


Code: Select all
# LANG=C pg_ctl --help |grep "\-t"
  pg_ctl start   [-w] [-t SECS] [-D DATADIR] [-s] [-l FILENAME] [-o "OPTIONS"]
  pg_ctl stop    [-W] [-t SECS] [-D DATADIR] [-s] [-m SHUTDOWN-MODE]
  pg_ctl restart [-w] [-t SECS] [-D DATADIR] [-s] [-m SHUTDOWN-MODE]
  -t SECS                seconds to wait when using -w option


skylendar
Registered Member
Posts
18
Karma
0
OS

Re: Akonadi & postgresql

Thu Sep 08, 2011 3:49 pm
No, akonadiserver uses the command 'postgres' not pg_ctl, and 'postgres' 9.0 doesn't accept the flags -w and -t any more
krop
KDE Developer
Posts
26
Karma
2
OS

Re: Akonadi & postgresql

Thu Sep 08, 2011 5:04 pm
skylendar wrote:No, akonadiserver uses the command 'postgres' not pg_ctl, and 'postgres' 9.0 doesn't accept the flags -w and -t any more


Sorry but this is incorrect, Akonadi uses pg_ctl since 01/2010.
(https://projects.kde.org/projects/kdesu ... ql.cpp#L73)


skylendar
Registered Member
Posts
18
Karma
0
OS

Re: Akonadi & postgresql

Thu Sep 08, 2011 10:04 pm
kde 4.6.0 seems to use akonadi 1.5.0. When I start akonadictl start with a non-existing local db, akonadictl complains that 'postgres -w -t10 -D ~/.local/share/akonadi/data_db start' failed due to the -w flag.
That being said, initdb doesn't support the -w flag either. So even if the latest akonadi uses
initdb instead of postgres, the issue remains.

But ok, problem solved if I use StartServer=false
krop
KDE Developer
Posts
26
Karma
2
OS

Re: Akonadi & postgresql

Thu Sep 08, 2011 10:27 pm
skylendar wrote:kde 4.6.0 seems to use akonadi 1.5.0. When I start akonadictl start with a non-existing local db, akonadictl complains that 'postgres -w -t10 -D ~/.local/share/akonadi/data_db start' failed due to the -w flag.


Akonadi 1.5.0 is only 8 months old and the file responsible for the database creation or the PSQL startup was the same as nowadays. the issue is with no doubt elsewhere.

Pasting the output of akonadictl restart when you encounter such error can usually give clues.

skylendar wrote:That being said, initdb doesn't support the -w flag either. So even if the latest akonadi uses
initdb instead of postgres, the issue remains.


When Akonadi runs initdb (ie: when the database doesn't exist yet), the -w flag is not used, only -D<data dir path> and --locale=en_US.UTF-8 are passed to initdb (lines 142/143 in the same file).


skylendar
Registered Member
Posts
18
Karma
0
OS

Re: Akonadi & postgresql

Fri Sep 09, 2011 4:37 pm
Starting Akonadi Server...
done.
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
search paths: ("/usr/lib64/mpi/gcc/openmpi/bin", "/usr/local/bin", "/usr/bin", "/bin", "/usr/bin/X11", "/usr/X11R6/bin", "/usr/games", "/usr/lib/mit/bin", "/usr/lib/mit/sbin", "/opt/libreoffice3.4/program", "/opt/libreoffice3.4/program", "/opt/libreoffice3.4/program", "/home/cg/bin", "/opt/libreoffice3.4/program", "/opt/libreoffice3.4/program", "/usr/sbin", "/usr/local/sbin", "/usr/lib/postgresql/8.4/bin")
Database process exited unexpectedly during initial connection!
executable: "/usr/bin/postgres"
arguments: ("-w", "-t10", "start", "-D/home/cg/.local/share/akonadi/db_data")
stdout: ""
stderr: "/usr/bin/postgres : option invalide -- 'w'
Essayez « postgres --help » pour plus d'informations.
"
exit code: 1
process error: "Unknown error"
"[
0: akonadiserver(_Z11akBacktracev+0x39) [0x44db59]
1: akonadiserver() [0x44e0c2]
2: /lib64/libc.so.6(+0x32b30) [0x7f2be265cb30]
3: /lib64/libc.so.6(gsignal+0x35) [0x7f2be265cab5]
4: /lib64/libc.so.6(abort+0x186) [0x7f2be265dfb6]
5: /usr/lib64/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x74) [0x7f2be432f8a4]
6: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0xab) [0x45038b]
7: /usr/lib64/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0x77) [0x7f2be43bc1b7]
8: /usr/lib64/libQtCore.so.4(+0x105536) [0x7f2be43c4536]
9: /usr/lib64/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x3b) [0x7f2be43cd41b]
10: akonadiserver(_ZN18DbConfigPostgresql19startInternalServerEv+0x14ec) [0x4dca7c]
11: akonadiserver(_ZN7Akonadi13AkonadiServer20startDatabaseProcessEv+0xd8) [0x450798]
12: akonadiserver() [0x453408]
13: akonadiserver(_ZN7Akonadi13AkonadiServer8instanceEv+0x35) [0x454a25]
14: akonadiserver(main+0x21f) [0x44850f]
15: /lib64/libc.so.6(__libc_start_main+0xfd) [0x7f2be2648bfd]
16: akonadiserver() [0x4481f9]
]
"
ProcessControl: Application 'akonadiserver' returned with exit code 255 (Unknown error)
search paths: ("/usr/lib64/mpi/gcc/openmpi/bin", "/usr/local/bin", "/usr/bin", "/bin", "/usr/bin/X11", "/usr/X11R6/bin", "/usr/games", "/usr/lib/mit/bin", "/usr/lib/mit/sbin", "/opt/libreoffice3.4/program", "/opt/libreoffice3.4/program", "/opt/libreoffice3.4/program", "/home/cg/bin", "/opt/libreoffice3.4/program", "/opt/libreoffice3.4/program", "/usr/sbin", "/usr/local/sbin", "/usr/lib/postgresql/8.4/bin")
Database process exited unexpectedly during initial connection!
executable: "/usr/bin/postgres"
arguments: ("-w", "-t10", "start", "-D/home/cg/.local/share/akonadi/db_data")
stdout: ""
stderr: "/usr/bin/postgres : option invalide -- 'w'
Essayez « postgres --help » pour plus d'informations.
"
exit code: 1
process error: "Unknown error"
"[
0: akonadiserver(_Z11akBacktracev+0x39) [0x44db59]
1: akonadiserver() [0x44e0c2]
2: /lib64/libc.so.6(+0x32b30) [0x7f803d709b30]
3: /lib64/libc.so.6(gsignal+0x35) [0x7f803d709ab5]
4: /lib64/libc.so.6(abort+0x186) [0x7f803d70afb6]
5: /usr/lib64/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x74) [0x7f803f3dc8a4]
6: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0xab) [0x45038b]
7: /usr/lib64/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0x77) [0x7f803f4691b7]
8: /usr/lib64/libQtCore.so.4(+0x105536) [0x7f803f471536]
9: /usr/lib64/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x3b) [0x7f803f47a41b]
10: akonadiserver(_ZN18DbConfigPostgresql19startInternalServerEv+0x14ec) [0x4dca7c]
11: akonadiserver(_ZN7Akonadi13AkonadiServer20startDatabaseProcessEv+0xd8) [0x450798]
12: akonadiserver() [0x453408]
13: akonadiserver(_ZN7Akonadi13AkonadiServer8instanceEv+0x35) [0x454a25]
14: akonadiserver(main+0x21f) [0x44850f]
15: /lib64/libc.so.6(__libc_start_main+0xfd) [0x7f803d6f5bfd]
16: akonadiserver() [0x4481f9]
]
"
ProcessControl: Application 'akonadiserver' returned with exit code 255 (Unknown error)
search paths: ("/usr/lib64/mpi/gcc/openmpi/bin", "/usr/local/bin", "/usr/bin", "/bin", "/usr/bin/X11", "/usr/X11R6/bin", "/usr/games", "/usr/lib/mit/bin", "/usr/lib/mit/sbin", "/opt/libreoffice3.4/program", "/opt/libreoffice3.4/program", "/opt/libreoffice3.4/program", "/home/cg/bin", "/opt/libreoffice3.4/program", "/opt/libreoffice3.4/program", "/usr/sbin", "/usr/local/sbin", "/usr/lib/postgresql/8.4/bin")
Database process exited unexpectedly during initial connection!
executable: "/usr/bin/postgres"
arguments: ("-w", "-t10", "start", "-D/home/cg/.local/share/akonadi/db_data")
stdout: ""
stderr: "/usr/bin/postgres : option invalide -- 'w'
Essayez « postgres --help » pour plus d'informations.
"
exit code: 1
process error: "Unknown error"
"[
0: akonadiserver(_Z11akBacktracev+0x39) [0x44db59]
1: akonadiserver() [0x44e0c2]
2: /lib64/libc.so.6(+0x32b30) [0x7fad113b6b30]
3: /lib64/libc.so.6(gsignal+0x35) [0x7fad113b6ab5]
4: /lib64/libc.so.6(abort+0x186) [0x7fad113b7fb6]
5: /usr/lib64/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x74) [0x7fad130898a4]
6: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0xab) [0x45038b]
7: /usr/lib64/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0x77) [0x7fad131161b7]
8: /usr/lib64/libQtCore.so.4(+0x105536) [0x7fad1311e536]
9: /usr/lib64/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x3b) [0x7fad1312741b]
10: akonadiserver(_ZN18DbConfigPostgresql19startInternalServerEv+0x14ec) [0x4dca7c]
11: akonadiserver(_ZN7Akonadi13AkonadiServer20startDatabaseProcessEv+0xd8) [0x450798]
12: akonadiserver() [0x453408]
13: akonadiserver(_ZN7Akonadi13AkonadiServer8instanceEv+0x35) [0x454a25]
14: akonadiserver(main+0x21f) [0x44850f]
15: /lib64/libc.so.6(__libc_start_main+0xfd) [0x7fad113a2bfd]
16: akonadiserver() [0x4481f9]
]
"
ProcessControl: Application 'akonadiserver' returned with exit code 255 (Unknown error)
search paths: ("/usr/lib64/mpi/gcc/openmpi/bin", "/usr/local/bin", "/usr/bin", "/bin", "/usr/bin/X11", "/usr/X11R6/bin", "/usr/games", "/usr/lib/mit/bin", "/usr/lib/mit/sbin", "/opt/libreoffice3.4/program", "/opt/libreoffice3.4/program", "/opt/libreoffice3.4/program", "/home/cg/bin", "/opt/libreoffice3.4/program", "/opt/libreoffice3.4/program", "/usr/sbin", "/usr/local/sbin", "/usr/lib/postgresql/8.4/bin")
Database process exited unexpectedly during initial connection!
executable: "/usr/bin/postgres"
arguments: ("-w", "-t10", "start", "-D/home/cg/.local/share/akonadi/db_data")
stdout: ""
stderr: "/usr/bin/postgres : option invalide -- 'w'
Essayez « postgres --help » pour plus d'informations.
"
exit code: 1
process error: "Unknown error"
"[
0: akonadiserver(_Z11akBacktracev+0x39) [0x44db59]
1: akonadiserver() [0x44e0c2]
2: /lib64/libc.so.6(+0x32b30) [0x7f525accab30]
3: /lib64/libc.so.6(gsignal+0x35) [0x7f525accaab5]
4: /lib64/libc.so.6(abort+0x186) [0x7f525accbfb6]
5: /usr/lib64/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x74) [0x7f525c99d8a4]
6: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0xab) [0x45038b]
7: /usr/lib64/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0x77) [0x7f525ca2a1b7]
8: /usr/lib64/libQtCore.so.4(+0x105536) [0x7f525ca32536]
9: /usr/lib64/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x3b) [0x7f525ca3b41b]
10: akonadiserver(_ZN18DbConfigPostgresql19startInternalServerEv+0x14ec) [0x4dca7c]
11: akonadiserver(_ZN7Akonadi13AkonadiServer20startDatabaseProcessEv+0xd8) [0x450798]
12: akonadiserver() [0x453408]
13: akonadiserver(_ZN7Akonadi13AkonadiServer8instanceEv+0x35) [0x454a25]
14: akonadiserver(main+0x21f) [0x44850f]
15: /lib64/libc.so.6(__libc_start_main+0xfd) [0x7f525acb6bfd]
16: akonadiserver() [0x4481f9]
]
"
ProcessControl: Application 'akonadiserver' returned with exit code 255 (Unknown error)
"akonadiserver" crashed too often and will not be restarted!
krop
KDE Developer
Posts
26
Karma
2
OS

Re: Akonadi & postgresql

Fri Sep 09, 2011 11:27 pm
sounds like the wrong executable is configured in ~/.config/akonadi/akonadiserverrc

open this file and make sure you have
Code: Select all
ServerPath=/usr/bin/pg_ctl
InitDbPath=/usr/bin/initdb


skylendar
Registered Member
Posts
18
Karma
0
OS

Re: Akonadi & postgresql

Sat Sep 10, 2011 12:39 pm
initdb doesn't support the -w and -t flags, either (on pg 9.0 I mean)
krop
KDE Developer
Posts
26
Karma
2
OS

Re: Akonadi & postgresql

Sat Sep 10, 2011 12:45 pm
skylendar wrote:initdb doesn't support the -w and -t flags, either (on pg 9.0 I mean)


Read viewtopic.php?f=20&t=96791&p=203637#p203545 again please.


skylendar
Registered Member
Posts
18
Karma
0
OS

Re: Akonadi & postgresql

Mon Sep 12, 2011 12:03 pm
I know I'm not up to date, but according to the latest avaiiable akonadi sources, in server/src/storage/dbconfigpostgresql.cpp, line 172, the server is still started with -w and -t10.

Could anyone check how behaves aknoadi 1.6 with postgres 9.0.x when a db is internally created ?
krop
KDE Developer
Posts
26
Karma
2
OS

Re: Akonadi & postgresql

Mon Sep 12, 2011 12:33 pm
skylendar wrote:I know I'm not up to date, but according to the latest avaiiable akonadi sources, in server/src/storage/dbconfigpostgresql.cpp, line 172, the server is still started with -w and -t10.


yes, pg_ctl is started with -w and -t10 (and -D<datadir> as well)




Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]