Announcement

Collapse
No announcement yet.

akonadi failed to connect

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] akonadi failed to connect

    I upgraded from 24.04 to 26.04 in order to keep settings and data and all

    I'm getting this message window when attempting to connect to Akonadi Console through Applications->Development->Akonadi Console

    Failed to connect to database: Can't connect to local MySQL server through socket 'run/user/1000/akonadi/mysql.socket' (2) QMYSQL: Unable to connect
    I then click OK, it brings the window back up, I click OK again and I'm taken to another window titled
    Xpian Error -- Akonadi Console
    which says

    DatabaseNotFoundError: Couldn't detect type of database
    in this window, the OK button is grayed out and I have to click the X in the upper right side to exit

    I then get another window titled
    Information -- Akonadi Console
    which states

    Akonadi Console is purely a development tool. It allows you to view and change internal data structures of Akonadi. You should only change data in here if you know what you are doing, otherwise you risk damaging or losing your personal information management data.
    Use at your own risk!
    clicking OK leads me to the main Akonadi Console window which states

    A required background service is not running. This application cannot be used without it.
    When I click Start it tries to start the personal information manager but then fails and states (with a big red square and X)

    A required background service is not operational.
    I think that if I solve my akonadi problem, I may solve my Kontact issues...
    Last edited by papapenguin; Yesterday, 06:19 PM. Reason: solved!

    #2
    Provided NOT as 'the' answer, but for review and possible solution(s).

    AI Overview



    This error indicates that Akonadi (the personal information management storage service for KDE/Kubuntu) is unable to communicate with its dedicated, internal MySQL/MariaDB database instance because the database engine isn't running or creating its socket file.
    Because Akonadi runs as a user service rather than a system-wide service, typical global MySQL commands (sudo service mysql restart) will not fix it.
    Here is how to troubleshoot and fix the connection failure:


    1. Check the detailed Akonadi Error Logs

    To see exactly why the underlying database failed to start, run this command in your terminal:

    akonadictl start

    Use code with caution.


    Watch the terminal output closely. Look for lines right before the Database process exited unexpectedly error. The most common causes are corrupted database log files or apparmor permission blocks.


    2. Fix Corrupted InnoDB Logs (Most Common)

    If the logs mention an error starting the database or an InnoDB crash, resetting the logs usually forces a clean recovery.
    • Stop any lingering Akonadi processes: bash

      akonadictl stop


      Use code with caution.
    • Navigate to your local Akonadi database directory: bash


      cd ~/.local/share/akonadi/db_data/


      Use code with caution.
    • Move or rename the old InnoDB log files so the system can regenerate them: bash

      mv ib_logfile0 ib_logfile0.bak mv ib_logfile1 ib_logfile1.bak


      Use code with caution.
    • Try restarting Akonadi: bash

      akonadictl start


      Use code with caution.
    3. Check AppArmor Restrictions

    Major upgrades in Kubuntu can sometimes break AppArmor profiles for Akonadi's internal MySQL instance, preventing it from executing files in /usr/sbin/ or writing to /run/user/.

    Check if AppArmor is blocking the connection by inspecting system logs:

    sudo dmesg | grep -i akonadi

    Use code with caution.


    If you see DENIED messages, you may need to temporarily set the Akonadi AppArmor profile to complain mode or update your apparmor-utils package:

    sudo apt install apparmor-utils sudo aa-complain /usr/sbin/mysqld-akonadi

    Use code with caution.


    4. Force a Local Database Upgrade

    If Kubuntu was recently upgraded, the underlying system database structure might be out of date.

    You can manually trigger an upgrade explicitly pointing to your local user socket file:

    mariadb-upgrade --socket=/run/user/1000/akonadi/mysql.socket

    Use code with caution.


    (Note: Depending on your system packages, this command might be named mysql_upgrade instead).




    ​
    Slava Ukraini! πŸ‡ΊπŸ‡¦
    Windows no longer obstruct my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes​

    Comment


      #3
      here are the results:
      donald@donald:~$ Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QStr ing,QString
      ,QString)
      qt.qpa.services: Failed to register with host portal QDBusError("org.freedesktop.portal.Error.Failed", "Could
      not register app ID: App info not found for 'org.kde.akonadi_control'")
      org.kde.pim.akonadiserver: Starting up the Akonadi Server...
      org.kde.pim.akonadiserver: database server stopped unexpectedly
      org.kde.pim.akonadiserver: Database process exited unexpectedly during initial connection!
      org.kde.pim.akonadiserver: executable: "/usr/sbin/mysqld"
      org.kde.pim.akonadiserver: arguments: QList("--defaults-file=/home/donald/.local/share/akonadi/mysql.conf", "-
      -datadir=/home/donald/.local/share/akonadi/db_data/", "--socket=/run/user/1000/akonadi/mysql.socket", "--pid-f
      ile=/run/user/1000/akonadi/mysql.pid")
      org.kde.pim.akonadiserver: stdout: ""
      org.kde.pim.akonadiserver: stderr: ""
      org.kde.pim.akonadiserver: exit code: 3
      org.kde.pim.akonadiserver: process error: "Unknown error"
      org.kde.pim.akonadiserver: See "/home/donald/.local/share/akonadi/db_data/mysql.err" for more details
      org.kde.pim.akonadiserver: Shutting down AkonadiServer...
      org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' exited normally...


      ​
      here's what's in /home/donald/.local/akonadi/db_data/mysql.err

      2026-09-16T20:57:05.673243Z 0 [System] [MY-015015] [Server] MySQL Server - start.
      2026-09-16T20:57:05.874414Z 0 [Warning] [MY-010097] [Server] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
      2026-09-16T20:57:05.874476Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.11-0ubuntu0.26.04.1) starting as process 26103
      2026-09-16T20:57:05.876698Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
      2026-09-16T20:57:05.876708Z 0 [Warning] [MY-013244] [Server] --collation-server: 'utf8mb3_general_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead.
      2026-09-16T20:57:05.886341Z 0 [Warning] [MY-013907] [InnoDB] Deprecated configuration parameters innodb_log_file_size and/or innodb_log_files_in_group have been used to compute innodb_redo_log_capacity=134217728. Please use innodb_redo_log_capacity instead.
      2026-09-16T20:57:05.887595Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
      2026-09-16T20:57:05.904834Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
      2026-09-16T20:57:05.904864Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
      2026-09-16T20:57:05.904872Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
      2026-09-16T20:57:05.904881Z 1 [ERROR] [MY-012646] [InnoDB] File ./ibdata1: 'open' returned OS error 71. Cannot continue operation
      2026-09-16T20:57:05.904889Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.​

      Comment


        #4
        there are no InnoDB log files in /home/donald/.local/akonadi/db_data/

        the only files in the folder are

        auto.cnf
        binlog.index
        mysql.err
        mysql.err.old

        Comment


          #5
          I installed some packages that may have pulled in databases before I installed Kontact and that could have caused the errors.

          I looked up 'remove akonadi configuration directory online, ran

          rm --recursive --force ~/.config/akonadi
          restarted akonadi with

          akonadictl start
          and now akonadi runs without complaint

          Comment

          Users Viewing This Topic

          Collapse

          There are 0 users viewing this topic.

          Working...
          X