Bug 468992 - Cannot start akonadi, FATAL ERROR: Upgrade failed
Summary: Cannot start akonadi, FATAL ERROR: Upgrade failed
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: libakonadi (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Carl Schwan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-26 09:48 UTC by Geoffrey Clements
Modified: 2023-04-30 11:00 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Self Test Output (11.76 KB, text/plain)
2023-04-26 09:48 UTC, Geoffrey Clements
Details
akonadictl start --verbose (2.64 KB, text/x-log)
2023-04-30 09:33 UTC, Christoph Vogtländer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Geoffrey Clements 2023-04-26 09:48:38 UTC
Created attachment 158441 [details]
Self Test Output

SUMMARY
Cannot start akonadi, first noticed when kmail refused to work because akonadi isn't running.


OBSERVED RESULT
Note that I have deleted ~/.local/share/akonadi to help in finding this bug, so the info below is from a clean database. Also, I have attached the output of the self test.

$ akonadictl start
org.kde.pim.akonadictl: Starting Akonadi Server...
org.kde.pim.akonadictl:    done.
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
org.kde.pim.akonadiserver: Starting up the Akonadi Server...
org.kde.pim.akonadiserver: mysqld for Akonadi is already running, trying to connect to it.
Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats                                 OK
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.event                                        OK
mysql.func                                         OK
mysql.global_priv                                  OK
mysql.gtid_slave_pos                               OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.index_stats                                  OK
mysql.innodb_index_stats                           OK
mysql.innodb_table_stats                           OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.proxies_priv                                 OK
mysql.roles_mapping                                OK
mysql.servers                                      OK
mysql.table_stats                                  OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.transaction_registry                         OK
Phase 2/7: Installing used storage engines... Skipped
Phase 3/7: Fixing views
mysql.user                                         OK
sys.host_summary                                   OK
sys.host_summary_by_file_io                        OK
sys.host_summary_by_file_io_type                   OK
sys.host_summary_by_stages                         OK
sys.host_summary_by_statement_latency              OK
sys.host_summary_by_statement_type                 OK
sys.innodb_buffer_stats_by_schema                  OK
sys.innodb_buffer_stats_by_table                   OK
sys.innodb_lock_waits                              OK
sys.io_by_thread_by_latency                        OK
sys.io_global_by_file_by_bytes                     OK
sys.io_global_by_file_by_latency                   OK
sys.io_global_by_wait_by_bytes                     OK
sys.io_global_by_wait_by_latency                   OK
sys.latest_file_io                                 OK
sys.memory_by_host_by_current_bytes                OK
sys.memory_by_thread_by_current_bytes              OK
sys.memory_by_user_by_current_bytes                OK
sys.memory_global_by_current_bytes                 OK
sys.memory_global_total                            OK
sys.metrics                                        OK
sys.processlist                                    OK
sys.ps_check_lost_instrumentation                  OK
sys.schema_auto_increment_columns                  OK
sys.schema_index_statistics                        OK
sys.schema_object_overview                         OK
sys.schema_redundant_indexes                       OK
sys.schema_table_lock_waits                        OK
sys.schema_table_statistics                        OK
sys.schema_table_statistics_with_buffer            OK
sys.schema_tables_with_full_table_scans            OK
sys.schema_unused_indexes                          OK
sys.session                                        OK
sys.session_ssl_status                             OK
sys.statement_analysis                             OK
sys.statements_with_errors_or_warnings             OK
sys.statements_with_full_table_scans               OK
sys.statements_with_runtimes_in_95th_percentile    OK
sys.statements_with_sorting                        OK
sys.statements_with_temp_tables                    OK
sys.user_summary                                   OK
sys.user_summary_by_file_io                        OK
sys.user_summary_by_file_io_type                   OK
sys.user_summary_by_stages                         OK
sys.user_summary_by_statement_latency              OK
sys.user_summary_by_statement_type                 OK
sys.version                                        OK
sys.wait_classes_global_by_avg_latency             OK
sys.wait_classes_global_by_latency                 OK
sys.waits_by_host_by_latency                       OK
sys.waits_by_user_by_latency                       OK
sys.waits_global_by_latency                        OK
sys.x$host_summary                                 OK
sys.x$host_summary_by_file_io                      OK
sys.x$host_summary_by_file_io_type                 OK
sys.x$host_summary_by_stages                       OK
sys.x$host_summary_by_statement_latency            OK
sys.x$host_summary_by_statement_type               OK
sys.x$innodb_buffer_stats_by_schema                OK
sys.x$innodb_buffer_stats_by_table                 OK
sys.x$innodb_lock_waits                            OK
sys.x$io_by_thread_by_latency                      OK
sys.x$io_global_by_file_by_bytes                   OK
sys.x$io_global_by_file_by_latency                 OK
sys.x$io_global_by_wait_by_bytes                   OK
sys.x$io_global_by_wait_by_latency                 OK
sys.x$latest_file_io                               OK
sys.x$memory_by_host_by_current_bytes              OK
sys.x$memory_by_thread_by_current_bytes            OK
sys.x$memory_by_user_by_current_bytes              OK
sys.x$memory_global_by_current_bytes               OK
sys.x$memory_global_total                          OK
sys.x$processlist                                  OK
sys.x$ps_digest_95th_percentile_by_avg_us          OK
sys.x$ps_digest_avg_latency_distribution           OK
sys.x$ps_schema_table_statistics_io                OK
sys.x$schema_flattened_keys                        OK
sys.x$schema_index_statistics                      OK
sys.x$schema_table_lock_waits                      OK
sys.x$schema_table_statistics                      OK
sys.x$schema_table_statistics_with_buffer          OK
sys.x$schema_tables_with_full_table_scans          OK
sys.x$session                                      OK
sys.x$statement_analysis                           OK
sys.x$statements_with_errors_or_warnings           OK
sys.x$statements_with_full_table_scans             OK
sys.x$statements_with_runtimes_in_95th_percentile  OK
sys.x$statements_with_sorting                      OK
sys.x$statements_with_temp_tables                  OK
sys.x$user_summary                                 OK
sys.x$user_summary_by_file_io                      OK
sys.x$user_summary_by_file_io_type                 OK
sys.x$user_summary_by_stages                       OK
sys.x$user_summary_by_statement_latency            OK
sys.x$user_summary_by_statement_type               OK
sys.x$wait_classes_global_by_avg_latency           OK
sys.x$wait_classes_global_by_latency               OK
sys.x$waits_by_host_by_latency                     OK
sys.x$waits_by_user_by_latency                     OK
sys.x$waits_global_by_latency                      OK
Phase 4/7: Running 'mysql_fix_privilege_tables'
ERROR 1 (HY000) at line 9: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 10: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 11: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 12: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 13: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 14: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 15: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 16: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 17: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 18: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 19: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 20: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 21: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 22: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 23: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 24: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 25: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 26: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 27: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 28: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 29: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 30: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 31: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 53: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 72: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 141: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 159: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 194: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 232: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 246: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 294: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
ERROR 1 (HY000) at line 361: Can't create/write to file '/home/geoff/.local/share/akonadi/db_data/mysql/#sql-alter-41e4-4f.MAI' (Errcode: 2 "No such file or directory")
FATAL ERROR: Upgrade failed
org.kde.pim.akonadiserver: Failed to create database
org.kde.pim.akonadiserver: Query error: "Access denied for user ''@'localhost' to database 'akonadi' QMYSQL: Unable to execute query"
org.kde.pim.akonadiserver: Database error: ""
org.kde.pim.akonadiserver: Shutting down AkonadiServer...
org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' exited normally...


SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.27
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.105.0
Qt Version: 5.15.9
Kernel Version: 5.19.0-41-generic (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-6700K CPU @ 4.00GHz
Memory: 15.6 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1050 Ti/PCIe/SSE2
Comment 1 Carl Schwan 2023-04-26 17:18:33 UTC
Hi,

This seems to be caused by a change I recently introduced. Could you run the following command: `mkdir -p '/home/geoff/.local/share/akonadi/db_data/mysql/` and see if this fixes the problem?
Comment 2 Geoffrey Clements 2023-04-26 18:38:43 UTC
Hi, thanks for looking into this, sadly no, this did not help see below:

geoff@Neon:~$ ls -R .local/share/akonadi/
.local/share/akonadi/:
Akonadi.error  Akonadi.error.old  db_data  db_misc  file_db_data  mysql.conf  socket-Neon-default

.local/share/akonadi/db_data:

.local/share/akonadi/db_misc:

.local/share/akonadi/file_db_data:
geoff@Neon:~$ mkdir -p .local/share/akonadi/db_data/mysql
geoff@Neon:~$ ls -R .local/share/akonadi/
.local/share/akonadi/:
Akonadi.error  Akonadi.error.old  db_data  db_misc  file_db_data  mysql.conf  socket-Neon-default

.local/share/akonadi/db_data:
mysql

.local/share/akonadi/db_data/mysql:

.local/share/akonadi/db_misc:

.local/share/akonadi/file_db_data:
geoff@Neon:~$ akonadictl start
org.kde.pim.akonadictl: Starting Akonadi Server...
org.kde.pim.akonadictl:    done.
geoff@Neon:~$ Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
org.kde.pim.akonadiserver: Starting up the Akonadi Server...
org.kde.pim.akonadiserver: mysqld for Akonadi is already running, trying to connect to it.
org.kde.pim.akonadiserver: Failed to connect to database!
org.kde.pim.akonadiserver: Database error: "Access denied for user 'geoff'@'localhost' (using password: NO) QMYSQL: Unable to connect"
org.kde.pim.akonadiserver: Shutting down AkonadiServer...
org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' exited normally...
Comment 3 Christoph Vogtländer 2023-04-30 09:33:22 UTC
Created attachment 158559 [details]
akonadictl start --verbose

I'm also experiencing this issue on arch after updating from 22.12.3 -> 23.04.0

"~/.local/share/akonadi/db_data/mysql" exists and my user has access rights.

Attached output of 
$ akonadictl start --verbose
Comment 4 Christoph Vogtländer 2023-04-30 09:41:06 UTC
After a reboot, the error went away for me and akonadi is able to connect to the DB again.
Comment 5 Geoffrey Clements 2023-04-30 10:59:44 UTC
Odd, I went through several reboots and still had the problem. Today it's working and I don't know why. I'll close the bug.