Error on gmail sync

Antoine Levitt antoine.levitt at gmail.com
Wed May 25 15:34:51 BST 2011


25/05/11 16:19, Sebastian Spaeth
> On Wed, 25 May 2011 14:12:29 +0200, Antoine Levitt wrote:
>> > This is an inconsistency between your LocalStatus cache and the
>> > UIDMapping file, mapping between the Gmail UIDs and the local IMAP UID,
>> > in folder facebook.
>> 
>> I think it's in INBOX : the UIDMapping for facebook doesn't go to such
>> high numbers as 5281. The fact that it displays "syncing facebook" just
>> before bugging out is probably due to threading (I have maxconnections=2)
>
> Yeah, it could also be inbox if you have threading enabled. We should
> probably improve our error logging here.
>
>> > Somehow, it expects that you have a message with UID 5281 in our
>> > facebook/LocalStatus file, which you apparently don't, so it craps out.
>> >
>> > Check the ~/.offlineimap/Repository-LocalXXX/UIDMapping/facebook file and
>> > search for occurences of 5281 (delete the line if it is in there).
>> 
>> The problem is not limited to a particular folder : I get it whenever I
>> get new mail. I deleted one of the lines responsible for a crash, but
>> it still keeps crashing.
>
> Right, but whenever you sync, you go through all mails for all
> folders. So you will hit each folder for each new mail.
>
> Does it still keep crashing looking for the same UID (5281) or for
> different UIDs. Make sure the UID is neither in the UIDMapping/* file,
> nor in the LocalStatus/* file, those two files need to be in sync with
> each other.

No, different UID each time, the one of the message just retrieved. The
UID is not in any of those two before the sync.

>  
>> Is there any way to get out of this, or do I need to "reset" the sync?
>> More importantly, any idea how this happened?
>
> I have no idea how it happened, perhaps offlineimap was interrupted at a
> very inconvenient point in time? I don't like the split of our cache in
> those 2 files and believe we should keep them in just one file, writing
> them out at the same time.

That's definitely a possibility: offlineimap is unreliable, so I wrap it
in the following script

#!/bin/bash
DELAY_OFFLINEIMAP=60
killall offlineimap
while true
do
    (offlineimap || offlineimap) &
    PID=$!
    sleep $DELAY_OFFLINEIMAP && (kill $PID || kill -9 $PID)
done

>
> Generally, *I* would recommend to use IMAP<->Maildir synchronization
> whenever possible, it is much more robust than the IMAP<->IMAP mapping.
> The latter needs much more love and care.

I need my mail on a dovecot server. Dovecot does store its mail in
maildir format, but IIRC it's a slightly different one and I can't just
synchronize the gmail imap into the dovecot maildir.




More information about the OfflineIMAP-project mailing list