Bug 222600 - Akonadi IMAP shows error message "Unknown error. (Invalid collection name)" upon every start
Summary: Akonadi IMAP shows error message "Unknown error. (Invalid collection name)" u...
Status: RESOLVED WORKSFORME
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: IMAP resource (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Kevin Ottens
URL:
Keywords: akonadi-ports-regression
Depends on:
Blocks: 223438
  Show dependency treegraph
 
Reported: 2010-01-13 22:29 UTC by Dennis Schridde
Modified: 2015-10-29 09:03 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
akonadi console debug ouptut for faulty imap (2.71 KB, application/octet-stream)
2011-12-13 18:33 UTC, Thijs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Schridde 2010-01-13 22:29:47 UTC
Version:           4.4_rc1 / 4.3.90 (using Devel)
Compiler:          gcc 4.4.2 Gentoo 4.4.2 p1.0
OS:                Linux
Installed from:    Compiled sources

Upon every start of Akonadi, the IMAP resource shows the error message popup "Unknown error. (Invalid collection name)". The title is the mailserver address and my username, which is how I figured it must be akonadi_imap_resource showing the message.
Comment 1 Kevin Ottens 2010-01-25 18:04:01 UTC
Never happened to me.
Comment 2 Dennis Schridde 2010-01-26 09:56:39 UTC
Excuse me for being rude, but "Never happened to me" seems like a very bad reaction upon a report from a user who really experiences the issue he mentions. It's not as if someone is lying to create more useless work for you...
So to sum it up: The issue happened to me.
Comment 3 Kevin Ottens 2010-01-26 10:08:23 UTC
The thing is I can't seem to reproduce it, and tried hard, so definitely WORKSFORME IMO. But if you prefer I can mark it NEEDSINFO as I definitely need much more precise procedure to try to reproduce it than "I start it and it blows".

Don't think that because I was concise in my message I didn't spent time to try to reach the problem. ;-)
Comment 4 Dennis Schridde 2010-01-28 00:56:25 UTC
I gave Akonadi/IMAP another chance in 4.3.95/4.4_rc2, this is what the debugger says when I do a sync-all on the imap resource:
68 CREATE "" 141 (MIMETYPE (message/rfc822 inode/directory) REMOTEID "/" CACHEPOLICY (INHERIT true))
68 NO Invalid collection name
69 ROLLBACK
69 OK Rollback completed
70 HRID LSUB ((-152 "/INBOX") (-153 "imap://.../") (0 "")) 0 (RESOURCE akonadi_imap_resource_1) ()
70 NO Hierarchical RID does not specify a unique collection

I will file a seperate bugreport on the issue with transaction 70.
Comment 5 Dennis Schridde 2010-01-28 01:10:19 UTC
I'll also give you 65-67 for completeness:
65 BEGIN
65 OK Begin completed
66 LSUB 0 INF (RESOURCE akonadi_imap_resource_1) (ANCESTORS 1)
66 OK List completed
67 CREATE "..." 0 (MIMETYPE (inode/directory) REMOTEID "..." AccessRights "" noselect "1" CACHEPOLICY (INHERIT false INTERVAL 5 CACHETIMEOUT -1 SYNCONDEMAND true LOCALPARTS (ENVELOPE HEAD RFC822)))
* 141 0 (NAME "..." MIMETYPE (inode/directory) REMOTEID "..." RESOURCE "akonadi_imap_resource_1" CACHEPOLICY (INHERIT false INTERVAL 5 CACHETIMEOUT -1 SYNCONDEMAND true LOCALPARTS (ENVELOPE HEAD RFC822)) AccessRights "" noselect "1")
67 OK CREATE completed

