Archive:Http://userbase.kde.org/Akonadi 4.4/Troubleshooting/pl

From KDE UserBase Wiki
Revision as of 21:16, 16 August 2010 by Neverendingo (talk | contribs) (Importing a new version from external source)

Wprowadzenie

Ta strona w dużej mierze dotyczy rozwiązywania problemów z Akonadi, ponieważ na tym etapie jego rozwoju nietrudno napotkać się na błąd. Wielu ludzi po raz pierwszy spotkało się z Akonadi w KDE SC 4.4 i było dla nich nowością. Krótkie wprowadzenie do Akonadi znajduje się na stronie terminy wyrazów. Znajdują się tam także różne użyteczne odnośniki. Docelowo Akonadi będzie wykorzystywane przez wiele aplikacji.

===Struktura=== \

Oczywiście można używać aplikacji Kontact zarządzając książkami adresowymi, ale w przypadku posiadania jakiegoś system kopii zapasowej, warto wiedzieć gdzie znajdują się dane i jak są zarządzane. Strona Akonadi i książka adresowa może okazać się pomocna.

Rozwiązywanie problemów

  • Zgłaszając problemy z serwerem Akonadi należy dołączać pełny raport testowy. Można go zapisać korzystając z okna dialogowego, które pojawia się w momencie problemów z uruchomieniem serwera. Moduł konfiguracyjny Akonadi można uruchomić następującym poleceniem:
kcmshell4 kcm_akonadi
  • Dodatkowe informacje o stanie serwera Akonadi można uzyskać uruchamiając polecenie:
akonadictl start

Similarly, with this command the Akonadi server can be stopped again:

akonadictl stop

This command gives more useful information:

akonadictl status

Najczęstsze problemy

Kontact nie uruchamia się, nie informując dlaczego

Jeżeli Kontact nie uruchamia się, ale nie pojawia się żadna informacja o błędzie, należy sprawdź czy uruchomione jest Akonadi. Akonadi powinien uruchomić się na żądanie. Jeżeli tak się nie dzieje, należy uruchomić go przed aplikacją Kontact, jeśli są dodane jakieś zasoby (głównie chodzi o KAddressBook). Akonadi można uruchomić klikając ikonę w tacce systemowej uprzednio wpisując polecenie akonadi w KRunner lub konsoli.

Kontact nie uruchamia się - 2. przypadek

Znane są problemy z uruchamianiem aplikacji Kontact po przeprowadzonej aktualizacji. Jeżeli tak się dzieje można spróbować uruchomić z KRunnera lub konsoli KMaila, KOrganizera lub inną aplikację wchodzącą w skład pakietu PIM . Są szanse, że będą one działać jako samodzielne aplikacje. Problemy głównie dotyczą wersji 4.4.0.

Folder not found: "/Local"

Znane są przypadki nie uruchamiającej się aplikacji Kontact. We wczesnych wersjach 4.4 występuje błąd podczas migracji. KMail szuka lokalnej poczty w ~/.local/share/Local, który nie jest jeszcze utworzony. Rozwiązaniem je zamknięcie KMaila/Kontacta i uruchomienie Konsoli Akonadi:*Użyj Krunnera (Alt-F2) lub

  • Konsoli i wpisz akonadikonsole

Then 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 ~/.local/share/local-mail

W ~/.local/share znajdują się inne foldery

Tak. Jeżeli proces migracji książki adresowej przebiegł pomyślnie, zostanie stworzony nowy zasób jako ~/.local/share/contacts/

Czym są /usr/bin/akonadi_maildir_resource oraz /usr/bin/akonadi_maildispatcher_agent?

akonadi_maildir_resource jest tworzony automatycznie przez akonadi_maildispatcher_agent. Z kolei ten drugi jest uruchamiany wraz z serwerem Akonadi ponieważ udostępnia podstawową funkcjonalność (np. wysyłanie e-maili) wykorzystywaną przez wszystkie klienty pocztowe, które korzystają i będą korzystać z Akonadi. Jako użytkownik możesz je zignorować. Automatycznie wygenerowany akonadi_maildir_resource zawsze będzie wskazywał na ~/.local/share/local-mail który zawiera lokalne foldery i e-maile.

