Solved Korganizer and Kmail=Akonadi and Mysql don't start!!

Good evening gentlemen,

I fresh install freeBSD 13 Release with binary package with KDE.

I have problem with this program and need your help.
I try to find solution in internet but is too hard for me to find the right solution.


HERE THE PROBLEM:

saverik@Amd:/usr/home/saverik $ akonadictl start
org.kde.pim.akonadictl: Starting Akonadi Server...
org.kde.pim.akonadictl: done.
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
saverik@Amd:/usr/home/saverik $ org.kde.pim.akonadiserver: Starting up the Akonadi Server...

saverik@Amd:/usr/home/saverik $ akonadictl status
Akonadi Control: stopped
Akonadi Server: stopped
Akonadi Server Search Support: available (Remote Search, Akonadi Search Plugin)
Available Agent Types: akonadi_akonotes_resource, akonadi_archivemail_agent, akonadi_birthdays_resource, akonadi_contacts_resource, akonadi_davgroupware_resource, akonadi_ews_resource, akonadi_
ewsmta_resource, akonadi_followupreminder_agent, akonadi_google_resource, akonadi_ical_resource, akonadi_icaldir_resource, akonadi_imap_resource, akonadi_indexing_agent, akonadi_kalarm_dir_reso
urce, akonadi_kalarm_resource, akonadi_knut_resource, akonadi_kolab_resource, akonadi_maildir_resource, akonadi_maildispatcher_agent, akonadi_mailfilter_agent, akonadi_mailmerge_agent, akonadi_
mbox_resource, akonadi_migration_agent, akonadi_mixedmaildir_resource, akonadi_newmailnotifier_agent, akonadi_notes_resource, akonadi_openxchange_resource, akonadi_pop3_resource, akonadi_sendla
ter_agent, akonadi_tomboynotes_resource, akonadi_unifiedmailbox_agent, akonadi_vcard_resource, akonadi_vcarddir_resource
saverik@Amd:/usr/home/saverik $ org.kde.pim.akonadiserver: Failed to connect to database!
org.kde.pim.akonadiserver: Database error: "Can't connect to local MySQL server through socket '/var/run/user/1001/akonadi/mysql.socket' (2) QMYSQL: Unable to connect"
org.kde.pim.akonadiserver: Shutting down AkonadiServer...
org.kde.pim.akonadicontrol: Application '/usr/local/bin/akonadiserver' exited normally...

Thank you and greetings
 
Last edited:
and this is my /etc/rc.conf :

wlans_run0="wlan0"
ifconfig_wlan0="WPA DHCP"
create_args_wlan0="country IT regdomain ETSI"
ifconfig_re0="DHCP"
ifconfig_re0_ipv6="inet6 accept_rtadv"
sshd_enable="YES"
moused_enable="YES"
ntpdate_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
kld_list="amdgpu"
dbus_enable="YES"
sddm_enable="YES"
 
Disclaimer: I know nothing about Korganizer, Kmail or Akonadi. But assuming MySQL/MariaDB is still an independent component, then I think the below is still valid:

I think you probably want to have a line such as below in your /etc/rc.conf:
mysql_enable="YES"
Or you can get that line inserted with:
sysrc mysql_enable=YES

Assuming MySQL/MariaDB is actually installed, is it running?
service mysql-server status
If not:
service mysql-server start

akonadiserver seems to expect your MySQL socket file to exist in a non-standard location - /var/run/user/1001/akonadi/mysql.socket. It might be worth checking that the MySQL config files agree with this. Look for the socket parameter(s) in your *.cnf files under /usr/local/etc/mysql/ and modify as appropriate, then restart MySQL:
service mysql-server restart
 
I had restart the system :
/etc/rc.conf:

hostname="Amd.5600x@org"
keymap="it.kbd"
wlans_run0="wlan0"
ifconfig_wlan0="WPA DHCP"
create_args_wlan0="country IT regdomain ETSI"
ifconfig_re0="DHCP"
ifconfig_re0_ipv6="inet6 accept_rtadv"
sshd_enable="YES"
moused_enable="YES"
ntpdate_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
kld_list="amdgpu"
dbus_enable="YES"
sddm_enable="YES"
mysql_enable="YES"


/usr/local/etc/mysql/my.cnf



[client]
port = 3306
#socket = /tmp/mysql.sock
socket =/var/run/user/1001/akonadi/mysql.socket

[mysql]
prompt = \u@\h [\d]>\_
no_auto_rehash

[mysqld]
user = mysql
port = 3306
#socket = /tmp/mysql.sock
socket =/var/run/user/1001/akonadi/mysql.socket
bind-address = 127.0.0.1
basedir = /usr/local
datadir = /var/db/mysql
tmpdir = /var/db/mysql_tmpdir
slave-load-tmpdir = /var/db/mysql_tmpdir
secure-file-priv = /var/db/mysql_secure
log-bin = mysql-bin
log-output = TABLE
master-info-repository = TABLE
relay-log-info-repository = TABLE
relay-log-recovery = 1
slow-query-log = 1
server-id = 1
sync_binlog = 1
sync_relay_log = 1
binlog_cache_size = 16M
expire_logs_days = 30
default_password_lifetime = 0
enforce-gtid-consistency = 1
gtid-mode = ON
safe-user-create = 1
lower_case_table_names = 1
explicit-defaults-for-timestamp = 1
myisam-recover-options = BACKUP,FORCE
open_files_limit = 32768
table_open_cache = 16384
table_definition_cache = 8192
net_retry_count = 16384
key_buffer_size = 256M
max_allowed_packet = 64M
query_cache_type = 0
query_cache_size = 0
long_query_time = 0.5

the system shows

saverik@Amd:~ $ service mysql-server status
mysql is not running.
saverik@Amd:~ $ service mysql-server start
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql
saverik@Amd:~ $
 
the system shows
saverik@Amd:~ $ service mysql-server status
mysql is not running.
saverik@Amd:~ $ service mysql-server start
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql
saverik@Amd:~ $
Searching the web for that error message seems to suggest it's a problem with permissions or wrong user. Maybe it's the permissions on your tmpdir (/var/db/mysql_tmpdir)? I think that should probably have the same ownership and permissions as your datadir (/var/db/mysql).

You can read about others with the same/similar problem e.g. here - see that last post for their solution (but I think they have a different tmpdir to you):

Also this stackoverflow question and answers:

If you don't mind losing your data, you can try this "nuclear option" / solution (substitute mysql with mariadb if that is what you're really using, run mysql -V to find out):
 
service mysql-server stop
#rm -rf /var/db/mysql/*
#chown mysql:mysql /var/db/mysql
#service mysql-server start

root@Amd:/usr/local/etc/mysql #
root@Amd:/usr/local/etc/mysql # service mysql-server status
mysql is not running.
root@Amd:/usr/local/etc/mysql #

the nuke is not enough!!!
And now???
 
the nuke is not enough!!!
And now???
Did you do pkg delete ... and pkg install ... as well, as shown in Langille's blog? mysql-server definitely won't start if its datadir has been wiped, but if you re-install the package, then the datadir should be created and populated correctly.
 
I seen when system is booting that is clearing the /tmp at boot..

now :
saverik@Amd:/usr/home/saverik $ service mysql-server status
eval: cannot open /var/db/mysql/Amd.5600x@org.pid: Permission denied
mysql is not running.
saverik@Amd:/usr/home/saverik $ cd /var/db/mysql/
saverik@Amd:/var/db/mysql $ ls
Amd-slow.log ca.pem ib_logfile1 mysql-bin.000002 mysql-bin.index server-key.pem
Amd.5600x@org.err client-cert.pem ibdata1 mysql-bin.000003 performance_schema sys
Amd.5600x@org.pid client-key.pem ibtmp1 mysql-bin.000004 private_key.pem
auto.cnf ib_buffer_pool mysql mysql-bin.000005 public_key.pem
ca-key.pem ib_logfile0 mysql-bin.000001 mysql-bin.000006 server-cert.pem
saverik@Amd:/var/db/mysql $ service mysql-server start
eval: cannot open /var/db/mysql/Amd.5600x@org.pid: Permission denied
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql
saverik@Amd:/var/db/mysql $
 
