mbsync error: UID is beyond highest assigned UID

2.7k Views Asked by At

I'm using emacs 24.5.1 on OSX with mu4e and mbsync. I'm synchronising with my imac and laptop so maybe it's the same error as mentioned here, but no one has posted a solution.

My specific error is that during the sync I'm receiving the following:

mbsync error: UID is 3 beyond highest assigned UID 1
mbsync error: UID is 7 beyond highest assigned UID 6

Any ideas on what's causing this and how to solve it?

4

There are 4 best solutions below

0
On

I had a similar issue with a quite big inbox with lots of nested folders. I wanted to go for the solution @unhammer provided but I had a hard time finding the problematic message. (grepping UID didn't help because I had tons of e-mails with the same UID). What I did was to note the number of the problematic box.

C: 0/1  B: 133/162  M: +0/0 *0/0 #0/0  S: +0/0 *0/0 #0/0
Maildir error: UID 22 is beyond highest assigned 

Then I ran with verbose option mbsync -V mymailchannel. The verbose option outputs so much information quite quickly. But I knew where to stop, so I stopped when we passed the number 133. (Of course, you can write it to a file and just grep it with the few lines above).

And there was my problematic folder:

C: 0/1  B: 133/262  M: +0/0 *0/0 #0/0  S: +0/0 *0/0 #0/0
Opening master box INBOX/my_folder/2020/my_other_folder...
Opening slave box INBOX/my_folder/2020/my_other_folder...
Loading master...
Loading slave...
Maildir error: UID 22 is beyond highest assigned UID 21.

And stipped off everything from ,U=22 in my problematic file as @unhammer suggested and my problem was fixed.

3
On

I was able to fix this by editing the .uidvalidity file in the folder(s) in question; the second line is the maximum value U= filename. So I just changed this to match and it synced perfectly.

0
On

In yourMaildir/INBOX/cur folder (or Maildir/otherfolder/cur), there'll be a file named something like 1568901502.26338_1.hostname,U=3:2,S. You can strip off everything from the ,U= from that filename and resync and it should be fine, e.g.

mv '1568901502.26338_1.hostname,U=3:2,S' '1568901502.26338_1.hostname'

This also solves the duplicate UID error. See http://tiborsimko.org/mbsync-duplicate-uid.html for more info.

This has worked for me – but since mbsync doesn't do it automatically there may be some good reason, so take a backup before you try :)

0
On

Try this:

(setq mu4e-change-filenames-when-moving t)

If that doesn't work, you can do what I did and start over by creating a new mu4e Mail folder and resyncing everything. Your messages will just download to the new folder with new UID's.