W tym punkcie w KDE SC 4.4 poczta jeszcze nie jest przeniesiona.

Agent indeksowania Nepomuka został wyłączony

Kontact działa, ale pojawia się wiadomość:

Prawdopodobnie Nepomuk jest wyłączony w Ustawieniach Systemowych. Spróbuj włączyć go w zakładce Zaawansowane -> Wyszukiwanie na pulpicie -> Podstawowe ustawienia zaznaczając opcję Włącz pulpit semantyczny Nepomuk i klikając Zastosuj.

Jeśli to nie pomoże (lub jeżeli opcja była już zaznaczona) a wcześniej używana była wersja KDE starsza niż 4.4', może występować błąd związany ze zmianą w bazie danych (z powodu aktualizacji serwera baz danych Virtuoso z wersji 5. do 6.; KDE SC 4.4 używa Virtuoso w wersji 6.) Następujące polecenie powinno pomóc:

qdbus org.kde.NepomukServer /nepomukserver org.kde.NepomukServer.quit

rm -r ~/.kde/share/apps/nepomuk rm -r ~/.kde4/share/apps/nepomuk

nepomukserver

Note that the above commands will not enable Nepomuk permanently if it isn't already enabled, you have to use System Settings for that.

Kontact wymaga działającego Akonadi, a ten Nepomuka. Można jednak wyłączyć moduł indeksowania Strigi, który nie jest wymagany przez Kontact.

W aplikacji Kontact, Nepomuk jest używany do wielu czynności: od wyświetlenia nadchodzących urodzin, przez zarządzanie listami wolny/zajęty do pokazywania zdjęcia kontaktu w podglądzie wiadomości. Jeżeli Nepomuk nie jest uruchomiony, niektóre funkcje programu Kontact nie będą działać. Ostrzegamy zatem przed ograniczoną funkcjonalnością. Aktywowanie Nepomuka w sposób pokazany wyżej pozwala uniknąć tych problemów.

W celu sprawdzenia poprawności działania Nepomuka należy wpisać:

akonadictl status

Chcę używać mojej obecnej książki adresowej i organizera - mogę?

Tak. Dodając nowy zasób w Konsoli Akonadi można wybrać Standardową książkę adresową - wskazując na plik std.vcf. Migracja nie uszkodzi starej książki. Można jej w dalszym ciągu używać, jednak nie odnosząc korzyści jakie niesie ze sobą Akonadi. Warto dodać, że można korzystać zarówno z książki adresowej Akonadi i standardowej.

Nie widzę żadnych szczegółów w książce adresowej

W tym momencie przyczyna problemu nie jest znana, ale rozwiązanie proste. Trzeba zamknąć Kontact i uruchomić KAdressBook jako samodzielną aplikację. Następnie zamknąć ją i już można używać ją w aplikacji Kontact. Prawdopodobnie coś nie jest uruchamiane podczas wczytywania programu. Mamy nadzieję, że wkrótce się pojawi odpowiednia poprawka. Błąd dotyczy głównie wersji 4.4.0.

Moje kontakty się nie pojawiają kiedy używam przycisku Zaznacz w KMail

Należy wybrać kolejno Ustawienia systemowe -> Zaawansowane --> Zasoby KDE. Książka adresowa korzystająca z Akonadi powinna tam się znajdować - w przeciwnym razie należy ją dodać. Warto ustawić książkę adresową Akonadi na domyślną. Więcej na ten temat się znajduje na tej stronie.

Jak mogę przywrócić moją książkę adresową do pracy grupowej?

Są dwa rozwiązania: użycie starej lub nowej technologii.

Rozwiązanie pierwsze: po wpisaniu polecenia akonadiconsole, w oknie dialogowym dodać Książkę adresową KDE. Oznacza ona, że można używać starego kresources dla Akonadi. W konfiguracji, która się pojawiała wybrać pozycję Książka adresowa na serwerze IMAP za pośrednictwem KMail. Następnie należy uaktywnić w opcjach klienta KMail pracę grupową. Powinna ona działać dla Kolaba, eGroupware i podobnych książek adresowych - trzeba zaznaczyć odpowiednią opcję.