The imap resource was freshly recreated after updating to 4.4_rc2.
Comment 6 Dennis Schridde 2010-01-28 01:20:22 UTC
The same thing (error message window and LSUB 0, CREATE "resource-name", CREATE "") just happened on another machine, also freshly recreated imap resource after update to 4.4_rc2, using the same imap account on the same server.
Comment 7 Dennis Schridde 2010-02-10 19:59:46 UTC
This bug is independend of the server-side subscriptions setting, it seems. I first thought that the issues appear only after enabling them, but they do not vanish when disabling that.
Comment 8 Dennis Schridde 2010-03-27 12:39:00 UTC
Now on Kubuntu 10.04_beta1 / KDE 4.4.1 I get a similar issue when trying to synchronise the akonadi_imap_resource (after fixing up the database creation manually, see launchpad-bug #448705):
 [/usr/bin/akonadi_imap_resource] akonadi_imap_resource_0(9320) ImapResource::onIdleCollectionFetchDone: CollectionFetch for mail box "INBOX" failed. error= 103 , errorString= "Unknown error. (Hierarchical RID does not specify a unique collection)"

( https://bugs.launchpad.net/ubuntu/+source/akonadi/+bug/448705 )
Comment 10 Dennis Schridde 2010-03-27 12:46:42 UTC
akonadi-server 1.3.1-0ubuntu1
Comment 11 Dennis Schridde 2010-03-27 12:52:06 UTC
The issue related to launchpad-bug #448705 comment #16 seems to be the same as bug #224552. Providing more details there.
Comment 12 Till Adam 2010-05-09 21:08:07 UTC
What kind of server is this using, gmail, by any chance?
Comment 13 Dennis Schridde 2010-05-09 21:15:26 UTC
Dovecot 1.2, own installation.
Comment 14 Thijs 2011-12-13 18:33:40 UTC
Created attachment 66702 [details]
akonadi console debug ouptut for faulty imap

Just to fish up old bugs: My work mail has the same issue (gmail works fine). True for Fedora16/KDE 4.7.3 as well as Arch/KDE4.8b2.
The funny thing is: this is from a naked install. Things used to be OK, when working from an old install, and then running through the migrator. I might dig up an old setup somewhere, run the migrator, and see what goes.
Comment 15 Ryan Nowakowski 2012-02-05 18:50:56 UTC
This error message should be improved to include more specific information.  For example, which collection name is invalid?
Comment 16 Stefan Vater 2012-02-15 14:01:15 UTC
Hi,

I just got the same error message while creating a new IMAP ressource in kmail2 from KDE SC 4.8.0. The Error log from akonadiconsole is (with some private information modified):

akonadi_imap_resource_7 (0x81a6a0) 49 BEGIN 
akonadi_imap_resource_7 (0x81a6a0) 49 OK Begin completed 
akonadi_imap_resource_7 (0x81a6a0) 50 LIST 0 INF (RESOURCE akonadi_imap_resource_7) (ANCESTORS 1) 
akonadi_imap_resource_7 (0x81a6a0) 50 OK List completed 
akonadi_imap_resource_7 (0x81a6a0) 51 CREATE "TEST" 0 (MIMETYPE (inode/directory) REMOTEID "imap://me.here@mailer.test.de/" REMOTEREVISION "" AccessRights "" noselect "1" CACHEPOLICY (INHERIT false INTERVAL 5 CACHETIMEOUT -1 SYNCONDEMAND true LOCALPARTS (ENVELOPE HEAD RFC822))) 
akonadi_imap_resource_7 (0x81a6a0) * 366 0 (NAME "TEST" MIMETYPE (inode/directory) REMOTEID "imap://me.here@mailer.test.de/" REMOTEREVISION "" RESOURCE "akonadi_imap_resource_7" CACHEPOLICY (INHERIT false INTERVAL 5 CACHETIMEOUT -1 SYNCONDEMAND true LOCALPARTS (ENVELOPE HEAD RFC822)) AccessRights "" noselect "1") 
akonadi_imap_resource_7 (0x81a6a0) 51 OK CREATE completed 
akonadi_imap_resource_7 (0x81a6a0) 52 CREATE "INBOX" 366 (MIMETYPE (message/rfc822 inode/directory) REMOTEID "/INBOX" REMOTEREVISION "" ENTITYDISPLAY "(\"Posteingang\" \"mail-folder-inbox\" \"\" ())" CACHEPOLICY (INHERIT true)) 
akonadi_imap_resource_7 (0x81a6a0) * 367 366 (NAME "INBOX" MIMETYPE (message/rfc822 inode/directory) REMOTEID "/INBOX" REMOTEREVISION "" RESOURCE "akonadi_imap_resource_7" CACHEPOLICY (INHERIT true INTERVAL 5 CACHETIMEOUT -1 SYNCONDEMAND true LOCALPARTS (ENVELOPE HEAD RFC822)) ENTITYDISPLAY "(\"Posteingang\" \"mail-folder-inbox\" \"\" ())") 
akonadi_imap_resource_7 (0x81a6a0) 52 OK CREATE completed 
akonadi_imap_resource_7 (0x81a6a0) 53 CREATE "Trash" 367 (MIMETYPE (message/rfc822 inode/directory) REMOTEID "/Trash" REMOTEREVISION "" CACHEPOLICY (INHERIT true)) 
akonadi_imap_resource_7 (0x81a6a0) * 368 367 (NAME "Trash" MIMETYPE (message/rfc822 inode/directory) REMOTEID "/Trash" REMOTEREVISION "" RESOURCE "akonadi_imap_resource_7" CACHEPOLICY (INHERIT true INTERVAL 5 CACHETIMEOUT -1 SYNCONDEMAND true LOCALPARTS (ENVELOPE HEAD RFC822)) ) 
akonadi_imap_resource_7 (0x81a6a0) 53 OK CREATE completed 
akonadi_imap_resource_7 (0x81a6a0) 54 CREATE "Junk" 367 (MIMETYPE (message/rfc822 inode/directory) REMOTEID "/Junk" REMOTEREVISION "" CACHEPOLICY (INHERIT true)) 
akonadi_imap_resource_7 (0x81a6a0) * 369 367 (NAME "Junk" MIMETYPE (message/rfc822 inode/directory) REMOTEID "/Junk" REMOTEREVISION "" RESOURCE "akonadi_imap_resource_7" CACHEPOLICY (INHERIT true INTERVAL 5 CACHETIMEOUT -1 SYNCONDEMAND true LOCALPARTS (ENVELOPE HEAD RFC822)) ) 
akonadi_imap_resource_7 (0x81a6a0) 54 OK CREATE completed 
akonadi_imap_resource_7 (0x81a6a0) 55 CREATE "Drafts" 367 (MIMETYPE (message/rfc822 inode/directory) REMOTEID "/Drafts" REMOTEREVISION "" CACHEPOLICY (INHERIT true)) 
akonadi_imap_resource_7 (0x81a6a0) * 370 367 (NAME "Drafts" MIMETYPE (message/rfc822 inode/directory) REMOTEID "/Drafts" REMOTEREVISION "" RESOURCE "akonadi_imap_resource_7" CACHEPOLICY (INHERIT true INTERVAL 5 CACHETIMEOUT -1 SYNCONDEMAND true LOCALPARTS (ENVELOPE HEAD RFC822)) ) 
akonadi_imap_resource_7 (0x81a6a0) 55 OK CREATE completed 
akonadi_imap_resource_7 (0x81a6a0) 56 CREATE "" 367 (MIMETYPE (message/rfc822 inode/directory) REMOTEID "/" REMOTEREVISION "" CACHEPOLICY (INHERIT true)) 
akonadi_imap_resource_7 (0x81a6a0) 56 NO Invalid collection name 
akonadi_imap_resource_7 (0x81a6a0) 57 ROLLBACK 
akonadi_imap_resource_7 (0x81a6a0) 57 OK Rollback completed 
akonadi_imap_resource_7 (0x81a6a0) 58 HRID LSUB ((-799 "/INBOX") (-800 "imap://me.here@mailer.test.de/") (0 "")) 0 (RESOURCE akonadi_imap_resource_7) (ANCESTORS INF) 
akonadi_imap_resource_7 (0x81a6a0) 58 NO Hierarchical RID does not specify a unique collection 

I suspect that either akonadi is reading a wrong collection tree from the server or the collection tree of the server is somehow strange, because there is a collection with an empty name. Can this make trouble to akonadi?

If you need any further information, please ask.

Stefan
Comment 17 Stefan Vater 2012-02-21 18:25:29 UTC
Hi,

there is a patch for a similar, if not the same, problem in bug 258342. Please check if that solves your problem and report it here!

Stefan
Comment 18 Dennis Schridde 2012-02-21 20:04:22 UTC
I have not experienced the issue in a while. But then I have neither looked at the inner workings of Akonadi in a while either. It appears to be more or less working in KDE 4.8.0 - there are several bugs and error messages, but they do not seem to be much of a hindrance. Suggesting RESOLVED/FIXED if you are confident about the patch you mentioned, or CLOSED/WORKSFORME otherwise.
Comment 19 Kevin Ottens 2012-03-16 11:51:04 UTC
Putting it back as works for me then. I think that was the initial resolution.

Cheers!
Comment 20 Max Mopp 2014-12-19 17:52:26 UTC
Although this is old: Does NOT work with a server name with a dash ("-")
user@test-server.com
Cheers as well!

(In reply to Kevin Ottens from comment #19)
> Putting it back as works for me then. I think that was the initial
> resolution.
> 
> Cheers!
Comment 21 Aitor Oliveira 2015-10-29 09:03:21 UTC
Hi,

I encountered this problem adding a group email account from Exchange through davmail, using:
akonadi-server 1.13.0-2ubuntu
kontact 4:4.14.6-0ubuntu
davmail 4.6.2-2377-1

I don't have akonadiconsole's full log, but the error was like:
akonadi_imap_resource_10 (0x7e6gd1) 170 CREATE "" 0 (MIMETYPE (inode/directory) REMOTEID "/" REMOTEREVISION "" CACHEPOLICY (INHERIT true))
akonadi_imap_resource_10 (0x7e6gd1) 170 NO Invalid collection name

I guess akonadi should handle the empty CREATE "", even if it should not receive an empty name.
I'm not a developer but with a simple modification it works for me:

user@pc:~/src$ apt-get source akonadi-server
user@pc:~/src$ cd akonadi-1.13.0/
user@pc:~/src/akonadi-1.13.0$ cp -p server/src/handler/create.cpp server/src/handler/create.cpp.orig
user@pc:~/src/akonadi-1.13.0$ vim server/src/handler/create.cpp
user@pc:~/src/akonadi-1.13.0$ diff -c server/src/handler/create.cpp.orig server/src/handler/create.cpp                                                                                                                                                                                                 
  {                                                                                                       
    QString name = m_streamParser->readUtf8String();                                                      
    if ( name.isEmpty() ) {                                                                               
!     return failureResponse( "Invalid collection name" );
    }
  
    bool ok = false;
--- 56,65 ----
  {
    QString name = m_streamParser->readUtf8String();
    if ( name.isEmpty() ) {
!     //return failureResponse( "Invalid collection name" );
!     std::string str = "empty";
!     name = QString::fromStdString(str);
    }
  
    bool ok = false;
user@pc:~/src/akonadi-1.13.0$ sudo apt-get build-dep akonadi-server
user@pc:~/src/akonadi-1.13.0$ debuild -us -uc -b

Now KMail receives folders and emails successfully. And there is the "empty" folder:
Inbox
...
empty
    users
        email@company.com
...

The same account, thunderbird shows:
Inbox
...
/users
    email@company.com
...

I hope this helps to fix this problem.