saverik@Amd:/var/run $ service mysql-server status
eval: cannot open /var/db/mysql/Amd.5600x@org.pid: Permission denied
mysql is not running.
saverik@Amd:/var/run $ service mysql-server start
eval: cannot open /var/db/mysql/Amd.5600x@org.pid: Permission denied
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql
saverik@Amd:/var/run $
 
saverik@Amd:/var/run $ service mysql-server status
eval: cannot open /var/db/mysql/Amd.5600x@org.pid: Permission denied
mysql is not running.
saverik@Amd:/var/run $ service mysql-server start
eval: cannot open /var/db/mysql/Amd.5600x@org.pid: Permission denied
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql
saverik@Amd:/var/run $
 
saverik@Amd:/var/run $ service mysql-server status
eval: cannot open /var/db/mysql/Amd.5600x@org.pid: Permission denied
mysql is not running.
saverik@Amd:/var/run $ service mysql-server start
eval: cannot open /var/db/mysql/Amd.5600x@org.pid: Permission denied
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql
saverik@Amd:/var/run $
 
I have modified the /usr/local/etc/mysql/my.cnf: (before was /tmp/mysql.sock)

[client]
port = 3306
socket = /tmp/mysql.socket

[mysql]
prompt = \u@\h [\d]>\_
no_auto_rehash

[mysqld]
user = mysql
port = 3306
socket = /tmp/mysql.socket
bind-address = 127.0.0.1
basedir = /usr/local
datadir = /var/db/mysql
tmpdir = /var/db/mysql_tmpdir
slave-load-tmpdir = /var/db/mysql_tmpdir
secure-file-priv = /var/db/mysql_secure

and :
saverik@Amd:/usr/home/saverik $ service mysql-server status
eval: cannot open /var/db/mysql/Amd.5600x@org.com.pid: Permission denied
mysql is not running.
saverik@Amd:/usr/home/saverik $ service mysql-server start
eval: cannot open /var/db/mysql/Amd.5600x@org.com.pid: Permission denied
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql
saverik@Amd:/usr/home/saverik $ service mysql-server status
eval: cannot open /var/db/mysql/Amd.5600x@org.com.pid: Permission denied
mysql is not running.
saverik@Amd:/usr/home/saverik $ su
Password:
root@Amd:/usr/home/saverik # service mysql-server status
mysql is running as pid 2424.
root@Amd:/usr/home/saverik #
 
You need to run service mysql-server status as root. For example:
Code:
len@plasma:/usr/home/len $ service mysql-server status
eval: cannot open /var/db/mysql/plasma.pid: Permission denied
mysql is not running.
len@plasma:/usr/home/len $ su -
Password:
root@plasma:~ # service mysql-server status
mysql is running as pid 4192.
root@plasma:~ #

In /usr/local/etc/mysql/my.cnf, socket =/var/run/user/1001/akonadi/mysql.socket is wrong. Change it back to socket = /tmp/mysql.sock .

In /etc/rc.conf you have hostname="Amd.5600x@org" - I don't think the "@" character is permissible. If you really need to specify your domain name in this way, it needs to be a fully qualified domain name, as per this reference: https://en.wikipedia.org/wiki/Fully_qualified_domain_name - or you could just specify hostname="amd" instead.


Edited to add: I can't get akonadi to start either. There is a bug report: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248929 and there has been quite a bit of discussion about it: https://duckduckgo.com/?q=akonadi+freebsd+crash&t=newext&atb=v277-1&ia=web
 
saverik@Amd5600x:~ $ service mysql-server status
eval: cannot open /var/db/mysql/Amd5600x.pid: Permission denied
mysql is not running.
saverik@Amd5600x:~ $ service mysql-server status
eval: cannot open /var/db/mysql/Amd5600x.pid: Permission denied
mysql is not running.
saverik@Amd5600x:~ $ service mysql-server start
eval: cannot open /var/db/mysql/Amd5600x.pid: Permission denied
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql
saverik@Amd5600x:~ $ su
Password:
root@Amd5600x:/home/saverik # service mysql-server status
mysql is running as pid 2427.
root@Amd5600x:/home/saverik #
root@Amd5600x:/home/saverik #
root@Amd5600x:/home/saverik # freebsd-version -kru
13.0-RELEASE
13.0-RELEASE
13.0-RELEASE
root@Amd5600x:/home/saverik # pkg -vv | grep url
url : "pkg+http://pkg.FreeBSD.org/FreeBSD:13:amd64/quarterly",

