# KDE5 akonadi is not running ,wrong ownership on runtime directory



## rjohn (Sep 15, 2020)

Hello

just upgraded my freebsd 11.2 to 12.1 and kde4 to kde5,pkg upgraded etc.

when i try to start kmail or other apps that need akonadi i get the message that is not running

i tryed  :

```
freebsd# akonadictl start
D-Bus session bus is not available!
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = akonadictl path = /usr/local/bin pid = 41799
KCrash: Arguments: /usr/local/bin/akonadictl start
KCrash: Attempting to start /usr/local/lib/libexec/drkonqi
QStandardPaths: wrong ownership on runtime directory /var/run/user/1004, 1004 instead of 0
QStandardPaths: wrong ownership on runtime directory /var/run/user/1004, 1004 instead of 0
```

dbus is running
`freebsd# service dbus start         
dbus already running?  (pid=1019).`
i also tryed to stop it and start it same error

i guess the problem is something with : "wrong ownership on runtime directory /var/run/user/1004, 1004 instead of 0"

any idea how to fix it?


----------



## Mjölnir (Sep 15, 2020)

/var/run/user/<your-uid> should be owned and accessible only by you.
Which display manager do you have?  x11/sddm?
Standard disclaimer:

install the docs: `pkg install {de,en}-freebsd-doc`, replace _de_ with your native tongue, and point your favorite browser to /usr/local/share/doc/freebsd.
You can add to the _ALIAS_ section of /usr/local/etc/pkg.conf `message: "query '[%C/%n] %M'",`, read through all `pkg message|less` and apply the requested settings.
Instead of less(1), you may find sysutils/most more user-friendly. Beginners will prefer edit(1) or editors/nano instead of vi(1).


----------



## rjohn (Sep 16, 2020)

thanks for your reply it seems that i have the ownership of that folder :


```
freebsd# cd /var/run/user/
freebsd# ls
1004
freebsd# ls -l
total 4
drwx------  7 user  user  512 Sep 15 09:55 1004
```

yes i have installed the SDDM


----------



## Mjölnir (Sep 16, 2020)

I guess it's related to the upgrade from KDE4 to KDE5 and/or the display manager (sddm(1)).

From /usr/ports/UPDATING: _With Plasma 5.17 the startup script has been renamed. People who use the .xinitrc method to start Plasma have to call the new binary.
Previously: exec ck-launch-session startkde
Change to: exec ck-launch-session startplasma-x11_
Did you go through all `pkg message` & do as requested?
My 1st try would be to start KDE manually, without sddm(1): `service sddm disable` & `stop`, then `echo "exec ck-launch-session startplasma-x11" >>~/.xinitrc` & `startx`


----------



## T-Daemon (Sep 16, 2020)

You could try on a newly created user if starting the applications show the same error. I'm thinking of plasma5.x using different configuration files, directories, options.


----------



## rjohn (Sep 16, 2020)

i have read the messages from pkg and its about
`sysctl net.local.stream.recvspace=65536
sysctl net.local.stream.sendspace=65536` i have run the following commands since i installed kde5 BUT i saw that i have to run this command every time i boot,how i can make this permanent ?

pkg did not upgrade from kde4 to kde5 ,it removed complete kde4 and i installed later the kde5.

following those steps : 
My 1st try would be to start KDE manually, without sddm(1):  service sddm disable &  stop, then  echo "exec ck-launch-session startplasma-x11" >>~/.xinitrc &  startx

i got a KWIN crash msg

if i remember correct i did not touched the xinitrc for the kde4 


```
freebsd# cat xinitrc 
#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/usr/local/etc/X11/xinit/.Xresources
sysmodmap=/usr/local/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then







    xrdb -merge $sysresources

fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then







    xrdb -merge "$userresources"

fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

# start some nice programs

if [ -d /usr/local/etc/X11/xinit/xinitrc.d ] ; then
    for f in /usr/local/etc/X11/xinit/xinitrc.d/?*.sh ; do
        [ -x "$f" ] && . "$f"
    done
    unset f
fi

twm &
xclock -geometry 50x50-1+1 &
xterm -geometry 80x50+494+51 &
xterm -geometry 80x20+494-0 &
exec xterm -geometry 80x66+0+0 -name login
```

i will try later with new account and let you know,thank you both for your help!


----------



## Mjölnir (Sep 16, 2020)

rjohn said:


> i have read the messages from pkg and its about
> `sysctl net.local.stream.recvspace=65536
> sysctl net.local.stream.sendspace=65536` i have run the following commands since i installed kde5 BUT i saw that i have to run this command every time i boot,how i can make this permanent ?



Put that in sysctl.conf(5), e.g. `echo net.local.stream.recvspace=65536 >>/etc/sysctl.conf`.
Some other sysctl knobs can only be set @boot, these go into loader.conf(5) (or /boot/loader.conf.local if you like) and then the value must be inside double quotes.
If you use echo(1) to place settings into loader.conf(5) or rc.conf(5), don't forget to quote the quotes with a backslash like this: `echo net.local.stream.sendspace=\"65536\" >>/boot/loader.conf`.
To edit rc.conf(5), sysrc(8) is recommended, e.g. `sysrc kld_list+=" moduleX"`. You can also use sysrc(8) with the `-f  /boot/loader.conf` switch.
In general, the guideline is to only place into loader.conf(5) what is needed to boot or can only be set @boot, and put all other sysctl knobs into sysctl.conf(5) and other settings in rc.conf(5) (or rc.conf.local), e.g. `kld_list="module1 module2 ..."` or `kld_list="${kld_list} module9" # comment what module9 is needed for`.
EDIT I have `set     noclobber` in a global /etc/csh.cshrc to prevent myself from accidentally overwriting files with `echo x y z >file` when I forget an ">".



> My 1st try would be to start KDE manually, without sddm(1):  service sddm disable &  stop, then  echo "exec ck-launch-session startplasma-x11" >>~/.xinitrc &  startx
> 
> i got a KWIN crash msg [...]
> 
> ...


The KDE start scripts do all that resource setup themself.  Backup that file `mv ~/.xinitrc ~/.xinitrc.install` and have only

```
#!/bin/sh
exec ck-launch-session startplasma-x11
```
I don't know if the _shebang_ line (1st line) is necessary, neither if `chmod a+x ~/.xinitrc` is needed.


----------



## rjohn (Sep 17, 2020)

mjollnir editing /etc/sysctl.conf solved the :

sysctl net.local.stream.recvspace=65536
sysctl net.local.stream.sendspace=65536 problem,thanks.

after moding xinitrc it boots but same error





akonadi console error
*edit*
with new created user as T-Daemon suggested and it works! both users are wheel and operator members.


```
drwx------  7 user   user   512 Sep 17 09:53 1004
drwx------  7 user1  user1  512 Sep 17 09:48 1005
```
(user1 is the new)


----------



## Mjölnir (Sep 17, 2020)

Try running `akonadiselftest` from a terminal window.  You can click on an item to see the log file.  Follow the link to the KDE userbase wiki.
Consider to ask for help in a KDE forum.
The brute-force method would be to erase all Akonadi configs.  Unfortunately, they are splattered in various directories: `cd; find . -name 'akonadi*'`.  You may `rm -fr` these from a console, when KDE is not running.  Hopefully Akonadi will recreate them as needed.  But since you upgraded, this would erase all your setup like mail accounts etc., so it would be good to know which specific file or directory is the offending one & keep all others.


----------



## rjohn (Sep 18, 2020)

results of akonadiselftest : https://justpaste.it/2isce






thanks for the comments,will update later if i found any solution from the kde forum.


----------



## rjohn (Nov 9, 2020)

an update for this problem ,yet no solution found searched ,reddit,kde forum

updated to 12.2 fully update pkg

same error :  

```
No updates needed to update system to 12.2-RELEASE-p0.
freebsd# akonadictl     
D-Bus session bus is not available!
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = akonadictl path = /usr/local/bin pid = 2797
KCrash: Arguments: /usr/local/bin/akonadictl
KCrash: Attempting to start /usr/local/lib/libexec/drkonqi
QStandardPaths: wrong ownership on runtime directory /var/run/user/1004, 1004 instead of 0
QStandardPaths: wrong ownership on runtime directory /var/run/user/1004, 1004 instead of 0
MESA-LOADER: failed to retrieve device information
zsh: suspended (signal)  akonadictl
freebsd# org.kde.drkonqi: Killing running debugger instance
```


----------



## SirDice (Nov 9, 2020)

You're not supposed to run this as root, it's supposed to run on the user's account.


----------



## rjohn (Nov 9, 2020)

sorry wrong terminal copy paste ,i was trying root as well to see if it will work 
with normal account :

