Bug 289097

Summary: error "Unable to fetch item from backend" when entering IMAP folder
Product: [Frameworks and Libraries] Akonadi Reporter: Silver Salonen <silver.salonen>
Component: serverAssignee: kdepim bugs <kdepim-bugs>
Status: CONFIRMED ---    
Severity: normal CC: ab.kde, alarmfifa, aspotashev, bartoschek, BasRoufs, blizzz, bugs.kde.org.id324, bugs.kde, bugs, christian.lange.81, ctibor.brancik, devurandom, diego.ml, dvratil, emilsedgh, gaurav.p.chaturvedi, glua, gortab, ioaoue, jospoortvliet, kde, kdebugz.10.dubuit, kde_bugs, Kicer86, korossy, lindsay.mathieson, linux, lucabs2112, luis.davila.pc, lukast.dev, mail-kdebugs, mail, martin.tlustos, martin.vidmar, martin, mfraz74+kde, nicolas, niktischenko, olaf.the.lost.viking, pan1nx, paul_crook, peter, public, qcxhome, robby.engelmann, roland.leissa, sgh, shez, simone, spam, squan, stephan.diestelhorst, stueble, t.kijas, wolfgang, wstephenson
Priority: NOR    
Version: 4.9   
Target Milestone: ---   
Platform: OpenSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Output of akonadictl restart, as per request

Description Silver Salonen 2011-12-16 07:41:07 UTC
Version:           4.8 (using Devel) 
OS:                Linux

I upgraded KDE from 4.7.4 to 4.8 beta2. I have not used KMail for a while (I had tried it in 4.7 though) and I thought I'd give it a new try. I have 2 IMAP-accounts in there.
The problem is with folder "Nagios" which is a subfolder to "Auto" - when I try entering it, I get this error: Unknown error. (Unable to fetch item from backend)

The same error in console: kmail2(7238)/libakonadi Akonadi::EntityTreeModelPrivate::fetchJobDone: Job error:  "Unknown error. (Unable to fetch item from backend)"

Reproducible: Always

Steps to Reproduce:
Launch KMail, try entering the folder

Actual Results:  
I get the error and don't see folder's contents, it's not synchronized either (in folder list it shows me 278 new messages being in there, but actually it's empty)

Expected Results:  
Folder is syncrhonized and I see the contents of the folder
Comment 1 Pal Körössy 2011-12-18 16:17:41 UTC
Same here with OpenSUSE 12.1/KDE4.7.4
Comment 2 Samat Jain 2011-12-27 23:02:32 UTC
Seeing the same w/ Kubuntu 11.10 and KDE 4.8rc1.
Comment 3 Silver Salonen 2011-12-28 06:50:40 UTC
I got the same error also with 4.8rc1 and with folder Inbox.
Comment 4 Michał Kudła 2011-12-28 13:42:21 UTC
"Unknown error. (Unable to fetch item from backend)"
The same on IMAP INBOX folder - Gentoo / KDE 4.8 RC1
Comment 5 Søren Holm 2011-12-30 23:01:37 UTC
Me too,  4.8rc1 inbox folder.
Comment 6 Silver Salonen 2012-01-04 19:35:21 UTC
Happens also with rc2 (openSUSE packages).
Comment 7 goliash 2012-01-05 09:23:19 UTC
The same here. Fetching folder fails. Kubuntu 11.10, KDE 4.7.4.
Comment 8 Elias Probst 2012-01-05 22:19:33 UTC
I'm seeing the message "Unknown error. (Unable to fetch item from backend)" twice on each KDE/plasma-desktop startup, so I'd say it's not a KMail2 but an Akonadi issue.

The message comes from server/src/handler/fetchhelper.cpp, line 228.
Comment 9 Christophe Marin 2012-01-06 16:26:40 UTC
*** Bug 290133 has been marked as a duplicate of this bug. ***
Comment 10 desaparecido 2012-01-09 19:14:51 UTC
hi, In my case I use KDE 4.8 RC2 in Archilinux x64 with 3 imap disconnect gmail accounts, and I have this problem this morning :s, but only in one account (weird).  I can solve my problem to read my INBOX (only in this folder I had problems) deactivating INBOX folder in the config account menu, in Advanced Options, Server Side subscriptions, after "update folders and subfolders" in my account, and activate again INBOX and then, finally all works fine.  I don't know what is the real problem but is a workaround for someones.
Comment 11 boris64 2012-01-28 11:29:36 UTC
I'm still having the same problem with kde-4.8.0 (gentoo).
Using kmail2 atm is nearly impossible, as this 
message keeps popping up every 10(?) seconds while
switching between mail directories or reading mails.
Comment 12 boris64 2012-01-28 11:30:13 UTC
*** This bug has been confirmed by popular vote. ***
Comment 13 Peter Antoniac 2012-01-29 15:05:51 UTC
(In reply to comment #12)
> *** This bug has been confirmed by popular vote. ***

Haleluia!
Comment 14 Emil Sedgh 2012-02-02 20:45:34 UTC
*** Bug 284606 has been marked as a duplicate of this bug. ***
Comment 15 Will Stephenson 2012-02-05 09:51:33 UTC
Me too, will look into this next week.
Comment 16 Michael Holtermann 2012-02-12 12:35:07 UTC
Seeing this message, too, while clicking through folders in Akonadi Console.

1. click on a folder in "Browser" tab
2. See the debug messages for that resource in "Debugger"
3. wait for a "Unable to fetch item from backend" message box
--> Synchronization stops, folder remains empty.

Please see https://bugs.kde.org/show_bug.cgi?id=293893, I think Akonadi should become much more fault tolerant to be usable by normal users.
Comment 17 Michael Holtermann 2012-02-12 12:43:45 UTC
Could this be an issue with some size limit or a cache overflow or something like that?

Like above, I
1. selected a folder in "Browser"
2. waited for the error message
3. selected another folder which was fetched before (no new messages in Debug tab)
4. re-selected the folder in question
--> Akondi proceeds with fetch.

But I cannot correlate the issue with the number of mails between error messages nor with the size of a mail (time to need for download).

My error'd folder contains several thousand messages. How do I see which message causes the exception?
Comment 18 Martin Tlustos 2012-02-16 11:03:43 UTC
The underlying cause seems to be too little tolerance for network problems, because on my system those error message just explode when there is heavy network traffic (like uploading/downloadin stuff etc.)
Comment 19 Alexander Wauck 2012-02-22 23:10:45 UTC
I think this is caused by *any* delay in fetching mail, not just network-related delays.  I only see the dialog once: shortly after log-in, before I have typed my KWallet password.  Kontact/KMail is not running, but the Akonadi email stuff is (that's what causes the KWallet password dialog to appear).

On a somewhat related note, the error message is awfully vague.  It doesn't say what tried to do the fetching or what the backend is.  In my case, it appeared before I had "done anything", which means I had no real context in which to interpret the error message.

It's the error message equivalent of the dreaded "it doesn't work" bug report.
Comment 20 Kapcsándi István 2012-02-25 22:41:11 UTC
Same problem here.
I tried to restart the server (mysqld) from akonadiconsole, but it failed. 
Then I had to kill the mysqld process form console to  be able to restart the server (from akonadiconsole). After this, mail receiving went normal.
Comment 21 LukasT 2012-03-24 14:53:46 UTC
It happens here too.
Fedora 16/KDE 4.8.1
Comment 22 squan 2012-03-30 08:53:14 UTC
Today out of the blue (after system restart) my kmail2/akonadi combo (4.8.1, openSUSE factory) stopped working:
KMail still shows email folders and lists emails (so fetching IMAP email-headers still works) but it does not show any email contents.

So I tried do browse mail folders from akonadiconsole ("Browser" tab).
This fails for any of three IMAP accounts with
  "Unknown error. (Unable to fetch item from backend)"

Instead on the konsole where I started akonadiconsole I see ItemRetrieverException errors like
<snip>
posting retrieval request for item 309335  there are  1  queues and  0  items in mine 
request for item 309335 still pending - waiting 
processing retrieval request for item 309335  parts: ("RFC822")  of resource: "akonadi_imap_resource_1" 
continuing 
continuing 
request for item 309335 still pending - waiting 
request for item 315628 "595802" failed: "Unable to retrieve item from resource: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken." 
ItemRetrieverException :  Unable to retrieve item from resource: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
</snip>
<snip>
posting retrieval request for item 81098  there are  1  queues and  0  items in mine 
request for item 81098 still pending - waiting 
processing retrieval request for item 81098  parts: ("RFC822")  of resource: "akonadi_imap_resource_2" 
continuing 
request for item 81098 "1" failed: "Unable to retrieve item from resource: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken." 
ItemRetrieverException :  Unable to retrieve item from resource: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
</snip>

So I'm not sure wether it is bug 28909 or bug 285676 what I'm experiencing.
Comment 23 Rolf Eike Beer 2012-04-04 21:16:49 UTC
I see the very same error, but on 2 different "hosts":

#1: my N900. I'm using the KoMo packages from experiemental, updates at least once a week. Since I upgraded to the packages after the last build server outage (~4 weeks ago) I see this basically when entering any folder. Most often I'm asked immediately afterwards to enter my IMAP password once again, so this would match the previous comments about transfer delays.

#2: my desktop machine, running openSUSE 12.1 AMD64. This has never been a problem before (at least for me), but since todays upgrade to 4.8.2 I see this when I try to look into the inbox. Other folders work, I can even read mails there. But if I read a new mail there it will not be marked as read, I also can't delete emails. I quit Kontact and did "akonadictl stop" and waited for all processes to disappear, but this didn't help in any way.
Comment 24 Rolf Eike Beer 2012-04-09 15:12:00 UTC
The desktop machine shows this in akonadiconsole

10 FETCH 1:* ANCESTORS INF EXTERNALPAYLOAD (UID REMOTEID REMOTEREVISION COLLECTIONID FLAGS SIZE DATETIME PLD:ENVELOPE) 
10 NO Unable to fetch item from backend
Comment 25 Gaurav Chaturvedi 2012-05-05 13:20:03 UTC
I experienced this very same error on kubuntu 12.04 kmail version 4.8.2
Comment 26 jos poortvliet 2012-05-14 19:01:46 UTC
Running KDEPIM 4.8.3 here on openSUSE. This error started to become persistent recently - I saw it before but usually I could just restart akonadi and I could enter the folder again. Now, I'm stuck: can't use KMail at all as it simply doesn't load the Inbox and most other folders.

Moreover, updating doesn't work anymore, it doesn't fetch new mail. I've tried what I could in the akonadiconsole but no amount of fiddling makes it work. One thing I notice is that the resource goes in 'off-line' mode all the time. I can put it on-line but this has no effect and after less than 30 sec it's back to off-line.

The account in question is a GMail account (disconnected imap) with about 5 gb of mail, the inbox has about 30K messages, the rest is in folders. As I said, most folders work, some do not. Found no logic there - some small folders don't work, other large ones are fine.

The debugger in akonadiconsole doesn't seem to be able to give any meaningful hints. Upon putting the resource on-line and entering a folder which doesn't work, I often see something like this:
akonadi_imap_resource_0 (0xee5d30) 336 LSUB 7 0 (RESOURCE akonadi_imap_resource_0) (STATISTICS true ANCESTORS INF) 
akonadi_imap_resource_0 (0xee5d30) * 7 6 (NAME "INBOX" MIMETYPE (message/rfc822 inode/directory) REMOTEID "/INBOX" REMOTEREVISION "" RESOURCE "akonadi_imap_resource_0" MESSAGES 39438 UNSEEN 45 SIZE 2572135571 CACHEPOLICY (INHERIT true INTERVAL 15 CACHETIMEOUT -1 SYNCONDEMAND true LOCALPARTS (ENVELOPE HEAD RFC822)) ANCESTORS ((6 "imap://jospoortvliet@gmail.com@imap.gmail.com/") (0 "")) ENTITYDISPLAY "(\"Inbox\" \"mail-folder-inbox\" \"\" ())" collectionquota "5629677568 10742595584" imapquota " %%%% STORAGE % 10490816 %%%% STORAGE % 5497732" collectionannotations "/vendor/cmu/cyrus-imapd/sharedseen false" uidnext "138565" collectionflags "\\Answered \\Flagged \\Draft \\Deleted \\Seen $WATCHED $REPLIED receipt-handled $ATTACHMENT $TODO $QUEUED $SENT $IGNORED $ERROR $FORWARDED $has_cal $SIGNED $NOTJUNK \\*" uidvalidity "594632413" timestamp "1336591521") 
akonadi_imap_resource_0 (0xee5d30) 336 OK List completed 
AkonadiConsole Browser Widget (0xeeb0f0) 91 NO Unable to fetch item from backend 

The whole thing is very frustrating and timeconsuming (not even talking about the fact that without KMail I have to use GMail and it is just so much less efficient at handling large mail volumes). I hope someone can digg in and debug this... I'd be happy to help, ping me on IRC.
Comment 27 jos poortvliet 2012-05-14 19:06:26 UTC
*** Bug 299820 has been marked as a duplicate of this bug. ***
Comment 28 jos poortvliet 2012-05-14 19:07:56 UTC
Bug 299820 at https://bugs.kde.org/show_bug.cgi?id=299820 has some interesting information including what looks like a good way to reproduce. Shez suggests a possible cause might be related to filtering.

It's of course very well possible there are several causes leading to this same issue :(
Comment 29 Rolf Eike Beer 2012-05-14 19:54:52 UTC
I had no imap filters I knew of. Then I looked again and I have a filter named "unknown" with no rules. I deleted it, restarted Kontact, and it was back. So I edited it to be something valid, deactivated it and restarted akonadi. But nothing has changed.

On another machine I had one rule that never triggered and there everything works fine.
Comment 30 Shez 2012-05-15 07:59:52 UTC
Heya,

As noticed on the other ticket I raised, one thing I noticed is that clearing the akonadi agentcache via the akonadiconsole stops the error temporarily, which along with the KIMAP_LOGFILE output really does suggest that its about a mismatch between what messages kmail thinks are on the server, and which are actually on the server.  Messages being moved by filters is one mechanism which could cause this, I'm guessing from the above there are others as well...

Cheers
Shez
Comment 31 Christophe Marin 2012-05-18 21:08:03 UTC
(In reply to comment #30)
> Heya,
> 
> As noticed on the other ticket I raised, one thing I noticed is that
> clearing the akonadi agentcache via the akonadiconsole stops the error
> temporarily, which along with the KIMAP_LOGFILE output really does suggest
> that its about a mismatch between what messages kmail thinks are on the
> server, and which are actually on the server.  Messages being moved by
> filters is one mechanism which could cause this, I'm guessing from the above
> there are others as well...
> 
Please attach the KIMAP logfile to this report after removing any sensible data from it (login and/or password)
Comment 32 Chris 2012-05-22 07:34:57 UTC
The same problem here with INBOX and Kubuntu 12.04 based on Exchange 2010 and IMAP. This bug makes kmail unusable for me. Even deleting all akonadi configs and setting them up from scratch did not help (syncing worked fine the first time, but after a reboot the same problem again).

Chris
Comment 33 Roland Leißa 2012-05-23 08:01:22 UTC
I am also hit by this bug. 

Every time I log into kde I get like 3 of this messages. Those messages keep popping up quite frequently. Especially, when I'm using kontact. 

I'm pretty sure my case has to do with the following issue:
So after some time of using kmail, kmail thought some messages were "unread" although I've already read them. No matter what I did, after the next sync of the imap folder, kmail updated these messages as "unread". Then, I tried to "fix" this issue by deleting those messages on the server. Yes, this solved the unread-message-issue, but now I'm annoyed by those popup messages. I believe that akonadi still believes these messages are somewhere out.

Currently, I've got a similar issue regarding "unread" mail: akonadi thinks that one of my imap folders contains an unread messages. But there is no unread message. I don't see one in kmail nor on the server side. "Right click -> mark all messages as read" fixes this till the next sync of my folder.

I believe these mis-sync-issues can occur, when you are using akonadi *and* you are logged in to the server at the same time. Say, you sync with gmail and you are currently doing gmail-stuff in your browser.

Please let me know how to track down this (these?) bugs.
Comment 34 Roland Leißa 2012-06-01 06:53:41 UTC
After I've switched from networkmanager to wicd (for other reasons) all these problems magically faded.
Comment 35 Rolf Eike Beer 2012-06-02 18:10:58 UTC
I have seen this on my Laptop too when I was online using a slow GSM connection. The problems there went away when I waited long enough so the folder was fully synchronized. This is a bad situation as a partly synchronized mail seems to block the whole folder.

On my desktop I now tried to open my inbox folder using akonadiconsole which also failed, and this is everything I found in the log:

8 FETCH 1:* FULLPAYLOAD ANCESTORS INF EXTERNALPAYLOAD (UID REMOTEID REMOTEREVISION COLLECTIONID FLAGS SIZE DATETIME) 
8 NO Unable to fetch item from backend 

It always seems to fail on the same mail, when it starts synchronizing it always stops at 84% in INBOX. I have no idea which mail that is or how I can find out.
Comment 36 Bas Roufs 2012-06-07 16:48:31 UTC
I have had a the same problem in Kubuntu 12.04 along with KDE 4.8.3. 
A workaround that seems to work so far is simply restarting one or a few times. However, this might not be a structural solution.
Comment 37 ray-ven 2012-06-18 15:33:14 UTC
wrote the same at: https://bugs.kde.org/show_bug.cgi?id=293883#c8
Same in Kubuntu (Precise and oneiric) with KDE 4.7-4.9 Beta2 and at my girlfriend's laptop with her profile.
I don't know it it's the plasma-desktop itself (because the errormessage is sometimes related to plasma sometimes to kde), so I'm not really able to give usefull information.
I've set up a CalDav with multiple calendars, a google contacts ressource and a few IMAPs and akonadi notes.
From 4.7 to 4.8 I deleted all my akonadi stuff and set it up again - error still occours.
There are about 3 of these "Unable to fetch item from backend" on startup of KDE, and about 5 when starting Kontact, about 3 again when clicking on calendar in Kontact.
This is killing my nerves!!!!
What about just let plasma-notifications handle "Unable to fetch item from backend" instead of popups which have to be confirmed. The message itself doesn't help much anyway, because it doesn't tell me from which backend (ressource) the item can't be fetched.
I think this is somehow network-connection related, because with no active connection kalendar goes totally crazy with these messages and sometimes if the connection breaks while using kontact the amount of messages (in the notification-widget this time) is almost endless.
I doubt it but hope this delivers somebody useful information.

Ray
Comment 38 Rolf Eike Beer 2012-06-28 20:53:45 UTC
Our superhero Ben Cooksley pointed me to this thread in the forum:

http://forum.kde.org/viewtopic.php?f=215&t=101004&p=217754&hilit=akonadi+mysql+read+committed#p218172

That solved the error for me.
Comment 39 Silver Salonen 2012-07-03 20:38:06 UTC
Even if tweaking MySQL solves the problem, can this really be considered as a proper solution even for an average joe?
Comment 40 Rolf Eike Beer 2012-07-03 20:45:57 UTC
No, surely not. But for those stuck without a working KMail for months this 
could be a workaround. I would have been more than happy to find it here.

To cite a message from IRC to give some further context:

> if I recall the pimsters who are around have tried to solve that one,
> unfortunately the settings you need differ depending on the mysql in use
Comment 41 Luca 2012-07-04 08:34:16 UTC
This ("...added binlog_format=row after the first [mysqld]...") doesn't solve the problem for me. 
I don't use Kmail, only use CalDav for sync Google Calendar in Korganizer. I also notice that plasma crashes if the password in the networkmanager Wi-Fi configuration is wrong.

This only happen in KDE 4.8.4 for me. Not in KDE 4.8.3
Comment 42 Martín Traverso 2012-07-20 17:28:39 UTC
I got the same error and I try the "binlog_format=row" solution and it do not work for me. 
I have KDE 4.8.4 too.
Comment 43 ray-ven 2012-07-22 17:29:27 UTC
I think this has to do with CALDAV. I'm importing google contacts and calendar via caldav - afaik this is often a cause of "Unable to fetch item from backend"
Comment 44 Michael Holtermann 2012-07-22 17:32:50 UTC
(In reply to comment #43)
> I think this has to do with CALDAV

No, it hasn't. It appears in non-CALDAV environments as well.
Comment 45 jack 2012-07-25 13:53:38 UTC
(In reply to comment #38)
> Our superhero Ben Cooksley pointed me to this thread in the forum:
> 
> http://forum.kde.org/viewtopic.
> php?f=215&t=101004&p=217754&hilit=akonadi+mysql+read+committed#p218172
> 
> That solved the error for me.

worked for me too. thanks
Comment 46 jos poortvliet 2012-08-06 19:42:51 UTC
Didn't work for me - I really have to kquitapp kmail and start it again several times. Without a network connection, this often doesn't go away at all - quite annoying as it defeats the point of offline imap... :(

Anyway, found a few bugs that might be related:
#303175
#288364
#290317
#272543

I'll add a link to this bug from those...
Comment 47 jos poortvliet 2012-08-10 09:20:47 UTC
Aside from this solution:
edit ~/.local/share/akonadi/mysql.conf
Under the [mysql] section, please try adding:
binlog_format=row

What also works for me is to 'kquitapp kmail' and restart it. Make sure you have a working network connection and usually, after 1-2 restarts, things start working.

If things are stuck in sending mail, try to start 'akonadiconsole' and right-click on the Mail Dispatcher Agent, abort the current action (or toggle offline/online) and re-try sending the mails.

Just some tips - I also put them on userbase :D
Comment 48 andrew brewster 2012-08-16 20:09:20 UTC
Similar problems on Mageia 2 with KDE4.8.2.
One errror message on start-up from each of
KOrganizer - window title is 'Fetch Job Error - KOrganizer Reminder Daemon', error message is 'Unknown error (Unable to fetch item form backend)'
and
Plasma Desktop Shell - window title is 'Fetch Job Error - Plasma Desktop Shell', error message is the same.
The same happens after stopping and starting Akonadi using Akonaditray.
KMail on its own and within Kontact works OK and sends and receives e-mail from POP accounts without problems
Comment 49 Robby Engelmann 2012-08-17 10:23:28 UTC
still valid here in Kubuntu Quantal with KDE 4.9.0
Comment 50 Tom Kijas 2012-09-18 10:16:11 UTC
Still valid in Kubuntu 12.04 with KDE4.9.1
Comment 51 Anders Lund 2012-09-18 20:13:03 UTC
I'm hit by this in KDE 4.9.1 in archlinux - was not hit before this version.
Comment 52 Bas Roufs 2012-09-18 20:36:23 UTC
> I'm hit by this in KDE 4.9.1 in archlinux - was not hit before this version.
Hello Everybody,
the bug keeps hitting me at one netbook with a fresh install of  KDE 4.9.1 
along with Kubuntu 12.04.  At another netbook, with the same software, I found 
a "workaround" a few months ago: 
Step 1. Cleaning the GMAIL inbox and archiving everything I do not throw away;
Step 2. Carrying out serveral  times an e-mail check via Kontact, while 
sometimes restarting the system; by doing so during a few days, I get 
everything from GMAIL also in the Kontact IMAP folders.

Now, I am trying this workaround in this netbook. Later, I will tell wether it 
works out.

Respectfully yours,
BAS.
Comment 53 Chenxiong Qi 2012-09-19 03:46:01 UTC
Fedora 16 & KDE 4.8

I have two IMAP accounts, one is normal and the other crashes with this error message.
I walked around this problem by cleaning the password, then after reentering password, the account come back and works well.
Comment 54 ray-ven 2012-09-19 05:24:53 UTC
I had this problem just when starting kontact or starting the korganizer module in kontact.
It was totaly gone after i moved from webdav calendar and contacts to the designated google calender akonadi-plugin.
Comment 55 Diederik van der Boor 2012-10-01 13:59:04 UTC
In my case, the error was caused by the "Last search query" folder in KAddressBook. After removing that folder, the "Unable to fetch item from backend" error is gone.
Comment 56 Christian 2012-11-10 12:05:22 UTC
I get this everytime when starting Kontact (Kubuntu 12.04, KDE 4.8.5). The error pops up before I can enter my KWallet password, so I suppose it happens because kmail was not able to fetch mail or something because I was not able to enter my password before this action.
Comment 57 Andrea Scarpino 2012-11-10 12:21:14 UTC
I cannot reproduce it on 4.9.3
Comment 58 Rolf Eike Beer 2012-11-10 18:01:54 UTC
I recently got this error one some folders (some worked) when Wifi was switched off. The mail account is a dIMAP one, so I don't see any reason why it should fail. This are the messages from akonadiconsole debug mode:

AkonadiConsole Browser Widget (0x991d808) 29 SELECT SILENT 226 
AkonadiConsole Browser Widget (0x991d808) 29 OK Completed 
AkonadiConsole Browser Widget (0x991d808) 30 FETCH 1:* FULLPAYLOAD ANCESTORS INF EXTERNALPAYLOAD (UID REMOTEID REMOTEREVISION COLLECTIONID FLAGS SIZE DATETIME) 
AkonadiConsole Browser Widget (0x991d808) 30 NO Unable to fetch item from backend (collection 226, resource -1) 

AgentBase(akonadi_imap_resource_5): Das Element kann im Offline-Modus nicht geholt werden.

The last message is a translation of "Can't fetch the element in offline mode".
Comment 59 ioaoue 2013-01-07 21:39:47 UTC
I got the same error with 4.9.4 (Gentoo amd64) when entered one of IMAP folders on my server.
I think this can be caused by any unhandled message received from server. In my case the problem was with incorrect mailbox on the server. Akonadi-imap-resource received message "* OK Message 1 no longer exists" from cyrus-imap. This message wasn't handled by Job or FetchJob and thus caused RetrieveItemTask::cancelTask call from RetrieveItemTask::onContentFetchDone.
I think Akonadi should handle such messages correctly, maybe as warnings. I don't know if such errors can accure when a message was moved or deleted while Akonadi creates a request to read it.

Messages from akonadi in KIMAP_LOGFILE:
C: A000004 SELECT "INBOX.logs"
S: * 522 EXISTS
S: * 0 RECENT
S: * FLAGS ( \Answered \Flagged \Draft \Deleted \Seen KMAILFORWARDED KMAILTODO KMAILWATCHED KMAILIGNORED $FORWARDED $TODO $WATCHED $IGNORED )
S: * OK Ok [ PERMANENTFLAGS ( \Answered \Flagged \Draft \Deleted \Seen KMAILFORWARDED KMAILTODO KMAILWATCHED KMAILIGNORED $FORWARDED $TODO $WATCHED $IGNORED \* )  ]
S: * OK Ok [ UIDVALIDITY 1327548174  ]
S: * OK Ok [ UIDNEXT 1400  ]
S: * OK Ok [ HIGHESTMODSEQ 2783  ]
S: * OK Ok [ URLMECH INTERNAL  ]
S: A000004 OK Completed [ READ-WRITE  ]
C: A000005 EXPUNGE
S: A000005 OK Completed
C: A000006 SELECT "INBOX.logs"
S: * OK Ok [ CLOSED  ]
S: * 522 EXISTS
S: * 0 RECENT
S: * FLAGS ( \Answered \Flagged \Draft \Deleted \Seen KMAILFORWARDED KMAILTODO KMAILWATCHED KMAILIGNORED $FORWARDED $TODO $WATCHED $IGNORED )
S: * OK Ok [ PERMANENTFLAGS ( \Answered \Flagged \Draft \Deleted \Seen KMAILFORWARDED KMAILTODO KMAILWATCHED KMAILIGNORED $FORWARDED $TODO $WATCHED $IGNORED \* )  ]
S: * OK Ok [ UIDVALIDITY 1327548174  ]
S: * OK Ok [ UIDNEXT 1400  ]
S: * OK Ok [ HIGHESTMODSEQ 2783  ]
S: * OK Ok [ URLMECH INTERNAL  ]
S: A000006 OK Completed [ READ-WRITE  ]
C: A000007 FETCH 1:522 (FLAGS UID)
S: * 1 FETCH ( FLAGS (\Seen) UID 8 )
S: * 2 FETCH ( FLAGS (\Seen) UID 879 )
<...>
S: * 521 FETCH ( FLAGS (\Seen) UID 1398 )
S: * 522 FETCH ( FLAGS (\Seen) UID 1399 )
S: A000007 OK Completed ( 0.010 sec )
C: A000008 UID FETCH 8 (BODY.PEEK[] UID)
S: * OK Message 1 no longer exists
S: A000008 OK Completed ( 0.000 sec )
C: A000009 EXPUNGE
S: A000009 OK Completed

P.S. In my case this error belongs to "IMAP resource", not "server" component of Akonadi.
P.P.S. Sorry for my English.
Comment 60 Dimitrios Glentadakis 2013-01-24 11:48:40 UTC
I have this message since this morning. I could nt access mails and my events in korganizer calendars (google calendar) was missing. Reboot did nt help.

I deleted the folder with the last search in kmail, and now i am able to see my events in korganizer, and access the mails in kmail (gmail imap)
Comment 61 Dimitrios Glentadakis 2013-01-24 11:54:42 UTC
(In reply to comment #60)
> I have this message since this morning. I could nt access mails and my
> events in korganizer calendars (google calendar) was missing. Reboot did nt
> help.
> 
> I deleted the folder with the last search in kmail, and now i am able to see
> my events in korganizer, and access the mails in kmail (gmail imap)

Sorry, i have KDE 4.8.5 and Mageia 2
Comment 62 Nicolas Dumoulin 2013-05-27 07:25:50 UTC
In my situation, the workaround is:
 - open kontact
 - wait some seconds, close the error boxes « unable to fetch … »
 - open akonadi console
 - open the "browser" tab
 - select the concerned inbox
 - close again the error box
 - right-click on this inbox and select "clear akonadi cache"
 - right-click on this inbox and select "synchronize folder"
 - go back in kontact, all is fine (for me)
 - close akonadi console
Comment 63 Kamil Dziedzic 2013-05-27 08:17:15 UTC
For me it was to stop using kmail
Comment 64 Diego 2014-03-05 15:23:56 UTC
Out of statistics, is anybody encountering this with 4.11 or later?
Comment 65 Julian G 2014-03-05 17:50:24 UTC
me not, haven't seen it for months
Comment 66 desaparecido 2014-03-05 18:16:56 UTC
I had the same message some minutes before I post this message.  I still suscribed to bug-report and when I read the comment I see than one of my gmail-accounts was offline and the message was again there.  I stopped akonadi with akonadictl stop command, killall virtuoso-t, killall all kontact and restart them again and all works fine again.  Only akonadictl restart didn't enough. I have the latest update kde 4.12.3 (archlinux)
Comment 67 Dimitrios Glentadakis 2014-03-06 06:20:18 UTC
Since i updated to 4.11.4 (from 4.10.5) before 2 months, i didn't see the message again.
Comment 68 Alexander Wauck 2014-03-08 13:11:28 UTC
I'm on 4.12.2 on Arch here, and I haven't seen this in a long time.  I'll see if it's still gone with 4.12.3.
Comment 69 Alexander Wauck 2014-03-08 13:30:17 UTC
So far so good in 4.12.3.  Looking back at my previous comments, I wonder if it's because I'm going over WiFi?  It seems the problem was related to delays in getting the password, but now, I don't have a network connection until I type my password in KWallet, so I guess Akonadi won't even try to fetch mail until then.  I'll try it with just wired Ethernet.
Comment 70 Alexander Wauck 2014-03-08 13:33:25 UTC
Still no error message when booting with Ethernet plugged in and wireless disabled.  KWallet didn't come up until I started Kontact, but all was well despite the delay.
Comment 71 Alvise 2014-03-10 18:58:53 UTC
It happened to me once (only once but still once) with the latest KDE4.12.3 on opensuse 13.1
Comment 72 Alvise 2014-03-16 19:35:01 UTC
Now it happens almost every time. Still with 4.12.3
Comment 73 Michael Holtermann 2014-03-16 20:24:53 UTC
(In reply to comment #64)
> Out of statistics, is anybody encountering this with 4.11 or later?

Since this bug exists for over 2 years now, and apperantly no one dig into the code or the related processes to solve this issue. At least it's not documented here.

I'm pretty sure it won't vanish by itself :-)
Comment 74 Daniel Vrátil 2014-03-17 07:35:15 UTC
Please enable everything in kdebugdialog and run Akonadi from console (akonadictl restart), reproduce the issue and paste output from console here. Make sure all your agents are nnline (you can set them online in Akonadi Console "Agents" tab before restarting Akonadi from console).
Comment 75 Alvise 2014-03-18 21:31:22 UTC
Created attachment 85631 [details]
Output of akonadictl restart, as per request

Hi, here is the output of akonadictl restart. Manually launching the restart operation from console did not resolve the issue, whereas the following did:
-quit kontact
-launch akonadi server configuration utility
-click restart
Comment 76 Dimitrios Glentadakis 2014-04-01 04:06:16 UTC
I have kde 4.12.97, i have again the issue.
In the status bar i have the message:
3Unable to get item from backend (collection 0): Unable to retreive item from resource: NO PartTypeException: Invalid part type name.

I think that it happened after a resaearch that i did in the imap folder
Comment 77 Dimitrios Glentadakis 2014-04-01 04:21:06 UTC
I tried to delete the resource and recreate it but it didn't help
Comment 78 Wolfgang Rohdewald 2014-04-10 11:07:29 UTC
*** Bug 333266 has been marked as a duplicate of this bug. ***
Comment 79 Wolfgang Rohdewald 2014-04-10 11:19:45 UTC
some output of the akonadiconsole debugger fo akonadi_maildir_resource_0:

5877 UID FETCH 216586 CACHEONLY ANCESTORS INF EXTERNALPAYLOAD (UID COLLECTIONID FLAGS SIZE REMOTEID REMOTEREVISION DATETIME) 
* 216586 FETCH (UID 216586 REV 0 REMOTEID "1336633656.R350.i5:2,S" MIMETYPE "message/rfc822" COLLECTIONID 695 SIZE 7678 DATETIME "10-Jun-2012 10:09:43 +0000" FLAGS (\SEEN) ANCESTORS ((695 "kde") (681 "/home/wr/.local/share/local-mail") (0 ""))) 
5877 OK UID FETCH completed 
5878 UID STORE 216586 NOREV (REMOTEID "1336633656.R350.i5:2,S" SILENT PLD:HEAD[1] {3488} 
5878 NO PartTypeException: Invalid part type name.
Comment 80 Dimitrios Glentadakis 2014-04-10 18:37:56 UTC
(In reply to comment #79)
> 5878 NO PartTypeException: Invalid part type name.

Same message and it is solved with akonadi 1.12.1
https://bugs.kde.org/show_bug.cgi?id=332936
Comment 81 Arthur Schiwon 2016-01-20 18:32:52 UTC
I have not seen this for quite some time now. Probably fixed meanwhile, as suggested by Dimitrios. Close?
Comment 82 Dimitrios Glentadakis 2016-01-21 05:54:52 UTC
Yes close. I cannot help, i have switched to lxqt since 2 years
Comment 83 Alvise 2016-02-14 16:30:04 UTC
Surely not resolved!
I still have it with kmail 5.1.1
Comment 84 OlafLostViking 2016-04-16 11:03:33 UTC
Just hit this with kmail 5.1.3 from 15.12.3. "akonadictl fsck" and "akonadictl vacuum" seemed to solve it for one of my two IMAP accounts - as soon as I switch to the other account, it's going down for both of them again ;-). So it's somehow account related.

I have to manually stop akonadi, sometimes the mysqld, too, before another "akonadictl vacuum" command works again, btw... (hanging at "optimizing table PimItemTable..." forever if not restarting everything beforehand).
Comment 85 Simone Lazzaris 2016-12-22 08:46:47 UTC
I still see this bug in archlinux, kmail 5.4.0, akonadi 16.12