hostname="Amd5600x"
keymap="it.kbd"
wlans_run0="wlan0"
ifconfig_wlan0="WPA DHCP"
create_args_wlan0="country IT regdomain ETSI"
ifconfig_re0="DHCP"
ifconfig_re0_ipv6="inet6 accept_rtadv"
sshd_enable="YES"
moused_enable="YES"
ntpdate_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
kld_list="amdgpu"
dbus_enable="YES"
sddm_enable="YES"
mysql_enable="YES"

[client]
port = 3306
socket = /tmp/mysql.sock

[mysql]
prompt = \u@\h [\d]>\_
no_auto_rehash

[mysqld]
user = mysql
port = 3306
socket = /tmp/mysql.sock
bind-address = 127.0.0.1
basedir = /usr/local
datadir = /var/db/mysql
tmpdir = /var/db/mysql_tmpdir
slave-load-tmpdir = /var/db/mysql_tmpdir
secure-file-priv = /var/db/mysql_secure
log-bin = mysql-bin
log-output = TABLE
master-info-repository = TABLE
relay-log-info-repository = TABLE
 
This port is deprecated; you may wish to reconsider installing it:

Uses EOL Python 2.7 via www/qt5-webengine.

It is scheduled to be removed on or after 2021-06-23.
=====
Message from korganizer-21.04.3:

--
===> NOTICE:

This port is deprecated; you may wish to reconsider installing it:

Uses EOL Python 2.7 via www/qt5-webengine.
could be this the problem?????????
 
could be this the problem?????????
From reading the bug report I got the impression that the problem was with the mysql57-server version. Makes little difference to me because I don't use this kind of functionality anyway, but they mentioned a patch for it which might be of interest to you.
 
Code:
…
root@Amd5600x:/home/saverik # freebsd-version -kru
13.0-RELEASE
13.0-RELEASE
13.0-RELEASE
root@Amd5600x:/home/saverik # pkg -vv | grep url
   url             : "pkg+http://pkg.FreeBSD.org/FreeBSD:13:amd64/quarterly",
…

Thanks.

grep -i mysql /etc/group && sudo grep -i mysql /etc/master.passwd

Does the user exist?

Update your system, upgrade ports/packages, then recheck that the user exists. freebsd-update(8) in 13.0-RELEASE was bugged in a way that sometimes caused disappearance of users such as mysql

If there remain symptoms of a bug: wonder whether it's fixed in latest but not yet in quarterly.
 
saverik@Amd5600x:~ $ org.kde.pim.akonadiserver: Starting up the Akonadi Server...
org.kde.pim.akonadiserver: Failed to connect to database!
org.kde.pim.akonadiserver: Database error: "Can't connect to local MySQL server through socket '/var/run/user/1001/akonadi/mysql.socket' (2) QMYSQL: Unable
to connect"
org.kde.pim.akonadiserver: Shutting down AkonadiServer...
org.kde.pim.akonadicontrol: Application '/usr/local/bin/akonadiserver' exited normally...
 
saverik@Amd5600x:~ $ grep -i mysql /etc/group && grep -i mysql /etc/master.passwd
mysql:*:88:
grep: /etc/master.passwd: Permission denied
saverik@Amd5600x:~ $ su
Password:
root@Amd5600x:/home/saverik # grep -i mysql /etc/group && grep -i mysql /etc/master.passwd
mysql:*:88:
mysql:*:88:88::0:0:MySQL Daemon:/var/db/mysql:/usr/sbin/nologin
root@Amd5600x:/home/saverik #
 
please help me to update... I use all binary package!!!!

pkg update -f is ok or there are better solution?
 
root@Amd5600x:/home/saverik # pkg update -f
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100% 163 B 0.2kB/s 00:01
Fetching packagesite.txz: 100% 6 MiB 2.2MB/s 00:03
Processing entries: 100%
FreeBSD repository update completed. 30742 packages processed.
All repositories are up to date.
root@Amd5600x:/home/saverik #
 
Back
Top