Archive:Http://userbase.kde.org/Akonadi 4.4/Troubleshooting/zh-cn: Difference between revisions

From KDE UserBase Wiki
m (Created page with '==介绍==')
 
m (FuzzyBot moved page Akonadi 4.4/Troubleshooting/zh-cn to Archive:Http://userbase.kde.org/Akonadi 4.4/Troubleshooting/zh-cn without leaving a redirect: Part of translatable page "Akonadi 4.4/Troubleshooting".)
 
(94 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Template:I18n/Language Navigation Bar|Akonadi 4.4/Troubleshooting}}
<languages />
<languages />
==介绍==
这个页面的内容主要关注于'''Akonadi'''的故障解决,因为在迁移的早期阶段一些故障是不可避免的。对于许多人来说,将会在'''KDE SC 4.4'''第一次注意到'''Akonadi'''活动,许多人可能会对它感到困惑。如需'''Akonadi'''用途的简要说明,参见[[Glossary_(zh_CN)#Akonadi|这个术语条目]]。你也会找到一些有用的链接来作进一步的阅读。一旦这些初期不可避免的问题被解决了,'''Akonadi'''将会为许多应用程序提供动力来源。
===理解结构===
你当然能简单的用 Kontact 管理所有的通讯录,但如果你有个准备好的备份系统,比如说,你会想知道你的数据在哪,以及它是如何处理的。这个 [[Akonadi_and_AddressBook|Akonadi 和通讯录]] 页面会帮助你。
== 故障排除的提示 ==
* 当报告'''Akonadi'''服务器的问题时,请总是附上完整的自检报告。这个报告可以从自检对话框获取,这个对话框在'''Akonadi'''无法成功启动时总是会出现。你也可以在kcmmodule当中找到这个自检对话框,这个kcmmodule使用下列命令访问:
{{input|1=kcmshell4 kcm_akonadi}}
* 从手工命令行启动'''Akonadi'''服务器可以获得一些额外的有用信息。这可以通过在终端执行下列命令:
{{input|1=akonadictl start}}
同样,用这个命令可以再次停止 Akonadi 服务器:
{{input|1=akonadictl stop}}
此命令提供了更多有用的信息:
{{input|1=akonadictl status}}
==常见问题==


==介绍==
===Kontact无法启动 - 并且它没有显示任何信息===
 
如果'''Kontact'''无法启动,并且你没有看到任何错误信息,请检查'''Akonadi'''是否在运行。'''Akonadi'''应该按要求启动了,但是目前(2010年1月)它并没有。如果你有任何已经迁移了的资源(最有可能的就是'''KAddressBook'''),你必须在启动'''Kontact'''之前启动它。使用''Akonadi托盘图标''(在'''KRunner'''中输入"akonadi")或'''konsole'''中输入该命令来启动它。
 
===Kontact 无法启动 - 版本 II===


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.
'''Kontact''' 已知某次更新后会遇到这问题。如果发生这种情况,试下从 '''KRunner'''(或 '''Konsole''')启动 '''KMail''','''KOrganizer''' 或其它任何程序。它们会作为独立程序运行,很有可能你会找到出错的地方。主要影响 4.4.0 版本。


===Understanding the Structure===
===未找到文件夹:"/Local"===


You can, of course, simply use Kontact to manage all your addressbook, but if you have a backup system in place, for instance, you'll want to know where your data is, and how it's handled. The page '''[[Akonadi_and_AddressBook]]''' will help.
许多人都已经报告了这个错误,"Kontact"无法启动。在 4.4 的早期版本,在迁移过程中有一个bug,"KMail“在 /home/anne/.local/share/Local 查找本地的邮件,而这个目录并不存在。这个问题的解决方法并不是试图修正它,而是在 "KMail"/"Kontact" 关闭时,打开Akonadi控制台 (使用krunner,Alt-F2,或者在 konsole 中输入"akonadiconsole" '''konsole'''),


== Troubleshooting Tips ==
然后删除本地邮件的资源。就可以启动'''Kontact'''或'''KMail'''了,同时将创建新的资源,指向~/ .local /share/local-mail


* 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'.
===在~/.local/share/下有一些新目录===


* 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.
是的。如果你的联系人被正确的迁移,那么一个新的资源将会在~/.local/share/contacts/被创建。


==Common Problems==
===/usr/bin/akonadi_maildir_resource和/usr/bin/akonadi_maildispatcher_agent是什么?===


===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.  If yours doesn't, you will have to start it before Kontact will start up if you have any migrated resources (most likely KAddressBook).  Use the AkonadiTray icon (get this by typing 'akonadi' into KRunner) or type the commands into konsole to start it.
‘’akonadi_maildir_resource‘’由‘’akonadi_maildispatcher_agent‘’自动创建,后者总是随着'''Akonadi'''服务器一起启动,因为它提供了所有基于Akonadi(和将要基于)邮件程序所使用的基本功能(例如发送邮件)。因此这两个程序同时运行是没有问题的,作为一般用户可以忽略它们。
这个自动生成的akonadi_maildir_resource将总是指向~/.local/share/local-mail/这个目录,这个目录是你的本地文件夹账户,你的本地目录和邮件将会存放在这里。


===Kontact doesn't start - version II===
目前,在'''KDE SC 4.4'''中,还没有迁移邮件。


Kontact has been known to be hit after an update.  If this happens, try starting KMail, KOrganizer or any of the other applications from KRunner (or Konsole).  Chances are high that they will work as stand-alone apps while you find what went wrong.  This mainly affects version 4.4.0.
===Nepomuk Indexing Agents Disabled===


===Folder not found: "/Local"===
'''Kontact''' 当前能工作,但你总是会看到这个提示:


Some 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 ~/.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 ~/.local/share/local-mail
[[image:NepomukError.png|418px|center]]


===There are other new folders under ~/.local/share/===
<span class="mw-translate-fuzzy">
这个提示最常见的原因是「系统设置」中禁用了 '''Nepomuk'''。请打开「系统设置」中的<menuchoice>高级->桌面搜索->基本设置</menuchoice>,勾选「启用 Nepomuk 语义学桌面」,点「应用」启用它。
</span>


Yes. If your addressbook has migrated correctly a new resource will have been created as ~/.local/share/contacts/
如果还是没效果(或是提示错误时选项已经勾选了),要是你之前用过 '''KDE SC 4.4''' 的测试版,有可能是受数据层变动的影响(由于 Virtuoso 数据服务器从版本 5 升级到版本 6;'''KDE SC 4.4''' 的正式版预设随 '''Virtuoso''' 版本 6 一起)。下列命令应该会让它重新正常工作:


===What are /usr/bin/akonadi_maildir_resource and /usr/bin/akonadi_maildispatcher_agent?===
{{input|1=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.


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.
<span class="mw-translate-fuzzy">
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.
Nepomuk 运行以便 Akonadi 正常工作,Akonadi 工作正常,Kontact 才能运行正常。
但是,你可以禁用 Strigi 文件索引器,Kontact 不需要它。Strigi 文件索引器只是用在桌面搜索中,与 Kontact 无关。只需要确保 Nepomuk 本身正常运行保证 Kontact 的正常工作。
</span>


At this point, in KDE SC 4.4, mail is not yet being migrated.
<span class="mw-translate-fuzzy">
Kontact 中,很多不同的地方都用到了 Nepomuk,从显示即将到的生日,处理空闲/忙碌列表,到在信息浏览器中显示联系人照片。如果 Nepomuk 没有运行,Kontact 中多个不同的地方都会停止工作。提示就是警告你功能的减少。如上面所述启用 Nepomuk 会修复这个问题。
</span>


===Nepomuk Indexing Agents have been Disabled===
<span class="mw-translate-fuzzy">
你可以通过输入''akonadictl status''检查 Nepomuk 是否正确运行。
</span>
{{input|1=akonadictl status}}
===我想要继续用我现在的地址薄和日历 - 可以吗?===


Kontact is now working, but you keep seeing this notice:
<span class="mw-translate-fuzzy">
可以。当你用 Akonadi 控制台添加新资源,可以选择作为「标准资源」 - 指向你的 std.vcf 文件,就可以了。迁移不会破坏你原有的地址薄。你可以继续使用,但会失去 Akonadi 带来的功能收益。或者你可以同时放置 Akonadi 地址薄和你原有的地址薄2种地址薄,如果你觉得这样更安全,可以弄一段时间。
</span>


[[image:NepomukError.png|418px|center]]
===我的地址簿看不到任何详细信息===


The most common reason for this notice is that Nepomuk is simply disabled in System Settings. Please try enabling it in System Settings under Advanced / Desktop Search / Basic Settings by checking "Nepomuk Semantik Desktop" and clicking Apply.
<span class="mw-translate-fuzzy">
当前,这个问题的原因还不知道,但解决办法很容易。关闭 Kontact,打开独立程序 KAddressBook。关闭 KAddressBook,你就能在 Kontact 中正常使用了。好像是某个东西在 Kontact 启动时没启用,我预计这问题会很快被确认,修正。
</span>


If this does not help (or if the option was already checked when you got the error) and if you have previously been using prereleases of KDE SC 4.4, you may be affected by a change to the database layout (due to an upgrade of the Virtuoso database server from version 5 to version 6; production releases of KDE SC 4.4 are expected to be shipped with Virtuoso version 6). The following commands should get it working again:
===我在 KMail 中点「选择」按钮没弹出联系人===
{|style="width:98%; border:2px dotted #BCBCBC; background:#EEEEEE;"
| 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.


A running Nepomuk is necessary to have a working Akonadi, and thus a working Kontact.  However, you can disable the Strigi file indexer, which is not needed for Kontact. Strigi file indexing is used for desktop searching only, which is unrelated to Kontact. Just make sure Nepomuk itself is running correctly for Kontact.
<span class="mw-translate-fuzzy">
检查 系统设置 > 高级 > KDE 资源。确保 Akonadi 控制的地址薄(联系人)列在那 - 如果需要添加新的地址薄。同时,最好设定主 Akonadi 地址薄,通常叫 Personal Contacts,为默认。
</span>


In Kontact, Nepomuk is used for many different things, ranging from displaying upcoming birthdays, over handling free/busy lists to showing a contact photo in the message viewer. If Nepomuk is not running, several different things in Kontact will cease to work. The notice is there to warn you about the reduced functionality. Enabling Nepomuk as described above fixes the problem.
===如何能让我的「群件地址簿」(Groupware addressbook)回来?===


You can check if Nepomuk is correctly running by typing ''akonadictl status''.
两种方法:分旧的架构和新的架构。


===I want to use my current Address Book and Organizer - Can I?===
<span class="mw-translate-fuzzy">
旧的架构:在 Akonadi 控制台(akonadiconsole),添加 "KDE 地址薄(传统)"。KDE 地址薄是在 Akonadi 中建立旧的 kresources。在 "KDE 地址薄(传统)"的设置中,指向到一个 "IMAP over KMail" KResource,在 KMail中的群件(groupware)选项应该已经启用了。这应该也能用于 Kolab、eGroupware 和类似的地址薄 - 你需要检查选项来确保选择了正确的类型。
</span>


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.
<span class="mw-translate-fuzzy">
新的架构(只跟 kolab 测试过):在 Akonadi 设置模块(运行 'kcmshell4 kcm_akonadi'),添加 "IMAP 邮件服务器(E-Mail Server)"资源,设置邮件服务器名称,用户名和密码,然后点击「自动识别」。然后添加 kolab 资源。下一步是等 imap 资源同步,这会花费相当长时间。akonadi 设置模块会出现新状态。如果什么也没发生,重启 akonadiserver。过不久,kolab 地址薄就会出现在 kaddressbook。
</span>
{{input|1=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'''.
<span id="You experience long delays when sending mail"></span>
===发送邮件时感觉到明显的延迟===


===I can't see any details in my Address Book===
<span class="mw-translate-fuzzy">
这伴随着 KMail 卡住直到邮件真的发送出去。
</span>


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.  This seems to mainly affect version 4.4.0.
<span class="mw-translate-fuzzy">
Nepomuk 检查地址的方式中发现了一个 bug,它会引起巨大的延迟。这 bug 已经在 SC 4.4.1 中被修复。在此之前,这有个解决办法:
</span>


===My contacts don't show when I use the Select button in KMail===
<span class="mw-translate-fuzzy">
关闭运行的 Kontact 或 KMail 和 KAddressBook。禁用「系统设置」中的 strigi。停止 nepomk,删除数据库,重启 nepomukserver。你需要的实际命令(作为用户)
</span>


Check System Settings > Advanced tab > KDE Resources. Make sure that your Akonadi controlled address book(s) are listed there - add them if necessary. At the same time, it's a good idea to make your main Akonadi addressbook, usually called Personal Contacts, is set to be the default. More details of how this can be found in [[KAddressBook_4.4#Setting_up_your_New_AddressBook|here]].
<!--T:42-->
{{input|1=qdbus org.kde.NepomukServer /nepomukserver org.kde.NepomukServer.quit
rm -r ~/.kde/share/apps/nepomuk
rm -r ~/.kde4/share/apps/nepomuk
nepomukserver}}


===How do I get my Groupware addressbook back?===
当然,这个会清空所有的数据信息,包括你以前添加的标签(tags)。理论上,我理解能够有选择的清空数据。如果你在乎的话,你可以在[http://techbase.kde.org/Development/Tutorials/Metadata/Nepomuk/TipsAndTricks#Remove_all_Strigi-indexed_data 这]找到详细说明


Two solutions: using the old framework or the new one.
===IMAP Resource always claims to be offline===


Old framework: 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 - you will need to check the options to make sure that the correct type is selected.
Even though the system has an internet connection, the IMAP resource refuses
to switch to online state.


New framework (only tested with Kolab): In the Akonadi configuration module (run 'kcmshell4 kcm_akonadi' to see it), add an "IMAP E-Mail Server" resource, and set up your mail server name, username and password, then click Auto-Detect. Then add a Kolab resource. The next step is to wait for the imap resource to synchronize, this 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.
This bug is caused by a misconfigured NetworkManager installation on your system. Check the output of the following command:


===You experience long delays when sending mail===
{{input|1=qdbus --system org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.state}}


This is accompanied by KMail freezing until the mail is actually dispatched.
You can get any of the following values:


A bug has been found in the way Nepomuk checks addresses, which can cause huge delays.  This is fixed for SC 4.4.1.  If you cannot get 4.4.1 yet, there is this work-around:
* '''20''' (formerly ''4''), '''disconnected'''. If you have access to the internet, your NetworkManager configuration must be wrong.


Close Kontact or KMail and KAddressbook if you are running
* '''70''' (formerly ''3''), '''connected'''. The problem must be somewhere else.
stand-alone apps. Disable Strigi in SystemSettings. Stop Nepomuk, delete the
**It might be that one or more '''network interfaces''' are '''not controlled by NetworkManager'''. If that is your case, give the control of those interfaces to NetworkManager. It might be as simple as removing the entries for the interfaces from a text file (for example, <tt>/etc/network/interfaces</tt>). Check the help resources provided by your software distribution for more information.
database and restart ''nepomukserver''. The actual commands you need are (as
user)


{|style="width:98%; border:2px dotted #BCBCBC; background:#EEEEEE;"
=== Can't read  any details of some messages or big delays to read it ===
|qdbus org.kde.NepomukServer /nepomukserver org.kde.NepomukServer.quit
|-
|rm -r ~/.kde/share/apps/nepomuk
|-
|rm -r ~/.kde4/share/apps/nepomuk
|-
|nepomukserver
|}


This will, of course, wipe out all the database, including any tags you've
if you aren't able to read some emails and see a message with " please wait ... ", you may logout and login KDE session to reinitialize all processes, might help.  
added.  In theory, I understand that it's possible to do a more selective wipe
of the database. If this matters to you you can find the instructions at
[http://techbase.kde.org/Development/Tutorials/Metadata/Nepomuk/TipsAndTricks#Remove_all_Strigi-indexed_data this page]


== Some Technical Issues ==
== 一些技术问题 ==


=== Nepomuk ===
=== 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.
<span class="mw-translate-fuzzy">
KDE 4.4 之后,要求运行 Nepomuk 以保证 Akonadi 能够正常工作。Akonadi 启动时会自动检查,若没运行则显示一个错误对话框。
</span>


Nepomuk only works with the Virtuoso backend.
<span class="mw-translate-fuzzy">
You can check whether the Nepomuk is running with the correct backend by using the Akonadi self-test dialog, as described above.
Nepomuk 只能用 ''Virtuoso'' 后端能够正常工作,你可以用之前所述的 Akonadi 自检对话框来检查 Nepomuk 是否工作在正确的后端。
</span>


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.
<span class="mw-translate-fuzzy">
尽管要求运行 Nepomuk,但你仍可以禁用 Strigi 文件索引,它通常是 Nepomuk 框架中资源最密集的部分(最耗费资源)。
</span>


=== Apparmor ===
=== 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:
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  
{{output|1=unknown error 255 when running akonadictl
* "DB error: 'Could not open required defaults file: /home/$username/.local/share/akonadi/mysql.conf"  
"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.
You can solve this by running the following command with root privileges then reload apparmor:
On Kubuntu this is:  
{{input|1=aa-complain mysqld}}
 
On ''Kubuntu'' this is:
   
   
sudo aa-complain mysqld
{{input|1=sudo aa-complain mysqld
sudo /etc/init.d/apparmor reload
sudo /etc/init.d/apparmor reload}}


Note that you might be using Apparmor even if it does not show up in the process list.
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:
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.
* '''Akonadi''' still uses '''mysqld''' instead of '''mysqld-akonadi'''. You can change that in <menuchoice>Systemsettings -> Advanced -> Akonadi -> Server configuration</menuchoice>.
* AppArmor is not setup correctly for ''mysqld-akonadi'' either. Try running the ''aa-complain'' command noted above with ''mysqld-akonadi'' instead of ''mysqld''.
* '''AppArmor''' is not setup correctly for '''mysqld-akonadi''' either. Try running the "aa-complain" command noted above with '''mysqld-akonadi''' instead of '''mysqld'''.  


<!--T:54-->
---
---


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:
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:  
* dmesg produces:
      ecryptfs_do_create: Failure to create dentry in lower fs; rc = [-13]
{{output|1=ecryptfs_do_create: Failure to create dentry in lower fs; rc = [-13]
      ecryptfs_create: Failed to create file inlower filesystem
ecryptfs_create: Failed to create file inlower filesystem}}
* Akonadi will list the following errors:
* Akonadi will list the following errors:
      Akonadi server process not registered at D-Bus
{{output|1=Akonadi server process not registered at D-Bus}}


The fix is to edit the following file "/etc/apparmor.d/usr.sbin.mysqld-akonadi".
The fix is to edit the following file "/etc/apparmor.d/usr.sbin.mysqld-akonadi".
Below the line:  
Below the line:
      @{HOME}/.local/share/akonadi/** rwk,
{{output|1=@{HOME}/.local/share/akonadi/** rwk,}}
Add a new line:
Add a new line:
      @{HOME}/.Private/** rwk,
{{input|1=@{HOME}/.Private/** rwk,}}


Restart apparmor and restart akonadi.
Restart '''apparmor''' and restart '''akonadi'''.


=== 缺失的依赖 ===


=== Missing Prerequisite ===
<span class="mw-translate-fuzzy">
要用 Akonadi,你需要安装下列包(包名随发行版或许有所不同):
</span>


To use Akonadi you need to have the following packages installed (names might differ depending on your distribution):
<span class="mw-translate-fuzzy">
* MySQL 服务器(openSUSE 上叫 ''mysql'')
* Qt4 MySQL 插件(openSUSE 上叫 ''libqt4-sql-mysql'')
</span>


* The MySQL server (called ''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:
* The Qt4 MySQL plugin (called ''libqt4-sql-mysql'' on openSUSE)
{{input|1=-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 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).
If you get the Qt4 direct from ''Nokia'', such as a download of <code>qt-sdk-linux-x86_64-opensource-2009.05.bin</code>, you will ( by the command "akonadictl start") get an error at Test 1:


If you get the Qt4 direct from Nokia, such as a download of
<!--T:99-->
  qt-sdk-linux-x86_64-opensource-2009.05.bin
{{output|1=Database driver not found.
 
Details: The QtSQL driver 'QMYSQL' is required by your current Akonadi server configuration.
you will ( by the command "akonadictl start") get an error at Test 1:
The following drivers are installed: QSQLITE.
  ''Database driver not found.''
Make sure the required driver is installed.}}
  ''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''
The driver you need is ''libqsqlmysql.so''


Unfortunately this driver is not part of the distribution (until january 2010).
Unfortunately this driver is not part of the distribution (until january 2010).
You need to compile the source. Download it
You need to compile the source. Download the following file:
  qt-everywhere-opensource-src-4.6.0.tar.bz
{{input|1=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:
Then ''configure'' and ''make'' as above. But the ''make install'' doesn't copy the driver. So you have to copy it by yourself:
{|style="width:98%; border:2px dotted #BCBCBC; background:#EEEEEE;"
{{input|1=cp <qt-src-dir>/qt-everywhere-opensource-src-4.6.0/plugins/sqldrivers/libqsqlmysql.so /usr/local/bin/sqldrivers/}}
|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.
|}
'''But''' it might be necessary to bind again the ''libqsqlmysql.so'' if the ''libmysqlclient.so'' has changed to a newer version.
'''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.
<span class="mw-translate-fuzzy">
Akonadi 服务器是用 '''XDG_DATA_DIRS''' 环境变量定义的路径搜索 Akonadi agents 和资源。如果 Akonadi 提示无法找到 agents 或资源,检查变量是否设置正确。记住,即使变量在当前控制台会话中已经设定好,但有可能服务器启动时缺定义。手动在当前控制台会话中启动服务器会避免这个问题。
</span>


=== mysqld: unknown variable 'innodb_file_per_table=1' ===
=== mysqld: unknown variable 'innodb_file_per_table=1' === <!--T:69-->


If the MySQL server log contains the following error:
<span class="mw-translate-fuzzy">
如果 MySQL 服务器日志包含如下错误信息:
<code>
<code>
[ERROR] /usr/libexec/mysqld: unknown variable 'innodb_file_per_table=1'
[ERROR] /usr/libexec/mysqld: unknown variable 'innodb_file_per_table=1'
[ERROR] Aborting</code>
[ERROR] Aborting</code>
</span>
{{output|1=[ERROR] /usr/libexec/mysqld: unknown variable 'innodb_file_per_table=1'
[ERROR] Aborting}}


then your MySQL server was built without the InnoDB support which is required by Akonadi.
<span class="mw-translate-fuzzy">
说明你的 MySQL 服务器没有内置 InnoDB 支持,Akonadi 需要这项特性。
</span>


<!--T:100-->
{{input|1=#sql_mode=strict_trans_tables <- Add underneath this line
#plugins
plugin_dir=usr/lib/mysql/plugin < - This may be a different path
plugin-load=ha_innodb.so}}
===Table 'mysql. servers' doesn't exist===


===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:


If MySQL server log contains the following error:
<!--T:102-->
<code>[ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
{{output|1=[ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
[ERROR] Cannot open mysql.db
[ERROR] Cannot open mysql.db
[ERROR] Cannot open mysql.user
[ERROR] Cannot open mysql.user
[ERROR] Cannot open mysql.event</code>
[ERROR] Cannot open mysql.event}}
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.
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' registration as a STORAGE ENGINE  
 
failed.
<!--T:104-->
{{output|1=[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[ERROR] Unknown/unsupported table type: innodb
[ERROR] Unknown/unsupported table type: innodb
[ERROR] Aborting</code>
[ERROR] Aborting}}
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.
 
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:
 
      <!--T:106-->
{{input|1=mysql_install_db --datadir=$HOME/.local/share/akonadi/db_data/}}
 
For ''Archlinux'':
 
{{input|1=mysql_install_db --datadir=$HOME/.local/share/akonadi/db_data/ --basedir=/usr}}


On openSUSE 11.2 running the command
=== Kubuntu 10.04 (Lucid Lynx) Upgrade ===
<code>mysql_install_db --datadir=$HOME/.local/share/akonadi/db_data/</code>
will fix this problem.


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


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.
{{input|1=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}}


Install missing prerequisites.  Remove previous akonadi cache.  Start the akonadi service.  Install the database.  Upgrade the database.  Stop and restart the akonadi service.
The mysql_install_db command above will report something like the following, which you can safely ignore:
{|style="width:98%; border:2px dotted #BCBCBC; background:#EEEEEE;"
|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 what follows, which you can safely ignore:
<!--T:108-->
<code>Installing MySQL system tables...
{{output|1=Installing MySQL system tables...
100501 18:04:30 [Warning] Can't create test file /home/[userid]/.local/share/akonadi/db_data/[hostname].lower-test</code>
100501 18:04:30 [Warning] Can't create test file  
/home/[userid]/.local/share/akonadi/db_data/[hostname].lower-test}}


Reference:
Reference:
Line 255: Line 320:
=== KAddressBook upgrade ===
=== KAddressBook upgrade ===


In addition to the Kubuntu 10.4 remedy above, problems trying to add a Vcard directory may require
In addition to the ''Kubuntu 10.04'' remedy above, problems trying to add a ''Vcard directory'' may require the following command while '''Akonadi''' is not running:
{|style="width:98%; border:2px dotted #BCBCBC; background:#EEEEEE;"
{{input|1=rm -rf $HOME/.config/akonadi}}
|rm -rf $HOME/.config/akonadi
|}
while Akonadi is not running.


=== Can't initialize character set latin1 ===
=== Can't initialize character set latin1 ===


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


<code>Character set 'latin1' is not a compiled character set and is not specified in
<!--T:84-->
the '/usr/share/mysql/charsets/Index.xml' file
{{output|1=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!
Nepomuk QueryServer interface not available!
Connecting to deprecated signal
Connecting to deprecated signal
Line 280: Line 342:
Last driver error: "QMYSQL: Unable to connect"
Last driver error: "QMYSQL: Unable to connect"
Last database error: "Can't initialize character set latin1 (path:
Last database error: "Can't initialize character set latin1 (path:
/usr/share/mysql/charsets/)"</code>
/usr/share/mysql/charsets/)"}}


then you're probably using a MySQL server which has a version > 5.1.42.
There is a known regression in MySQL 5.1.43 and 5.1.44 which prevents MySQL from starting.  
There is a known regression in MySQL 5.1.43 and 5.1.44 which prevents MySQL from starting.  


Line 290: Line 351:
=== Restarting after a previous error ===
=== 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 '''akonadictl stop''' on the command line. You can confirm that it was indeed shut down completely by running '''akonadictl status'''.
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:
{{input|1=akonadictl stop}}
You can confirm that it was indeed shut down completely by running:
{{input|1=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.
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" ===
=== 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.
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.


{|style="width:98%; border:2px dotted #BCBCBC; background:#EEEEEE;"
<!--T:92-->
|akonadiserver: libmysql.c:4301: setup_one_fetch_function: Assertion
{{output|1=akonadiserver: libmysql.c:4301: setup_one_fetch_function: Assertion
|-
`param->buffer_length != 0' failed.}}
|`param->buffer_length != 0' failed.
|}


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:
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 accesses them again.
* 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 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.
* SQL protocol logs showing large apparently random record ids which are nevertheless considered valid.
Line 316: Line 378:


Possible solution: Rebuild the Qt MySQL driver after upgrading MySQL (which most likely caused this problem in the first place).
Possible solution: Rebuild the Qt MySQL driver after upgrading MySQL (which most likely caused this problem in the first place).
<span class="mw-translate-fuzzy">
[[Category:系统/zh-cn]]
</span>
Be warned that you should not follow this advice, without backing up your data.
After the introduction  of KMail 2 in kdepim, since KDE SC 4.6.x, in order to search in emails and to get addressbooks, it is necessary to set <menuchoice>System Settings -> Desktop Search -> Enable Nepomuk Sematic Desktop </menuchoice> enabled, and check the box <menuchoice>Enable Email Indexer</menuchoice>.
If virtuoso-t occupies almost 100% of CPU cores and the system is nearly frozen, it may be a good idea to reset all.
To do the big reset you need :
{{Warning|1=This will initialize all your Kontact and KDE PIM data customization, but not remove emails data, akonadi resources (like email accounts, address books ), KMail Identities, filters and expired mail folders.  However, be warned that you will lost much customization information, including ratings and other metadata.  Also there is some risk here, because this reconstruction of data has bugs that may make you lose data.}}
{{Input|1=akonadictl stop
rm -rf  ~/.local/share/akonadi/db_data/*
akonadictl start
# we should also clean KDE temporary folders before start KMail
rm -rf /var/tmp/kdecache-$USER /tmp/ksocket-$USER /tmp/kde-$USER
}}
You need to check <menuchoice> Settings -> Configure KMail -> Identities</menuchoice> to see whether the Sent folder is correct.  Some of mine were not.
Check <menuchoice> Settings -> Configure KMail -> Accounts </menuchoice> settings and check whether the incoming folder is correct.  Some of mine were not.
Check all filters, before pulling some email.  I advise disabling all filters because there may be many folders incorrect or missing.
Also important is that if you have an "expired folder", check all folders to see if the receiving folder is correctly set.  If you have <menuchoice>Delete permanently</menuchoice> checked you may lose important emails because expiring worked with the wrong folder.
In each <menuchoice> folder's context menu -> Folder Properties </menuchoice> check Identities, as the associated identity may also be changed or lost in any folder. 
After this we are ready to [[Special:myLanguage/Akonadi_4.4/Troubleshooting#You experience long delays when sending mail|clean up Nepomuk data]] before enabling Nepomuk Semantic.
After all is cleaned , if you aren't able to read any emails, you should logout and login KDE session again to reinitialize all processes .


[[Category:System]]
[[Category:System]]

Latest revision as of 17:00, 13 February 2013

介绍

这个页面的内容主要关注于Akonadi的故障解决,因为在迁移的早期阶段一些故障是不可避免的。对于许多人来说,将会在KDE SC 4.4第一次注意到Akonadi活动,许多人可能会对它感到困惑。如需Akonadi用途的简要说明,参见这个术语条目。你也会找到一些有用的链接来作进一步的阅读。一旦这些初期不可避免的问题被解决了,Akonadi将会为许多应用程序提供动力来源。

理解结构

你当然能简单的用 Kontact 管理所有的通讯录,但如果你有个准备好的备份系统,比如说,你会想知道你的数据在哪,以及它是如何处理的。这个 Akonadi 和通讯录 页面会帮助你。

故障排除的提示

  • 当报告Akonadi服务器的问题时,请总是附上完整的自检报告。这个报告可以从自检对话框获取,这个对话框在Akonadi无法成功启动时总是会出现。你也可以在kcmmodule当中找到这个自检对话框,这个kcmmodule使用下列命令访问:
kcmshell4 kcm_akonadi
  • 从手工命令行启动Akonadi服务器可以获得一些额外的有用信息。这可以通过在终端执行下列命令:
akonadictl start

同样,用这个命令可以再次停止 Akonadi 服务器:

akonadictl stop

此命令提供了更多有用的信息:

akonadictl status

常见问题

Kontact无法启动 - 并且它没有显示任何信息

如果Kontact无法启动,并且你没有看到任何错误信息,请检查Akonadi是否在运行。Akonadi应该按要求启动了,但是目前(2010年1月)它并没有。如果你有任何已经迁移了的资源(最有可能的就是KAddressBook),你必须在启动Kontact之前启动它。使用Akonadi托盘图标(在KRunner中输入"akonadi")或konsole中输入该命令来启动它。

Kontact 无法启动 - 版本 II

Kontact 已知某次更新后会遇到这问题。如果发生这种情况,试下从 KRunner(或 Konsole)启动 KMailKOrganizer 或其它任何程序。它们会作为独立程序运行,很有可能你会找到出错的地方。主要影响 4.4.0 版本。

未找到文件夹:"/Local"

许多人都已经报告了这个错误,"Kontact"无法启动。在 4.4 的早期版本,在迁移过程中有一个bug,"KMail“在 /home/anne/.local/share/Local 查找本地的邮件,而这个目录并不存在。这个问题的解决方法并不是试图修正它,而是在 "KMail"/"Kontact" 关闭时,打开Akonadi控制台 (使用krunner,Alt-F2,或者在 konsole 中输入"akonadiconsole" konsole),

然后删除本地邮件的资源。就可以启动KontactKMail了,同时将创建新的资源,指向~/ .local /share/local-mail

在~/.local/share/下有一些新目录

是的。如果你的联系人被正确的迁移,那么一个新的资源将会在~/.local/share/contacts/被创建。

/usr/bin/akonadi_maildir_resource和/usr/bin/akonadi_maildispatcher_agent是什么?

‘’akonadi_maildir_resource‘’由‘’akonadi_maildispatcher_agent‘’自动创建,后者总是随着Akonadi服务器一起启动,因为它提供了所有基于Akonadi(和将要基于)邮件程序所使用的基本功能(例如发送邮件)。因此这两个程序同时运行是没有问题的,作为一般用户可以忽略它们。 这个自动生成的akonadi_maildir_resource将总是指向~/.local/share/local-mail/这个目录,这个目录是你的本地文件夹账户,你的本地目录和邮件将会存放在这里。

目前,在KDE SC 4.4中,还没有迁移邮件。

Nepomuk Indexing Agents Disabled

Kontact 当前能工作,但你总是会看到这个提示:

这个提示最常见的原因是「系统设置」中禁用了 Nepomuk。请打开「系统设置」中的高级->桌面搜索->基本设置,勾选「启用 Nepomuk 语义学桌面」,点「应用」启用它。

如果还是没效果(或是提示错误时选项已经勾选了),要是你之前用过 KDE SC 4.4 的测试版,有可能是受数据层变动的影响(由于 Virtuoso 数据服务器从版本 5 升级到版本 6;KDE SC 4.4 的正式版预设随 Virtuoso 版本 6 一起)。下列命令应该会让它重新正常工作:

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.

Nepomuk 运行以便 Akonadi 正常工作,Akonadi 工作正常,Kontact 才能运行正常。 但是,你可以禁用 Strigi 文件索引器,Kontact 不需要它。Strigi 文件索引器只是用在桌面搜索中,与 Kontact 无关。只需要确保 Nepomuk 本身正常运行保证 Kontact 的正常工作。

Kontact 中,很多不同的地方都用到了 Nepomuk,从显示即将到的生日,处理空闲/忙碌列表,到在信息浏览器中显示联系人照片。如果 Nepomuk 没有运行,Kontact 中多个不同的地方都会停止工作。提示就是警告你功能的减少。如上面所述启用 Nepomuk 会修复这个问题。

你可以通过输入akonadictl status检查 Nepomuk 是否正确运行。

akonadictl status

我想要继续用我现在的地址薄和日历 - 可以吗?

可以。当你用 Akonadi 控制台添加新资源,可以选择作为「标准资源」 - 指向你的 std.vcf 文件,就可以了。迁移不会破坏你原有的地址薄。你可以继续使用,但会失去 Akonadi 带来的功能收益。或者你可以同时放置 Akonadi 地址薄和你原有的地址薄2种地址薄,如果你觉得这样更安全,可以弄一段时间。

我的地址簿看不到任何详细信息

当前,这个问题的原因还不知道,但解决办法很容易。关闭 Kontact,打开独立程序 KAddressBook。关闭 KAddressBook,你就能在 Kontact 中正常使用了。好像是某个东西在 Kontact 启动时没启用,我预计这问题会很快被确认,修正。

我在 KMail 中点「选择」按钮没弹出联系人

检查 系统设置 > 高级 > KDE 资源。确保 Akonadi 控制的地址薄(联系人)列在那 - 如果需要添加新的地址薄。同时,最好设定主 Akonadi 地址薄,通常叫 Personal Contacts,为默认。

如何能让我的「群件地址簿」(Groupware addressbook)回来?

两种方法:分旧的架构和新的架构。

旧的架构:在 Akonadi 控制台(akonadiconsole),添加 "KDE 地址薄(传统)"。KDE 地址薄是在 Akonadi 中建立旧的 kresources。在 "KDE 地址薄(传统)"的设置中,指向到一个 "IMAP over KMail" KResource,在 KMail中的群件(groupware)选项应该已经启用了。这应该也能用于 Kolab、eGroupware 和类似的地址薄 - 你需要检查选项来确保选择了正确的类型。

新的架构(只跟 kolab 测试过):在 Akonadi 设置模块(运行 'kcmshell4 kcm_akonadi'),添加 "IMAP 邮件服务器(E-Mail Server)"资源,设置邮件服务器名称,用户名和密码,然后点击「自动识别」。然后添加 kolab 资源。下一步是等 imap 资源同步,这会花费相当长时间。akonadi 设置模块会出现新状态。如果什么也没发生,重启 akonadiserver。过不久,kolab 地址薄就会出现在 kaddressbook。

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.

发送邮件时感觉到明显的延迟

这伴随着 KMail 卡住直到邮件真的发送出去。

Nepomuk 检查地址的方式中发现了一个 bug,它会引起巨大的延迟。这 bug 已经在 SC 4.4.1 中被修复。在此之前,这有个解决办法:

关闭运行的 Kontact 或 KMail 和 KAddressBook。禁用「系统设置」中的 strigi。停止 nepomk,删除数据库,重启 nepomukserver。你需要的实际命令(作为用户)

qdbus org.kde.NepomukServer /nepomukserver org.kde.NepomukServer.quit
rm -r ~/.kde/share/apps/nepomuk
rm -r ~/.kde4/share/apps/nepomuk
nepomukserver

当然,这个会清空所有的数据信息,包括你以前添加的标签(tags)。理论上,我理解能够有选择的清空数据。如果你在乎的话,你可以在找到详细说明

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 the following command:

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

You can get any of the following values:

  • 20 (formerly 4), disconnected. If you have access to the internet, your NetworkManager configuration must be wrong.
  • 70 (formerly 3), connected. The problem must be somewhere else.
    • It might be that one or more network interfaces are not controlled by NetworkManager. If that is your case, give the control of those interfaces to NetworkManager. It might be as simple as removing the entries for the interfaces from a text file (for example, /etc/network/interfaces). Check the help resources provided by your software distribution for more information.

Can't read any details of some messages or big delays to read it

if you aren't able to read some emails and see a message with " please wait ... ", you may logout and login KDE session to reinitialize all processes, might help.

一些技术问题

Nepomuk

KDE 4.4 之后,要求运行 Nepomuk 以保证 Akonadi 能够正常工作。Akonadi 启动时会自动检查,若没运行则显示一个错误对话框。

Nepomuk 只能用 Virtuoso 后端能够正常工作,你可以用之前所述的 Akonadi 自检对话框来检查 Nepomuk 是否工作在正确的后端。

尽管要求运行 Nepomuk,但你仍可以禁用 Strigi 文件索引,它通常是 Nepomuk 框架中资源最密集的部分(最耗费资源)。

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.

缺失的依赖

要用 Akonadi,你需要安装下列包(包名随发行版或许有所不同):

  • MySQL 服务器(openSUSE 上叫 mysql
  • Qt4 MySQL 插件(openSUSE 上叫 libqt4-sql-mysql

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. But it might be necessary to bind again the libqsqlmysql.so if the libmysqlclient.so has changed to a newer version.

环境设置

Akonadi 服务器是用 XDG_DATA_DIRS 环境变量定义的路径搜索 Akonadi agents 和资源。如果 Akonadi 提示无法找到 agents 或资源,检查变量是否设置正确。记住,即使变量在当前控制台会话中已经设定好,但有可能服务器启动时缺定义。手动在当前控制台会话中启动服务器会避免这个问题。

mysqld: unknown variable 'innodb_file_per_table=1'

如果 MySQL 服务器日志包含如下错误信息: [ERROR] /usr/libexec/mysqld: unknown variable 'innodb_file_per_table=1' [ERROR] Aborting

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

说明你的 MySQL 服务器没有内置 InnoDB 支持,Akonadi 需要这项特性。

#sql_mode=strict_trans_tables <- Add underneath this line
#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/

For Archlinux:

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

Kubuntu 10.04 (Lucid Lynx) Upgrade

This is a summary of other entries here for those upgrading from Kubuntu 9.10 to 10.04 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.04 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).

Be warned that you should not follow this advice, without backing up your data.

After the introduction of KMail 2 in kdepim, since KDE SC 4.6.x, in order to search in emails and to get addressbooks, it is necessary to set System Settings -> Desktop Search -> Enable Nepomuk Sematic Desktop enabled, and check the box Enable Email Indexer.

If virtuoso-t occupies almost 100% of CPU cores and the system is nearly frozen, it may be a good idea to reset all.

To do the big reset you need :

Warning

This will initialize all your Kontact and KDE PIM data customization, but not remove emails data, akonadi resources (like email accounts, address books ), KMail Identities, filters and expired mail folders. However, be warned that you will lost much customization information, including ratings and other metadata. Also there is some risk here, because this reconstruction of data has bugs that may make you lose data.


akonadictl stop
rm -rf  ~/.local/share/akonadi/db_data/* 
akonadictl start 
# we should also clean KDE temporary folders before start KMail
rm -rf /var/tmp/kdecache-$USER /tmp/ksocket-$USER /tmp/kde-$USER

You need to check Settings -> Configure KMail -> Identities to see whether the Sent folder is correct. Some of mine were not.

Check Settings -> Configure KMail -> Accounts settings and check whether the incoming folder is correct. Some of mine were not.

Check all filters, before pulling some email. I advise disabling all filters because there may be many folders incorrect or missing.

Also important is that if you have an "expired folder", check all folders to see if the receiving folder is correctly set. If you have Delete permanently checked you may lose important emails because expiring worked with the wrong folder.

In each folder's context menu -> Folder Properties check Identities, as the associated identity may also be changed or lost in any folder.

After this we are ready to clean up Nepomuk data before enabling Nepomuk Semantic.

After all is cleaned , if you aren't able to read any emails, you should logout and login KDE session again to reinitialize all processes .