Rozwiązanie drugie: nowy framework (testowane tylko z Kolabem): w module konfiguracji Akonadi należy dodać zasób Serwer IMAP; wpisać nazwę serwera, nazwę użytkownika i hasło. Następnie kliknąć przycisk Wykryj automatycznie. Poniższe polecenie otwiera okno konfiguracji:

kcmshell4 kcm_akonadi

Then add a Kolab resource. The next step is to wait for the imap resource to synchronize, which can take quite a long time. The status will appear in the Akonadi configuration module. If nothing happens, try restarting akonadiserver. After some time the Kolab addressbook(s) should appear in KAddressBook.

Długi czas oczekiwania podczas wysyłania wiadomości e-mail

Towarzyszy temu zawieszenie się programu KMail do czasu wysłania wiadomości.

Błąd powodował sposób w jaki Nepomuk sprawdza adresy, co mogło wywołać duże opóźnienia. Naprawiono go w KDE SC 4.4.1. Jeżeli w jakiś sposób użytkownik nie może zainstalować wersji 4.4.1, można skorzystać z następującego obejścia problemu:

Zamknąć Kontact lub KMail i KAdressBook jeżeli są uruchomione jako osobne aplikacje; wyłączyć Strigi w Ustawieniach systemowych; zatrzymać Nepomuka, usunąć bazę danych i ponownie uruchomić nepomukserver. Należy uruchomić następujące polecenia (jako użytkownik):

qdbus org.kde.NepomukServer /nepomukserver org.kde.NepomukServer.quit

rm -r ~/.kde/share/apps/nepomuk rm -r ~/.kde4/share/apps/nepomuk

nepomukserver

Powyższa operacja usuwa całą bazę danych, jak również tagi, które zostały dodane. Teoretycznie możliwe jest bardziej wybiórcze usuwanie. Jeżeli jest to istotne warto zajrzeć do instrukcji na tej stronie.

IMAP Resource always claims to be offline

Even though the system has an internet connection, the IMAP resource refuses to switch to online state.

This bug is caused by a misconfigured NetworkManager installation on your system. Check the output of

qdbus --system org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.state

If it is '4' (Disconnected) but you can access the Internet, then your NetworkManager is indeed configured wrong. If it is '3' (Connected) the problem must be somewhere else. Under Debian this behavior can be caused by interfaces defined in /etc/network/interfaces, which are not controlled by NetworkManager. To fix this, simply remove the entries from /etc/network/interfaces and let NetworkManager handle them.

Kwestie techniczne

Nepomuk

Począwszy od wersji KDE 4.4 do poprawnego działania Akonadi wymagany jest działający Nepomuk. Akonadi sprawdza stan działania Nepomuka i w przypadku problemów wyświetla okno z raportem o błędzie.

Nepomuk only works with the Virtuoso backend. You can check whether the Nepomuk is running with the correct backend by using the Akonadi self-test dialog, as described above.

Although Nepomuk is required to be running, you can still disable Strigi file indexing, which is usually the most resource-intensive part of the Nepomuk framework.

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 the following command with root privileges then reload apparmor:

aa-complain mysqld

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.

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:

  • 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.

---

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:

  • dmesg produces:
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". Below the line:

