Bug 374636 - akonadi does not start after restore
Summary: akonadi does not start after restore
Status: REPORTED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.3.2
Platform: Other Linux
: NOR grave
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-06 14:43 UTC by Axel Braun
Modified: 2019-03-14 15:34 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
mysql error log (18.47 KB, text/plain)
2017-01-07 16:18 UTC, Axel Braun
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Axel Braun 2017-01-06 14:43:36 UTC
I had a HD failure, did a new installation of Leap 42.2 and restored the /home tree from a backup.
Akonadi does now refuse to start:
docb@T520:~> akonadiconsole
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
 void AdblockManager::reloadConfig() false    AdBlock::AdblockManager(0x2ab1db0)
log_akonadicore: Socket error occurred: "QLocalSocket::connectToServer: Invalid name"
log_akonadicore: Socket error occurred: "QLocalSocket::connectToServer: Invalid name"
org.kde.akonadi.ETM: GEN true true true
org.kde.akonadi.ETM: collection: QVector()
QSqlQuery::prepare: database not open
QSqlDatabasePrivate::removeDatabase: connection 'qt_sql_default_connection' is still in use, all queries will cease to work.
log_akonadiserver: Database process exited unexpectedly during initial connection!
log_akonadiserver: executable: "/usr/sbin/mysqld"
log_akonadiserver: arguments: ("--defaults-file=/home/docb/.local/share/akonadi/mysql.conf", "--datadir=/home/docb/.local/share/akonadi/db_data/", "--socket=/tmp/akonadi-docb.uL1G8Q/mysql.socket")
log_akonadiserver: stdout: ""
log_akonadiserver: stderr: "170106 15:35:40 [Note] /usr/sbin/mysqld (mysqld 10.0.28-MariaDB) starting as process 9072 ...\n"
log_akonadiserver: exit code: 1
log_akonadiserver: process error: "Unknown error"
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/akonadi-docb.uL1G8Q/mysql.socket' (2 "No such file or directory")'
Check that mysqld is running and that the socket: '/tmp/akonadi-docb.uL1G8Q/mysql.socket' exists!
log_akonadiserver: Failed to remove Unix socket
log_akonadiserver: Failed to remove runtime connection config file
log_akonadicontrol: Application 'akonadiserver' exited normally...
log_akonadicore: "Unbekannter Fehler."
log_akonadicore: Job error:  "Unbekannter Fehler." for collection: QVector() 

when I try to start mysql manually:
docb@T520:~> /usr/sbin/mysqld --defaults-file=/home/docb/.local/share/akonadi/mysql.conf --datadir=/home/docb/.local/share/akonadi/db_data/ --socket=/tmp/akonadi-docb.uL1G8Q/mysql.socket                                                                                                                          
170106 15:41:07 [Note] /usr/sbin/mysqld (mysqld 10.0.28-MariaDB) starting as process 9147 ...

-> seems to work.
Now lets try again:

docb@T520:~> akonadictl start
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
docb@T520:~> log_akonadiserver: Database process exited unexpectedly during initial connection!
log_akonadiserver: executable: "/usr/sbin/mysqld"
log_akonadiserver: arguments: ("--defaults-file=/home/docb/.local/share/akonadi/mysql.conf", "--datadir=/home/docb/.local/share/akonadi/db_data/", "--socket=/tmp/akonadi-docb.uL1G8Q/mysql.socket")
log_akonadiserver: stdout: ""
log_akonadiserver: stderr: "170106 15:41:26 [Note] /usr/sbin/mysqld (mysqld 10.0.28-MariaDB) starting as process 9174 ...\n"
log_akonadiserver: exit code: 1
log_akonadiserver: process error: "Unknown error"
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/akonadi-docb.uL1G8Q/mysql.socket' (2 "No such file or directory")'
Check that mysqld is running and that the socket: '/tmp/akonadi-docb.uL1G8Q/mysql.socket' exists!
log_akonadiserver: Failed to remove Unix socket
log_akonadiserver: Failed to remove runtime connection config file
log_akonadicontrol: Application 'akonadiserver' exited normally...

