Bug 332988 - crash during startup with postgres backend
Summary: crash during startup with postgres backend
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Unclassified
Component: server (show other bugs)
Version: GIT (master)
Platform: Compiled Sources Linux
: NOR major (vote)
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-02 23:00 UTC by SergTruf
Modified: 2014-05-06 15:25 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 1.12.2


Attachments
This patch fixes the crash during startup (689 bytes, patch)
2014-04-02 23:02 UTC, SergTruf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description SergTruf 2014-04-02 23:00:08 UTC
Crash during startup. Unable to start PSQl backend.

Reproducible: Always

Steps to Reproduce:
1. compile from master
2. choose PSQL backend
3. PROFIT!
Actual Results:  
Here is error log:
search paths:  ("/usr/local/bin", "/usr/bin", "/bin", "/opt/bin", "/usr/x86_64-pc-linux-gnu/gcc-bin/4.7.3", "/usr/lib64/opencascade-6.5/ros/lin/bin", "/usr/lib64/opencascade-6.6.0/ros/lin/bin", "/opt/nvidia-cg-toolkit/bin", "/usr/games/bin", "/opt/vmware/bin", "/usr/bin", "/usr/sbin", "/usr/local/sbin", "/usr/lib/postgresql/8.4/bin", "/usr/lib/postgresql/9.0/bin", "/usr/lib/postgresql/9.1/bin", "/usr/lib/postgresql/9.2/bin", "/usr/lib/postgresql/9.3/bin") 
Database process exited unexpectedly during initial connection!
executable: "/usr/bin/pg_ctl"
arguments: ("start", "-w", "--timeout=10", "--pgdata=/home/st/.local/share/akonadi/db_data", "-o "-k /home/st/.local/share/akonadi/socket-fj"")
stdout: "waiting for server to start....FATAL:  could not create lock file " /home/st/.local/share/akonadi/socket-fj/.s.PGSQL.5432.lock": No such file or directory
.... stopped waiting
"
stderr: "pg_ctl: could not start server
Examine the log output.
"
exit code: 1
process error: "Process operation timed out"
"[
0: akonadiserver(_Z11akBacktracev+0x34) [0x46b624]
1: akonadiserver() [0x46ba41]
2: /lib64/libc.so.6(+0x353f0) [0x7f97eb0793f0]
3: /lib64/libc.so.6(gsignal+0x35) [0x7f97eb079375]
4: /lib64/libc.so.6(abort+0x148) [0x7f97eb07a7f8]
5: /usr/lib64/qt4/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x95) [0x7f97ecaf5c18]
6: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0x9b) [0x46d9eb]
7: /usr/lib64/qt4/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0xdc) [0x7f97ecb5b89e]
8: /usr/lib64/qt4/libQtCore.so.4(+0xdb67a) [0x7f97ecb6067a]
9: /usr/lib64/qt4/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x3d) [0x7f97ecb63441]
10: akonadiserver(_ZN7Akonadi6Server18DbConfigPostgresql19startInternalServerEv+0x10fa) [0x51ad9a]
11: akonadiserver(_ZN7Akonadi6Server13AkonadiServer20startDatabaseProcessEv+0xc7) [0x46e627]
12: akonadiserver(_ZN7Akonadi6Server13AkonadiServer4initEv+0x9c) [0x47120c]
13: /usr/lib64/qt4/libQtCore.so.4(_ZN7QObject5eventEP6QEvent+0xc6) [0x7f97ecbad5d8]
14: /usr/lib64/qt4/libQtCore.so.4(_ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent+0x62) [0x7f97ecb9bb84]
15: /usr/lib64/qt4/libQtCore.so.4(_ZN23QCoreApplicationPrivate16sendPostedEventsEP7QObjectiP11QThreadData+0x18e) [0x7f97ecb9db72]
16: /usr/lib64/qt4/libQtCore.so.4(+0x1362b0) [0x7f97ecbbb2b0]
17: /usr/lib64/libglib-2.0.so.0(g_main_context_dispatch+0x135) [0x7f97ead66725]
18: /usr/lib64/libglib-2.0.so.0(+0x47a68) [0x7f97ead66a68]
19: /usr/lib64/libglib-2.0.so.0(g_main_context_iteration+0x34) [0x7f97ead66b24]
20: /usr/lib64/qt4/libQtCore.so.4(_ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE+0x69) [0x7f97ecbbb3e9]
21: /usr/lib64/qt4/libQtCore.so.4(_ZN10QEventLoop13processEventsE6QFlagsINS_17ProcessEventsFlagEE+0x45) [0x7f97ecb9ad15]
22: /usr/lib64/qt4/libQtCore.so.4(_ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE+0x108) [0x7f97ecb9aef8]
23: /usr/lib64/qt4/libQtCore.so.4(_ZN16QCoreApplication4execEv+0xae) [0x7f97ecb9e59a]
24: akonadiserver(main+0x1b3) [0x466293]
25: /lib64/libc.so.6(__libc_start_main+0xf5) [0x7f97eb065a55]
26: akonadiserver() [0x466a00]
]
"

Expected Results:  
akonadi starts

please see patch wich worked for me:

diff --git a/server/src/storage/dbconfigpostgresql.cpp b/server/src/storage/dbconfigpostgresql.cpp
index 10460d4..ed4785e 100644
--- a/server/src/storage/dbconfigpostgresql.cpp
+++ b/server/src/storage/dbconfigpostgresql.cpp
@@ -173,7 +173,7 @@ void DbConfigPostgresql::startInternalServer()
             << QString::fromLatin1( "--pgdata=%1" ).arg( mPgData )
             // set the directory for unix domain socket communication
             // -o will pass the switch to postgres
-            << QString::fromLatin1( "-o \"-k %1\"" ).arg( socketDir );
+            << QString::fromLatin1( "-o \"-k%1\"" ).arg( socketDir );
 
   QProcess pgCtl;
   pgCtl.start( mServerPath, arguments );
Comment 1 SergTruf 2014-04-02 23:02:03 UTC
Created attachment 85921 [details]
This patch fixes the crash during startup

Worked for me
Comment 2 Daniel Vrátil 2014-05-06 15:25:29 UTC
Git commit 74b2d3a43e19f5262ec84ccf609925eeb071d755 by Dan Vrátil.
Committed on 06/05/2014 at 14:49.
Pushed by dvratil into branch '1.12'.

Remove space from an argument passed to postgres server

Some users reported problem with starting PostgreSQL when there's a space
between name and value of an argument passed to postgres. Removing the
space fixes problem for them (withouth breaking PostgreSQL for those who
didn't have a problem with the space)

Thanks SergTruf for the patch.
FIXED-IN: 1.12.2

M  +1    -1    server/src/storage/dbconfigpostgresql.cpp

http://commits.kde.org/akonadi/74b2d3a43e19f5262ec84ccf609925eeb071d755