Akonadi: Difference between revisions

    From KDE UserBase Wiki
    (Added groupware tip)
    (misplaced dot)
    (82 intermediate revisions by 23 users not shown)
    Line 1: Line 1:
    {{Template:I18n/Language Navigation Bar|Akonadi}}
    <languages />
    <translate>


    ==Introduction==
    ==Introduction== <!--T:1-->
    This page is mainly concerned with troubleshooting Akonadi, as there are inevitable glitches in early stages of migration.  For many people the first signs of Akonadi activity will be in KDE SC 4.4, and many will be confused by it.  For a brief description of the purpose of Akonadi, see [[Glossary#Akonadi|this Glossary entry]].  You will also find useful links to further reading.  Once the inevitable teething troubles are over Akonadi will provide a power-house usable by many applications.


    == Troubleshooting Tips ==
    <!--T:2-->
    * When reporting problems with the Akonadi server, always include the comprehensive self-test report. This report can be obtained from the self-test dialog which shows up whenever the Akonadi server was unable to start successfully. You can find the selftest dialog in the kcmmodule that is accessable via 'kcmshell4 kcm_akonadi'.
    The '''Akonadi''' framework is responsible for providing applications with a centralized database to store, index and retrieve the user's personal information. This includes the user's emails, contacts, calendars, events, journals, alarms, notes, etc. In SC 4.4, [[Special:myLanguage/KAddressBook|KAddressBook]] became the first application to start using the '''Akonadi''' framework. In SC 4.7,
    [[Special:myLanguage/KMail|KMail]], [[Special:myLanguage/KOrganizer|KOrganizer]], [[Special:myLanguage/KJots|KJots]], etc. were updated to use '''Akonadi''' as well. In addition, several [[Special:myLanguage/Plasma|Plasma]] widgets also use '''Akonadi''' to store and retrieve calendar events, notes, etc.


    * Starting the Akonadi server manually on the command line can result in additional useful information. This can be done by running '''akonadictl start''' on a console. Similar, with '''akonadictl stop''' the Akonadi server can be stopped again. '''akonadictl status''' gives more useful information.
    <!--T:12-->
    At the time of writing, the following applications are enabled to use the '''Akonadi''' framework to centrally store and access user data. Follow through to each application's page to learn more.


    ==Common Problems==
    </translate><span id="ApplicationTable"></span><translate>
     
    </translate>
    ===Kontact doesn't start - and doesn't tell me anything===
    :{|
    If Kontact doesn't start, and you see no error messages, check that Akonadi is running.  Akonadi should start on demand, but currently (January 2010) it doesn't.  You have to start it before Kontact will start up if you have any migrated resources (most likely KAddressBook).  Use the AkonadiTray icon to start it.
    {{AppItem|KMail|<translate>
     
    <!--T:37-->
    ===Folder not found: "/Local"===
    View-pim-mail.png|
    Many people have reported this error, when Kontact would not start.  There seems to be a bug in the migration that is telling KMail to look for local mail in /home/anne/.local/share/Local, a directory that had not been set up.  The cure for this is not to attempt to correct it, but, with KMail/Kontact closed, to open the Akonadi Console (user krunner, Alt-F2, or 'akonadiconsole' in konsole), and remove the resource that it says is for local mail.  You should now find that you can start Kontact or KMail, and that a new resource will be created, pointing to /home/anne/.local/share/local-mail
    KMail</translate>}}<translate><!--T:38-->
     
    Mail Client
    ===There are other new folders under ~/.local/share/===
    Uses '''Akonadi''' to store emails
    Yes. If your addressbook has migrated correctly a new resource will have been created as ~/.local/share/contacts/
    </translate>
     
    |-
    ===What are /usr/bin/akonadi_maildir_resource and /usr/bin/akonadi_maildispatcher_agent?===
    {{AppItem|KAddressBook|<translate>
     
    <!--T:39-->
    The akonadi_maildir_resource is created automatically by the akonadi_maildispatcher_agent, while the latter is always started together with the Akonadi server as it provides basic functionality (e.g. sending mail) that is used by all mail applications that are (and will be) based on Akonadi. So it is ok that these two are running, as a user you can simply ignore them.
    View-pim-contacts.png|
    This autogenerated akonadi_maildir_resource will always point to ~/.local/share/local-mail/ which is your 'Local folders' account where your local folders and emails will be stored.
    KAddressBook</translate>}}<translate><!--T:40-->
     
    Contact Manager
    At this point, in KDE SC 4.4, mail is not yet being migrated.
    Uses '''Akonadi''' to store contact information
     
    </translate>
    ===Nepomuk Indexing Agents have been Disabled===
    |-
    Kontact is now working, but you keep seeing this notice:
    {{AppItem|KOrganizer|<translate>
     
    <!--T:41-->
    [[image:NepomukError.png|400px|center]]
    View-pim-calendar.png|
     
    KOrganizer</translate>}}<translate><!--T:42-->
    This happens after an update to SC 4.4 because there is a change to the database layout.  The following commands should get it working again.
    Personal Organizer
     
    Uses '''Akonadi''' to store calendars, events, journals, etc.
    {|style="width:98%; border:2px dotted #BCBCBC; background:#EEEEEE;"
    </translate>
    | qdbus org.kde.NepomukServer /nepomukserver org.kde.NepomukServer.quit
    |-
    |-
    | rm -r .kde/share/apps/nepomuk
    {{AppItem|KJots|<translate>
    <!--T:43-->
    kjots.png|
    KJots</translate>}}<translate><!--T:44-->
    Note Taking Application
    Uses '''Akonadi''' to store notes
    </translate>
    |-
    |-
    | nepomukserver
    {{AppItem|KAlarm|<translate>
    |}
    <!--T:49-->
     
    kalarm.png|
    ===I want to use my current Address Book and Organizer - Can I?===
    KAlarm</translate>}}<translate>
    Yes.  When you use the Akonadi Console to add a resource it allows you to choose as Standard Addressbook - point that to your std.vcf should work fine.  Migration does not destroy your old addressbook.  You can continue to use it, though you will lose any benefits that Akonadi can bring.  Alternatively you can have both an Akonadi addressbook and your original one, for a time, if you feel safer that way.
    <!--T:50-->
     
    Personal alarm scheduler
    ===I can't see any details in my Address Book===
    Uses '''Akonadi''' to store alarms
    At the moment, the cause of this is not identified, but the cure is simple.  Close Kontact, and start KAddressBook as a stand-alone application.  After you close it you will be able to use it within Kontact.  It seems that something is not being triggered when Kontact launches, and I expect this to be identified and fixed soon.
    </translate>
     
    |}<translate>
    ===How do I get my Groupware addressbook back?===
    In akonadiconsole, add a "KDE Address Book (traditional)". The KDE Address Book means you can set up old kresources for Akonadi.  In the configuration of "KDE Address Book (traditional)", you point it to an "IMAP over KMail" KResource
    and in KMail, the groupware options should be enabled.  This should work for Kolab, eGroupware and similar addressbooks.
     
    == Some Technical Issues ==
    === Nepomuk ===
    Starting with KDE 4.4, it is required that Nepomuk is running in order for Akonadi to work correctly. Akonadi will check this and display an error dialog on startup if this is not the case.
     
    Currently, ''Sesame2'' backend for Nepomuk is known to work, but if your distro carries the ''Virtuoso'' backend, you should use that.  The ''Redland'' backend is pathetically slow and can not be used. Sesame2 is Java-based. You can check whether the Nepomuk is running with the correct backend by using the Akonadi self-test dialog, as described above.
     
    If you have installed the Sesame2 backend, but it doesn't work, then you need to set up the correct environment variables.
    For me, adding ''/usr/lib64/jvm/java/jre/lib/amd64/server'' to ''LD_LIBRARY_PATH'' helped, but this varies depending on the distro and the architecture.
     
    === Apparmor ===
    Some distributions using Apparmor have it set up in a way that prevents Akonadi from running its internal database server. This can result in a variety of fuzzy error messages, including but not limited to the following:
    * unknown error 255 when running akonadictl
    * "DB error: 'Could not open required defaults file: /home/$username/.local/share/akonadi/mysql.conf"


    You can solve this by running '''aa-complain mysqld''' with root privileges then reload apparmor.
    On KUbuntu this is:
    sudo aa-complain mysqld
    sudo /etc/init.d/apparmor reload


    Note that you might be using Apparmor even if it does not show up in the process list.
    <!--T:14-->
    In addition to this, plasma widgets like the '''Digital Clock''' widget, the '''Notes''' widget also use '''Akonadi''' to store and retrieve events and notes.


    Also note that some distributions ship an additional ''mysqld'' binary called ''mysqld-akonadi'' which has AppArmor set up correctly. If that's the case on your system and you see this problem nevertheless, there are two possible reasons:
    ==Controlling the Akonadi server== <!--T:15-->
    * Akonadi still uses ''mysqld'' instead of ''mysqld-akonadi''. You can change that in Systemsettings -> Advanced -> Akonadi -> Server configuration.
    * AppArmor is not setup correctly for ''mysqld-akonadi'' either. Try running the ''aa-complain'' command noted above with ''mysqld-akonadi'' instead of ''mysqld''.


    ---
    <!--T:59-->
    The '''Akonadi''' control module started by the context menu of the '''Akonadi''' tray icon provides an easy means to starting, stopping, restarting and querying the status of the '''Akonadi''' server.  You may also accomplish this from the commandline using the command <code>akonadictl</code>. Using this method, you can get additional useful information on the console.


    You will also experience this problem if you are running an encrypted home directory using encryptfs combined with AppArmor as the Akonadi apparmor profile currently does not account for an ecrypted home (common with Ubuntu Jaunty users).  Error messages with include:
    <!--T:17-->
    * dmesg produces:
    To start the '''Akonadi''' server,
          ecryptfs_do_create: Failure to create dentry in lower fs; rc = [-13]
          ecryptfs_create: Failed to create file inlower filesystem
    * Akonadi will list the following errors:
          Akonadi server process not registered at D-Bus


    The fix is to edit the following file "/etc/apparmor.d/usr.sbin.mysqld-akonadi".
    <!--T:18-->
    Below the line:  
    {{Input|1=akonadictl start}}
          @{HOME}/.local/share/akonadi/** rwk,
    Add a new line:
          @{HOME}/.Private/** rwk,


    Restart apparmor and restart akonadi.
    <!--T:19-->
    To stop the '''Akonadi''' server,


    <!--T:20-->
    {{Input|1=akonadictl stop}}


    === Missing Prerequisite ===
    <!--T:21-->
    To use Akonadi you need to have the following packages installed (names might differ depending on your distribution):
    To restart a running '''Akonadi''' server,


    * The MySQL server (called ''mysql'' on OpenSuse)
    <!--T:22-->
    * The Qt4 MySQL plugin (called ''libqt4-sql-mysql'' on OpenSuse)
    {{Input|1=akonadictl restart}}


    If you compile Qt4 yourself, make sure to tell the ''configure'' script to build in MySQL support by passing it the '-plugin-sql-mysql' option.  If ''configure'' cannot locate the necessary MySQL client code (i.e, says "MySQL support cannot be enabled due to functionality tests") then ensure that the corresponding package is installed (typically called ''[lib]mysql[client]-dev[el]''). Also, depending on the install location of the MySQL headers, additional parameters to ''configure'' might be needed (eg. ''-I /usr/include/mysql'' on OpenSuse).
    <!--T:23-->
    To query the status of the '''Akonadi''' server,


    If you get the Qt4 direct from Nokia, such as a download of
    <!--T:24-->
      qt-sdk-linux-x86_64-opensource-2009.05.bin
    {{Input|1=akonadictl status}}


    you will ( by the command "akonadictl start") get an error at Test 1:
    ===Disabling the Akonadi subsystem=== <!--T:56-->
      ''Database driver not found.''
      ''Details: The QtSQL driver 'QMYSQL' is required by your current Akonadi server configuration.''
      ''The following drivers are installed: QSQLITE.''
      ''Make sure the required driver is installed.''


    The driver you need is ''libqsqlmysql.so''
    <!--T:57-->
    The '''Akonadi''' server is started by any '''Akonadi'''-enabled application. If you don't want Akonadi to be started after login, you have to ensure that no '''Akonadi'''-enabled application is launched at login or thereafter. Remember to check '''Plasma''' widgets as well — the '''Digital Clock''' widget in the default panel, for instance uses '''Akonadi''' to (optionally) display calendar events and this is enabled in its settings by default (see the "Display Events" option) . You must remove any widgets that may start it from your start-up, if you wish Akonadi to start only when you start '''KMail''' or other applications.


    Unfortunately this driver is not part of the distribution (until january 2010).
    You need to compile the source. Download it
      qt-everywhere-opensource-src-4.6.0.tar.bz


    ''configure'' and ''make'' as above. But the ''make install'' doesn't copy the driver. So you have to copy it by yourself:
    <!--T:26-->
      ''cp <qt-src-dir>/qt-everywhere-opensource-src-4.6.0/plugins/sqldrivers/libqsqlmysql.so /usr/local/bin/sqldrivers/ ''
    {{Remember|1=If you don't want to have '''Akonadi''' running on your system at all, you can not use any of the '''Akonadi'''-enabled applications. Such applications will not work when '''Akonadi''' is disabled using the steps below. See the list of [[Special:myLanguage/Akonadi#ApplicationTable|Akonadi-enabled applications]]. Also note, that some '''Plasma''' widgets, such as the '''Digital Clock''' uses '''Akonadi'''.}}


    '''But''' the Revision '''4.6.1''', such as qt-sdk-linux-x86_64-opensource-2010.xx.bin
    <!--T:27-->
    has the driver you needed.
    The '''Akonadi''' server is launched automatically at login whenever any '''Akonadi'''-enabled application requests access to it.
    === Environment Setup ===
    The Akonadi server searches for Akonadi agents and resources in the paths defined in the '''XDG_DATA_DIRS''' environment variable. If Akonadi complains about not finding agents or resources, check if this variable is set correctly. Also keep in mind that even if set in a current console session, it might not have been set when starting the server. Starting the server manually in the current console session excludes this cause.


    ===Table 'mysql. servers' doesn't exist===
    <!--T:28-->
    If MySQL server log contains the following error:
    To disable the '''Akonadi''' subsystem, shut down the running Akonadi server from the control module or the command line:
    <code>[ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
    [ERROR] Cannot open mysql.db
    [ERROR] Cannot open mysql.user
    [ERROR] Cannot open mysql.event</code>
    then, most probably, you don't have your MySQL configuration file in place. Copy it from ''/usr/share/config/akonadi/mysql-global.conf'' into ''~/.config/akonadi/mysql-local.conf''. (For debian and openSuSE users the file ist located in ''/etc/akonadi/mysql-global.conf''). Then open it and uncomment the line '''sql_mode=strict_trans_tables'''. If, after that, you get the following errors:
    <code>[ERROR] Plugin 'InnoDB' init function returned error.
    [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE
    failed.
    [ERROR] Unknown/unsupported table type: innodb
    [ERROR] Aborting</code>
    then in the same file find the line that starts just like the one above (which you have uncommented), but has additional parameters, separated by commas (something like '''sql_mode=strict_trans_tables,strict_all_tables, ...etc'''). Comment the shorter ''sql_mode=...'' line and uncomment the longer one.


    === Restarting after a previous error ===
    <!--T:29-->
    If you had problems starting Akonadi and fixed those (such as a missing package or the Apparmor problem) make sure that the Akonadi server is completely shut down before trying to start it again, by calling '''akonadictl stop''' on the command line. You can confirm that it was indeed shut down completely by running '''akonadictl status'''.
    {{Input|1=akonadictl stop}}


    Under some circumstances the Akonadi server can be stuck in a partially running state after a failure which will prevent the next attempt to start it to fail as well. Please file a bug report if you run into this problem including the self-test report of the initial problem.
    <!--T:58-->
    To ensure that Akonadi is not started, check that no applications require it at login. In particular, open the Plasma clock applet preferences, go to <menuchoice>Calendar</menuchoice> and uncheck <menuchoice>Show events</menuchoice> to prevent Plasma from requesting information from Akonadi and thus allowing it to start.


    === The so-called "Gentoo-Assert" ===
    ==Frequently Asked Questions== <!--T:34-->
    That's an especially nasty problem that so far only affects users of source-based distributions, most prominently Gentoo. It is named after MySQL assertions like the following example and is most likely caused by a MySQL protocol mismatch between the MySQL server and the client library or the Qt MySQL driver.


    <code>
    === Where is my data now? === <!--T:45-->
    akonadiserver: libmysql.c:4301: setup_one_fetch_function: Assertion `param->buffer_length != 0' failed.
    </code>


    It is extremely hard to diagnose as the assertion mentioned above are only triggered sometimes. Instead you'll get a wide range of weird symptoms:
    <!--T:46-->
    * ASAP protocol logs show successful creation of objects which are supposedly no longer available when the next commands accesses them again.
    A full explanation of where the data is stored and Akonadi's interaction with it is available in [http://blogs.kde.org/node/4503 Andras Mantia's blog]
    * SQL protocol logs show INSERT or UPDATE commands with values that mismatch the corresponding column types and nevertheless succeed.
    * SQL protocol logs showing large apparently random record ids which are nevertheless considered valid.


    References:
    === Migration problems === <!--T:47-->
    * http://forum.kde.org/viewtopic.php?f=20&t=61738
    * http://bugs.gentoo.org/show_bug.cgi?id=267513
    * https://bugs.kde.org/202623 (contains a possible solution)
    * http://bbs.archlinux.org/viewtopic.php?id=78358


    Possible solution: Rebuild the Qt MySQL driver after upgrading MySQL (which most likely caused this problem in the first place).
    <!--T:35-->
    '''Akonadi's''' [[Special:myLanguage/Glossary#Akonadi|Glossary entry]] has a brief description of its purpose and other useful links. [[Special:myLanguage/Akonadi_and_AddressBook|This]] page explains how '''Akonadi''' and '''KAddressBook''' work together.


    <!--T:9-->
    [[Category:System]]
    [[Category:System]]
    </translate>

    Revision as of 21:32, 11 February 2018

    Introduction

    The Akonadi framework is responsible for providing applications with a centralized database to store, index and retrieve the user's personal information. This includes the user's emails, contacts, calendars, events, journals, alarms, notes, etc. In SC 4.4, KAddressBook became the first application to start using the Akonadi framework. In SC 4.7, KMail, KOrganizer, KJots, etc. were updated to use Akonadi as well. In addition, several Plasma widgets also use Akonadi to store and retrieve calendar events, notes, etc.

    At the time of writing, the following applications are enabled to use the Akonadi framework to centrally store and access user data. Follow through to each application's page to learn more.

    KMail

    Mail Client

    Uses Akonadi to store emails

    KAddressBook

    Contact Manager

    Uses Akonadi to store contact information

    KOrganizer

    Personal Organizer

    Uses Akonadi to store calendars, events, journals, etc.

    KJots

    Note Taking Application

    Uses Akonadi to store notes

    KAlarm

    Personal alarm scheduler

    Uses Akonadi to store alarms

    In addition to this, plasma widgets like the Digital Clock widget, the Notes widget also use Akonadi to store and retrieve events and notes.

    Controlling the Akonadi server

    The Akonadi control module started by the context menu of the Akonadi tray icon provides an easy means to starting, stopping, restarting and querying the status of the Akonadi server. You may also accomplish this from the commandline using the command akonadictl. Using this method, you can get additional useful information on the console.

    To start the Akonadi server,

    akonadictl start

    To stop the Akonadi server,

    akonadictl stop

    To restart a running Akonadi server,

    akonadictl restart

    To query the status of the Akonadi server,

    akonadictl status

    Disabling the Akonadi subsystem

    The Akonadi server is started by any Akonadi-enabled application. If you don't want Akonadi to be started after login, you have to ensure that no Akonadi-enabled application is launched at login or thereafter. Remember to check Plasma widgets as well — the Digital Clock widget in the default panel, for instance uses Akonadi to (optionally) display calendar events and this is enabled in its settings by default (see the "Display Events" option) . You must remove any widgets that may start it from your start-up, if you wish Akonadi to start only when you start KMail or other applications.


    Remember

    If you don't want to have Akonadi running on your system at all, you can not use any of the Akonadi-enabled applications. Such applications will not work when Akonadi is disabled using the steps below. See the list of Akonadi-enabled applications. Also note, that some Plasma widgets, such as the Digital Clock uses Akonadi.


    The Akonadi server is launched automatically at login whenever any Akonadi-enabled application requests access to it.

    To disable the Akonadi subsystem, shut down the running Akonadi server from the control module or the command line:

    akonadictl stop

    To ensure that Akonadi is not started, check that no applications require it at login. In particular, open the Plasma clock applet preferences, go to Calendar and uncheck Show events to prevent Plasma from requesting information from Akonadi and thus allowing it to start.

    Frequently Asked Questions

    Where is my data now?

    A full explanation of where the data is stored and Akonadi's interaction with it is available in Andras Mantia's blog

    Migration problems

    Akonadi's Glossary entry has a brief description of its purpose and other useful links. This page explains how Akonadi and KAddressBook work together.