Does not start!
Any idea? Need to access my mails!
Comment 1 Daniel Vrátil 2017-01-06 21:52:13 UTC
> log_akonadiserver: stderr: "170106 15:35:40 [Note] /usr/sbin/mysqld (mysqld 10.0.28-MariaDB) starting as process 9072 ...\n"
> log_akonadiserver: exit code: 1

Looks like mysqld dies on start up. Maybe the database is corrupted? Can happen if you did the backup while MySQL was running and possibly changing and not fully flushing all the data files.


> docb@T520:~> /usr/sbin/mysqld --defaults-file=/home/docb/.local/share/akonadi/mysql.conf --datadir=/home/docb/.local/share/akonadi/db_data/ --socket=/tmp/akonadi-docb.uL1G8Q/mysql.socket                                                                                                                          
> 170106 15:41:07 [Note] /usr/sbin/mysqld (mysqld 10.0.28-MariaDB) starting as process 9147 ...

Does the mysqld process return immediately, or does it keep running? If it returns, then it mean it still crashed.
Comment 2 Axel Braun 2017-01-07 16:17:55 UTC
Yes, I could recover mysql in between by setting the parameter

[mysqld]
innodb_force_recovery = 3

in ~/.local/share/akonadi/mysql.conf. mysql error log is attached
In the recovery mode it is read only. so I shutted it down and tried a restart:

docb@T520:~> akonadictl stop
Akonadi is not running.

docb@T520:~> akonadictl start
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)

docb@T520:~> akonadictl status
Akonadi Control: stopped
Akonadi Server: stopped
Akonadi Server Search Support: available (Remote Search)
Available Agent Types: akonadi_akonotes_resource, akonadi_archivemail_agent, akonadi_birthdays_resource, akonadi_contacts_resource, akonadi_davgroupware_resource, akonadi_followupreminder_agent, akonadi_googlecalendar_resource, akonadi_googlecontacts_resource, akonadi_ical_resource, akonadi_icaldir_resource, akonadi_imap_resource, akonadi_indexing_agent, akonadi_invitations_agent, akonadi_kalarm_dir_resource, akonadi_kalarm_resource, akonadi_knut_resource, akonadi_kolab_resource, akonadi_maildir_resource, akonadi_maildispatcher_agent, akonadi_mailfilter_agent, akonadi_mbox_resource, akonadi_migration_agent, akonadi_mixedmaildir_resource, akonadi_newmailnotifier_agent, akonadi_notes_agent, akonadi_notes_resource, akonadi_openxchange_resource, akonadi_pop3_resource, akonadi_sendlater_agent, akonadi_tomboynotes_resource, akonadi_vcard_resource, akonadi_vcarddir_resource

docb@T520:~> akonadictl stop
Akonadi is not running.

docb@T520:~> akonadictl start --verbose
log_akonadicontrol: Unable to register service as "org.freedesktop.Akonadi.Control.lock" Maybe it's already running?
Error: akonadi_control was started but didn't register at D-Bus session bus.
Make sure your system is set up correctly!
docb@T520:~> log_akonadiserver: Failed to connect to database!
log_akonadiserver: Database error: "Can't connect to local MySQL server through socket '/tmp/akonadi-docb.rjb6l2/mysql.socket' (2 \"Datei oder Verzeichnis nicht gefunden\") QMYSQL: Unable to connect"
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/akonadi-docb.rjb6l2/mysql.socket' (2 "No such file or directory")'
Check that mysqld is running and that the socket: '/tmp/akonadi-docb.rjb6l2/mysql.socket' exists!
log_akonadicontrol: Application 'akonadiserver' exited normally...

So it still fails....
Comment 3 Axel Braun 2017-01-07 16:18:59 UTC
Created attachment 103267 [details]
mysql error log
Comment 4 Alexandr Zamaraev (aka Tonal) 2019-03-14 15:34:30 UTC
see also https://bugs.kde.org/show_bug.cgi?id=402680