-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"failed to move message" error after sending message #1667
Comments
What are you using to sync your messages? It seems that tool may be changing the message names. |
Since upgrade from original 1.4.1 to 1.4.3, I'm also seeing occasional
errors like this. It does seem to be some interaction between mu4e and
mbsync (seems to happen only when automated updated runs in the
background while either reading or composing a message - not sure yet,
error is intermittent enough to be tricky to track down/reproduce).
…--
Tim Cross
|
mbsync 1.3.1. The same tool I was successfully using before mu4e upgrade with the same mu4e configuration. |
Same combination of mbsync 1.3.1 (not recently changed or updated; worked previously) and recently updated mu(4e) 1.4.3. Same intermittent errors. Two recent samples:
and
|
I think I've made a little progress on this issue: it turns out that the server for mu4e is dropping the local Uid when renaming messages. It's easiest to see this with some unread messages. I.e. Messages retrieved by
|
mu4e only changes the base-part of the file-name when asked to so, with |
Can people still reproduce this with the latest (ie. >= 1.4.4)? |
Hi, I just run into similar issues. |
I noticed the similar thing as @cacology . If I keep the filename like the above, run This seems related to the OP's issue. |
Yes, if you have Anyway, can any of this be reproduced without invoking |
@djcb the change seems to have fixed it for me. (thank you! And thank you for a GREAT piece of software.) I was intermittently getting the "failed to move message" error too, which hasn't come back in the last ten-ish hours yet, nor has the escalating UIDs from Just to document my setup so that people trying to debug theirs can see what's different, I have both #!/bin/bash
while :
do
gtimeout --foreground 600 mbsync All
gtimeout --foreground 600 mu index
date
sleep 300
gtimeout --foreground 600 mbsync Periodic
gtimeout --foreground 600 mu index --lazy-check
date
sleep 300
gtimeout --foreground 600 mbsync Periodic
gtimeout --foreground 600 mu index --lazy-check
date
sleep 300
gtimeout --foreground 600 mbsync Periodic
gtimeout --foreground 600 mu index --lazy-check
date
sleep 300
gtimeout --foreground 600 mbsync Periodic
gtimeout --foreground 600 mu index --lazy-check
date
sleep 300
done |
Does |
But it was working fine in mu4e 1.2.0, so there is probably some change between 1.2.0 and 1.4.* that (probably indirectly) introduced the problem. |
@wedens (and other mbsync users): if you can point out the exact difference in what happens, that would be useful, since I don't use mbsync, i.e. on the filesystem level:
And you can try with (also see #1670). |
For what it's worth, I haven't run into these issues, using mbsync/isync, mu (always git version), and gmail. I update frequently and use mu4e a lot, but it's possible I missed some of the versions with the commits mentioned previously. mu4e does an update on a timer, and otherwise mbsync is run when new messages are detected (by goimapnotify). I have |
Adding in another data point: I experienced a similar issue to that described, but it was resolved with mu 1.4.6 (was on 1.4.3 previously). Previously results from `mu find "maildir:/some/INBOX" would not actually correspond to what mu4e would display. This would happen after I refiled/trashed/etc. (basically any message moved), and would persist until I reindexed outside of mu4e. |
Great, thanks for the testing. Closing this. |
I encountered a similar issue after sending every email with a setup with very frequent mbsync invocation via fswatch. Switching to mbsync's AltMap UID scheme (no U=* UID in file names) has mostly(?) solved the issue.
EDIT Feb 2, 2021. For the occasional "failed to move message: cannot read" error messages, I started using the following automatic invocation of ;; When this is encountered index cleanup to remove missing files from the index is necessary.
(defun my-mu4e-error-handler (errcode errmsg)
"Handler function for showing an error."
;; don't use mu4e-error here; it's running in the process filter context
(cl-case errcode
(4 (user-error "No matches for this search query."))
(t (cond
((string-match "failed to move message: cannot read" errmsg)
(let ((mu4e-index-cleanup t)
(mu4e-index-lazy-check t))
(mu4e-update-index)
(error "Error %d: %s" errcode errmsg)))
(t (error "Error %d: %s" errcode errmsg))))))
(advice-add #'mu4e-error-handler
:override #'my-mu4e-error-handler) |
Note also that extremely frequent mbsync calls can be problematic if you
fail to ensure that a previous mbsync call has completed before the next
one starts. This can occur if you have an external process performing
the mbsync and don't ensure a previous call has ended before starting
the next one. This can be particularly important if you have multiple
clients using imap for the same account (e.g. desktop and mobile
devices) as you can cause race conditions that can result in
inconsistent behaviour. If you have multiple clients all checking too
frequently, problems are likely.
I think it is important to remember email is not instant messaging. Some
delay in email delivery should be expected. While it is rarer these days
due to the speeds and connectivity of networks, the mail routing
protocol is designed to pass mail through multiple servers, sometimes
with significant delay between 'hops' (these days, there are typically
very few hops due to network connectivity).
I have found most (all?) of the issues I have had with mbsync can be
avoided if you ensure there are multiple minutes between mbsync calls
(at least 5 min - I use 15 min). This seems particularly important with
Microsoft's brand of imap.
I have also found the setting
(setq mu4e-change-filenames-when-moving t)
can be important for preventing uuid issues. This is also how clients
like mutt work by default.
…--
Tim Cross
|
Expected or desired behavior
After sending message and receiving new mail I can continue browsing my mail without errors.
Actual behavior
After sending a message and doing
mu4e-update-mail-and-index
I get an error when trying to open any message:And there is indeed no such file. But this file (same message, different flags?)
/home/wedens/Maildir/xxxx/sent/cur/1588217564.0d954d3a7860b217.wedens-pc,U=277:2,S
exists.If I close mu4e, do
mu index
(reports 1 cleaned-up message) and re-open mu4e, the problem disappears.This happens every time I send a message.
mu4e log (sanitized): mu4e.log
Steps to reproduce
mu4e-update-mail-and-index
Versions of mu, mu4e/emacs, operating system etc.
mu/mu4e: 1.4.1
emacs: 27.0.90
GNU/Linux (NixOS)
Any other detail
I've updated mu/mu4e to 1.4.1 from 1.2.0 recently and re-initialized mu database (
mu init
,mu index
). I didn't have such issue with 1.2.0.My mu4e configuration includes these vars that might be relevant:
(setq mu4e-index-cleanup nil)
,(mu4e-sent-messages-behavior . sent)
,(mu4e-change-filenames-when-moving . t)
.mu4e-index-cleanup
is set tonil
because one of mailboxes is not always mounted and I don't want to re-index it every time I mount it.The text was updated successfully, but these errors were encountered: