Bug 299483

Summary: akonadi crashes when ~/.local is a symlink
Product: [Frameworks and Libraries] Akonadi Reporter: tnemeth
Component: serverAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED NOT A BUG    
Severity: normal CC: caco3, dvratil, steingod
Priority: NOR    
Version: 4.8   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description tnemeth 2012-05-06 08:10:53 UTC
I had found I had no contact list in the address book at startup. It happened to be because
of ~/.local was a symlink and akonadi could not start. When I moved the real directory into
place, akonadi could start.

Reproducible: Always

Steps to Reproduce:
1. akonadictl stop (or just after a clean installation)
2. mv ~/.local /somewhere/else/on/your/drive
3. ln -s /somewhere/else/on/your/drive/.local
4. akonatictl start
Actual Results:  
akonadi could not start : 

Test 15:  ERROR
--------

Current Akonadi server error log found.
Details: The Akonadi server reported errors during its current startup. The log can be found in <a href='/home/thomas/.local/share/akonadi/akonadiserver.error'>/home/thomas/.local/share/akonadi/akonadiserver.error</a>.

File content of '/home/thomas/.local/share/akonadi/akonadiserver.error':
Database process exited unexpectedly during initial connection! 
executable: "/usr/sbin/mysqld-akonadi" 
arguments: ("--defaults-file=/home/thomas/.local/share/akonadi/mysql.conf", "--datadir=/home/thomas/.local/share/akonadi/db_data/", "--socket=/home/thomas/.local/share/akonadi/socket-cixi/mysql.socket") 
stdout: "" 
stderr: "Could not open required defaults file: /home/thomas/.local/share/akonadi/mysql.conf
Fatal error in defaults handling. Program aborted
" 
exit code: 1 
process error: "Unknown error" 
"[
0: akonadiserver() [0x805d566]
1: akonadiserver() [0x805d821]
2: [0xb7745400]
3: [0xb7745424]
4: /lib/i386-linux-gnu/libc.so.6(gsignal+0x4f) [0xb6e1b1ef]
5: /lib/i386-linux-gnu/libc.so.6(abort+0x175) [0xb6e1e835]
6: /usr/lib/i386-linux-gnu/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x136) [0xb74ac616]
7: akonadiserver() [0x805f9d8]
8: /usr/lib/i386-linux-gnu/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0xc9) [0xb7555e59]
9: /usr/lib/i386-linux-gnu/libQtCore.so.4(+0x112c7d) [0xb7562c7d]
10: /usr/lib/i386-linux-gnu/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x3e) [0xb756c7ce]
11: akonadiserver() [0x8056b35]
12: akonadiserver() [0x80ea505]
13: akonadiserver() [0x80607c9]
14: akonadiserver() [0x8061f51]
15: akonadiserver() [0x8063716]
16: akonadiserver() [0x8055fe0]
17: /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0xb6e064d3]
18: akonadiserver() [0x80569d1]
]
" 


Expected Results:  
Akonadi should have starter normaly
Comment 1 ØysteinG 2012-09-11 20:30:19 UTC
I have the same problem on 4.8.4. Although I did not try to put .local as a symbolic links but the akonadi subdirectory (or even parts of it) to avoid duplication of email archives within the backup area of my system (as email are stored on a IMAP server anyway).

However, I do not know whether there is another way around this problem using configuration files pointing at different directory. This is a showstopper for me...
Comment 2 Myriam Schweingruber 2012-09-12 08:09:03 UTC
Setting status to confirmed.
Comment 3 Daniel Vrátil 2012-12-14 16:16:47 UTC
This is a MySQL error message, not Akonadi. 

If you use AppArmor or SELinux, make sure they are not preventing the MySQL process from accessing the file.
Comment 4 Daniel Vrátil 2013-12-06 16:37:28 UTC
Is this problem still valid? Have you tried to check the AppArmor settings?
Comment 5 CaCO3 2014-05-01 22:01:20 UTC
This issue is still present on Kubuntu 14.04.

I tried to move and symlink my home folder by folder to a new disk.
When moving/symlinking .local/share/akonadi, akonadi (and specifically kmail) failed to work.
This is very nasty and should be fixed urgently!

I am using:
Qt: 4.8.6
KDE Development Platform: 4.13.0
Akonadi Console: 0.99
Comment 6 Daniel Vrátil 2014-05-02 09:01:52 UTC
As I said, if you can access the file manually, but MySQL can't, then there's a problem in MySQL, not in Akonadi.

You can either try to bring this up on MySQL forums, or you can try using PostgreSQL or SQLite backends (don't use SQLite if you have KMail with large folders, unless you use Akonadi from git).

Closing as INVALID as this is clearly not an Akonadi issue, sorry.