```
user@freebsd$ akonadictl start
org.kde.pim.akonadictl: Starting Akonadi Server...
org.kde.pim.akonadictl:    done.
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
user@freebsd$ org.kde.pim.akonadiserver: Starting up the Akonadi Server...
akonadi.collectionattributetable                   OK
akonadi.collectionmimetyperelation                 OK
akonadi.collectionpimitemrelation                  OK
akonadi.collectiontable                            OK
akonadi.flagtable                                  OK
akonadi.mimetypetable                              OK
akonadi.parttable                                  OK
akonadi.parttypetable                              OK
akonadi.pimitemflagrelation                        OK
akonadi.pimitemtable                               OK
akonadi.pimitemtagrelation                         OK
akonadi.relationtable                              OK
akonadi.relationtypetable                          OK
akonadi.resourcetable                              OK
akonadi.schemaversiontable                         OK
akonadi.tagattributetable                          OK
akonadi.tagremoteidresourcerelationtable           OK
akonadi.tagtable                                   OK
akonadi.tagtypetable                               OK
org.kde.pim.akonadiserver: Running DB initializer
org.kde.pim.akonadiserver: DB initializer done
org.kde.pim.akonadiserver: DBUpdater: query error: "Invalid default value for 'atime' QMYSQL: Unable to execute query" ""
org.kde.pim.akonadiserver: Query was:  "ALTER TABLE PimItemTable ROW_FORMAT=DYNAMIC"
org.kde.pim.akonadiserver: Target version was:  41
org.kde.pim.akonadiserver: Mandatory:  true
org.kde.pim.akonadiserver: DBUpdater: query error: "Invalid default value for 'atime' QMYSQL: Unable to execute query" ""
org.kde.pim.akonadiserver: Query was:  "ALTER TABLE PimItemTable MODIFY COLUMN remoteId VARBINARY(1024)"
org.kde.pim.akonadiserver: Target version was:  41
org.kde.pim.akonadiserver: Mandatory:  true
org.kde.pim.akonadiserver: Failed to commit transaction for database update
org.kde.pim.akonadiserver: Unable to initialize database.
org.kde.pim.akonadiserver: Shutting down AkonadiServer...
org.kde.pim.akonadicontrol: Application '/usr/local/bin/akonadiserver' exited normally...
```


----------



## SirDice (Nov 9, 2020)

Do you actually have a MySQL server running? Did you create the database correctly? And set the right permissions for the MySQL user?






						Akonadi and mysql 		• 		KDE Community Forums
					

hi so i'm trying out kmail but i'm having akonadi problems again i got mysql to work started a server via systemd without any errors and can start a mysql




					forum.kde.org


----------



## rjohn (Nov 10, 2020)

i have done nothing database related ,in kde4 i didnt had to do anything


```
freebsd# cat ~/.config/akonadi/akonadiserverrc
[%General]
Driver=QMYSQL

[QMYSQL]
Host=
Name=akonadi
Options="UNIX_SOCKET=/tmp/runtime-root/akonadi/mysql.socket"
ServerPath=/usr/local/libexec/mysqld
StartServer=true
You have new mail.
```

and the strange is that if i create a new user that user works fine.

is a specific version i have to install ?


```
mysql55-client-5.5.62_3        Multithreaded SQL database (client)
mysql55-server-5.5.62_3        Multithreaded SQL database (server)
mysql56-client-5.6.50          Multithreaded SQL database (client)
mysql56-server-5.6.50          Multithreaded SQL database (server)
mysql57-client-5.7.32          Multithreaded SQL database (client)
mysql57-server-5.7.32          Multithreaded SQL database (server)
mysql80-client-8.0.22          Multithreaded SQL database (client)
mysql80-server-8.0.22          Multithreaded SQL database (server)
```

this is installed in my system :

```
mysql57-client-5.7.32          Multithreaded SQL database (client)
mysql57-server-5.7.32          Multithreaded SQL database (server)
```

*edit*
saw this problem today dont know if its related : 


```
freebsd# pkg upgrade -f
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (1356 candidates):  15%
ruby23 has no direct installation candidates, change it to ruby? [Y/n]: y
Checking for upgrades (1356 candidates):  16%
quazip-qt4 has no direct installation candidates, change it to quazip-qt5? [Y/n]: y
Checking for upgrades (1356 candidates):  20%
python35 has no direct installation candidates, change it to python? [Y/n]: y
Checking for upgrades (1356 candidates):  75%
gtk12 has no direct installation candidates, change it to gtk2? [Y/n]: y
Checking for upgrades (1356 candidates):  82%
gcc6 has no direct installation candidates, change it to gcc? [Y/n]: y
Checking for upgrades (1356 candidates): 100%
Processing candidates (1356 candidates):   7%y
Processing candidates (1356 candidates): 100%
pkg: sqlite error while executing UPDATE packages SET name=?1  WHERE name=?2; in file pkg_jobs.c:1734: UNIQUE constraint failed: packages.name
pkg: sqlite error while executing UPDATE packages SET name=?1  WHERE name=?2; in file pkg_jobs.c:1734: UNIQUE constraint failed: packages.name
pkg: sqlite error while executing UPDATE packages SET name=?1  WHERE name=?2; in file pkg_jobs.c:1734: UNIQUE constraint failed: packages.name
pkg: sqlite error while executing UPDATE packages SET name=?1  WHERE name=?2; in file pkg_jobs.c:1734: UNIQUE constraint failed: packages.name
pkg: sqlite error while executing UPDATE packages SET name=?1  WHERE name=?2; in file pkg_jobs.c:1734: UNIQUE constraint failed: packages.name
Checking integrity...Assertion failed: (strcmp(uid, p->uid) != 0), function pkg_conflicts_check_local_path, file pkg_jobs_conflicts.c, line 386.
Child process pid=47872 terminated abnormally: Abort trap
```


----------

