Bug 503651

Summary: akonadi crash on startup unable to remove old log file, permission denied.
Product: [Frameworks and Libraries] Akonadi Reporter: John Veitch <john>
Component: generalAssignee: kdepim bugs <pim-bugs-null>
Status: REPORTED ---    
Severity: crash CC: carl
Priority: NOR    
Version First Reported In: 6.3.3   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description John Veitch 2025-05-02 09:02:53 UTC
SUMMARY

akonadi server crashes at startup, apparently because it is unable to remove ~/.local/share/akonadi/Akonadi.error.old. Even if I remove the directory containing this file and start afresh it still crashes (see below). I have permission to delete the old log file manually so I can't understand the cause of this error.

STEPS TO REPRODUCE
1. `rm ~/.local/share/akonadi`
2. `akonadictl start`
3. crash

OBSERVED RESULT
```
jveitch@hermes:~$ rm -r .local/share/akonadi
jveitch@hermes:~$ akonadictl start
org.kde.pim.akonadictl: Starting Akonadi Server...
org.kde.pim.akonadictl:    done.
jveitch@hermes:~$ Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
Cannot remove old log file '/home/jveitch/.local/share/akonadi/Akonadi.error.old': Permission denied
org.kde.pim.akonadicontrol: ProcessControl: Application "/usr/bin/akonadiserver" stopped unexpectedly ( "Process crashed" )
org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' crashed! 1 restarts left.
Cannot remove old log file '/home/jveitch/.local/share/akonadi/Akonadi.error.old': Permission denied
org.kde.pim.akonadicontrol: ProcessControl: Application "/usr/bin/akonadiserver" stopped unexpectedly ( "Process crashed" )
org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' crashed! 0 restarts left.
Cannot remove old log file '/home/jveitch/.local/share/akonadi/Akonadi.error.old': Permission denied
org.kde.pim.akonadicontrol: ProcessControl: Application "/usr/bin/akonadiserver" stopped unexpectedly ( "Process crashed" )
org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' crashed too often. Giving up!

jveitch@hermes:~$ ls -l .local/share/akonadi
total 8
-rw-r--r-- 1 jveitch staff 960 May  2 09:57 Akonadi.error
-rw-r--r-- 1 jveitch staff 140 May  2 09:57 Akonadi.error.old
jveitch@hermes:~$ cat .local/share/akonadi/*
2025-05-02T09:57:02 [WARN ] default: Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
2025-05-02T09:57:03 [WARN ] org.kde.pim.akonadicontrol: ProcessControl: Application "/usr/bin/akonadiserver" stopped unexpectedly ( "Process crashed" )
2025-05-02T09:57:03 [WARN ] org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' crashed! 1 restarts left.
2025-05-02T09:57:04 [WARN ] org.kde.pim.akonadicontrol: ProcessControl: Application "/usr/bin/akonadiserver" stopped unexpectedly ( "Process crashed" )
2025-05-02T09:57:04 [WARN ] org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' crashed! 0 restarts left.
2025-05-02T09:57:05 [WARN ] org.kde.pim.akonadicontrol: ProcessControl: Application "/usr/bin/akonadiserver" stopped unexpectedly ( "Process crashed" )
2025-05-02T09:57:05 [CRITICAL] org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' crashed too often. Giving up!
2025-05-02T09:57:02 [INFO ] org.kde.pim.akonadictl: Starting Akonadi Server...
2025-05-02T09:57:02 [INFO ] org.kde.pim.akonadictl:    done.
```

EXPECTED RESULT

akonadi server starts

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 25.04, kernel 6.14.0-15
KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.3

ADDITIONAL INFORMATION
I don't think it should matter but the directory ~/.local is a symlink from an NFS volume where $HOME is mounted to a local ext4 partition.