@{HOME}/.local/share/akonadi/** rwk,

Add a new line:

@{HOME}/.Private/** rwk,

Restart apparmor and restart akonadi.

Missing Prerequisite

To use Akonadi you need to have the following packages installed (names might differ depending on your distribution):

  • The MySQL server (called mysql on openSUSE)
  • The Qt4 MySQL plugin (called libqt4-sql-mysql on openSUSE)

If you compile Qt4 yourself, make sure to tell the configure script to build in MySQL support by passing it the following option:

-plugin-sql-mysql

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).

If you get the Qt4 direct from Nokia, such as a download of qt-sdk-linux-x86_64-opensource-2009.05.bin, you will ( by the command "akonadictl start") get an error at Test 1:

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

Unfortunately this driver is not part of the distribution (until january 2010). You need to compile the source. Download the following file:

qt-everywhere-opensource-src-4.6.0.tar.bz

Then configure and make as above. But the make install doesn't copy the driver. So you have to copy it by yourself:

cp <qt-src-dir>/qt-everywhere-opensource-src-4.6.0/plugins/sqldrivers/libqsqlmysql.so /usr/local/bin/sqldrivers/

But the Revision 4.6.1, such as qt-sdk-linux-x86_64-opensource-2010.xx.bin has the driver you needed.

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.

mysqld: unknown variable 'innodb_file_per_table=1'

If the MySQL server log contains the following error, then your MySQL server was built without the InnoDB support which is required by Akonadi or InnoDB needs to be loaded in your mysql.conf file:

[ERROR] /usr/libexec/mysqld: unknown variable 'innodb_file_per_table=1'

[ERROR] Aborting

Try adding:

#sql_mode=strict_trans_tables <- Add underneath this line
  1. plugins

plugin_dir=usr/lib/mysql/plugin < - This may be a different path

plugin-load=ha_innodb.so

Table 'mysql. servers' doesn't exist

If MySQL server log contains the following error, then, most probably, you don't have your MySQL configuration file in place:

[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

Copy it from /usr/share/config/akonadi/mysql-global.conf into ~/.config/akonadi/mysql-local.conf. (For debian and openSuSE users the file is located in /etc/akonadi/mysql-global.conf). Then open it and uncomment the line sql_mode=strict_trans_tables. After that, you may get the following errors:

[ERROR] Plugin 'InnoDB' init function returned error.

[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. [ERROR] Unknown/unsupported table type: innodb

[ERROR] Aborting

If so, 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.

On openSUSE 11.2 running the following command will fix this problem:

mysql_install_db --datadir=$HOME/.local/share/akonadi/db_data/


Kubuntu 10.4 Upgrade

This is a summary of other entries here for those upgrading from Kubuntu 9.10 to 10.4 who may have been using a personal package archive (PPA) for KDE 4.3 for bug fixes.

Install missing prerequisites. Remove previous akonadi cache. Start the akonadi service. Install the database. Upgrade the database. Stop and restart the akonadi service.

sudo apt-get install virtuoso-server mysql-server-5.1

rm -r $HOME/.local/share/akonadi akonadictl start mysql_install_db --datadir=$HOME/.local/share/akonadi/db_data/ mysql_upgrade --socket=$HOME/.local/share/akonadi/db_misc/mysql.socket akonadictl stop

akonadictl start

The mysql_install_db command above will report something like the following, which you can safely ignore:

Installing MySQL system tables...

100501 18:04:30 [Warning] Can't create test file

/home/[userid]/.local/share/akonadi/db_data/[hostname].lower-test

Reference: forum.kde.org Akonadi 1.2.1 - some issues

KAddressBook upgrade

In addition to the Kubuntu 10.4 remedy above, problems trying to add a Vcard directory may require the following command while Akonadi is not running:

rm -rf $HOME/.config/akonadi

Can't initialize character set latin1

If you get the following error when starting Akonadi, then you are probably using a MySQL server which has a version > 5.1.42:

Character set 'latin1' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file

Nepomuk QueryServer interface not available! Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString) DataStore::unhideAllPimItems() Character set 'latin1' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file Database error: Cannot open database. Last driver error: "QMYSQL: Unable to connect" Last database error: "Can't initialize character set latin1 (path: /usr/share/mysql/charsets/)" Database error: Cannot open database. Last driver error: "QMYSQL: Unable to connect" Last database error: "Can't initialize character set latin1 (path:

/usr/share/mysql/charsets/)"

There is a known regression in MySQL 5.1.43 and 5.1.44 which prevents MySQL from starting.

See the bug report for more details.


Restarting after a previous error

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 on the command line:

akonadictl stop

You can confirm that it was indeed shut down completely by running:

akonadictl status

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.

The so-called "Gentoo-Assert"

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.

akonadiserver: libmysql.c:4301: setup_one_fetch_function: Assertion

`param->buffer_length != 0' failed.

It is extremely hard to diagnose as the assertion mentioned above is only triggered sometimes. Instead you'll get a wide range of weird symptoms:

  • ASAP protocol logs show successful creation of objects which are supposedly no longer available when the next commands access them again.
  • 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:

Possible solution: Rebuild the Qt MySQL driver after upgrading MySQL (which most likely caused this problem in the first place).