Bug 379692 - UnknownMessageIndex: Got FETCH that is out of bounds
Summary: UnknownMessageIndex: Got FETCH that is out of bounds
Status: RESOLVED UPSTREAM
Alias: None
Product: trojita
Classification: Unmaintained
Component: IMAP (show other bugs)
Version: git
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Trojita default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-10 12:30 UTC by Erik Quaeghebeur
Modified: 2017-05-19 11:22 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
slightly redacted connection log (49.19 KB, text/plain)
2017-05-10 12:30 UTC, Erik Quaeghebeur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Quaeghebeur 2017-05-10 12:30:57 UTC
Created attachment 105431 [details]
slightly redacted connection log

When opening a FastMail mailbox (their Cyrus fork) to which a large number of mails are being copied to (from local storage, using KMail), I get:

UnknownMessageIndex: Got FETCH that is out of bounds -- got 918 messages FETCH 919 ( FLAGS "\Recent $X-ME-Annot-2" UID "919")

Trying again gives the same issue, only the numbers are different, i.e, higher, because more messages have been added.

This may be a duplicate of Bug 377416 if the problem is Trojita's and not the server's.
Comment 1 Jan Kundrát 2017-05-10 14:57:46 UTC
This looks like a bug in the server.

Here's the relevant part of the log:

14:08:35.66612  <<<  * 918 EXISTS
14:08:35.66612  <<<  * 379 RECENT
14:08:35.66612  <<<  y9 OK Completed (0.002 sec)
14:08:35.67712  >>>  y11 UID FETCH 918:* (FLAGS)
14:08:35.75912  <<<  * THREAD [...]
14:08:35.76012  <<<  y10 OK Completed (918 msgs in 0.033 secs)

At this point, the server let us know that there's 918 messages in total, their MSNs are ( by definition) 1-918. So far, so good.

14:08:35.91312  <<<  * 918 FETCH (FLAGS (\Recent $X-ME-Annot-2) UID 918)

This one was also reasonable -- the server let us know about an update of the last message's flags. That is nice.

14:08:35.91312  <<<  * 919 FETCH (FLAGS (\Recent $X-ME-Annot-2) UID 919)
14:08:35.91312  <<<  * 919 EXISTS

But here's the bug -- the IMAP server sent a FETCH FLAGS about a message with MSN 919, but it didn't let us know that there was an arrival before. EXISTS must be sent prior to FETCH.

14:08:35.91312  <<<  * 380 RECENT
14:08:35.91312  <<<  y11 OK Completed (0.001 sec)

I've notified a friend who works for FastMail about this.
Comment 2 Erik Quaeghebeur 2017-05-10 15:03:05 UTC
(In reply to Jan Kundrát from comment #1)
> I've notified a friend who works for FastMail about this.
To avoid confusion on the FM side: this is support ticket 2393752.
Comment 3 Bron Gondwana 2017-05-10 22:53:16 UTC
Yep, I've replied on the FastMail ticket and I'm chatting to other Cyrus devs about it.  First step will be building a test!

Bron.
Comment 4 Erik Quaeghebeur 2017-05-19 11:22:56 UTC
Got word it was fixed at FastMail.