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
Error APPEND -> BAD (invalid argument: unable to parse message) since 6.5.7rc2 #172
Comments
No more trace? |
I'm using the Master branch which lists itself as 6.5.7rc2. Offlineimap doesn't crash - it just gives the error I listed above and continues then repeats the error the next time it checks (again without crashing). My remote repository is Gmail and my local is Zarafa IMAP. I'm a noob so can you be more specific about what "git bisect" is and what you need me to do? Thanks. |
Please, run a session with |
Also, please check with current |
I installed the "next" version and still have the issue. When I run On Sun, Feb 22, 2015 at 6:31 AM, Nicolas Sebrecht notifications@github.com
|
On Sun, Feb 22, 2015 at 11:00:35AM -0800, mobamoba wrote:
It goes only to stdout unless you use Nicolas Sebrecht |
Debug log attached as a zip file. I replaced my password with ###### and my On Sun, Feb 22, 2015 at 5:20 PM, Nicolas Sebrecht notifications@github.com
|
There is no attachement. Consider https://gist.github.com/. |
The file was too large for gist. I've put it on my Google Drive: |
There was no error with this session. |
Try with -d all and redirect outputs: |
Relevant logs for further digging:
This looks like a bug in imaplib2, I'm forwarding to the maintainer. |
The traceback doesn't include the offending APPEND whose arguments are invalid. Any chance of getting a much longer traceback (the part shown is just the logout handshake induced by the error)? |
I'm still getting the error so if you tell me what you need me to do in order to get a longer traceback for you, I'm happy to do it. |
@johnmolyneux : did you looked at https://drive.google.com/file/d/0B6XtuCxhp2HCcVhlNmc1eGxqSVE/view?usp=sharing ? |
Apologies - didn't notice the full debug file. I've now looked at it and I'm no wiser. There are several APPEND commands, all substantially identical that worked fine before the last one failed. They all take the form "XXXXX APPEND SMS (\Seen) {1}\r\n" where XXXXX is the IMAP4 command tag. So, I'd guess that this is not an imaplib2 bug, but something else. One thing struck me and that is that for any particular IMAP4 instance the first 4 letters of the tag are always the same, so for instance this log shows a session starting with the tag FKFI, but the errant APPEND has quite a different tag. Hope that helps. |
Should have looked harder. There are multiple sessions in that log, each ending with an APPEND error, so that explains the different tags. Each APPEND command is well formed as per the IMAP4 spec, as is the data written, so I'm not sure why the error is 'Invalid Arguments', unless it is that the RFC specifies that the literal argument "SHOULD be in the format of an [RFC-2822] message" - which isn't the case here. |
Yes, I should have told you it's a multi-sessions logs. What stuck me most is that everything goes fine for the same IMAP server on the other sessions and this same error is raised (at some random time) and is reproducible. @mobamoba : could you please run |
The remote type Gmail and is imap.gmail.com:993 and the Local is localhost:143 (I used Zarafa for my local IMAP). Do you need more info than that? |
@mobamoba Could you try to bisect this issue? (http://offlineimap.github.io/doc/git-bisect.html) |
I got this:
:100644 100644 a05dec2c0406ed95a5c7a75cd8af723523e088a5 4a4db93996f20f6c667c69b4ba7b4ccc1ae47655 M Changelog.rst |
@konvpalto : could you please look at this? |
So, the message gets refused by the server because it couldn't parse the headers correctly.
|
Okay. But how do I know which messages are the offending ones, i.e. how do I find them in my email? |
From the logs. One current mail in the
|
Here's the unsatisfying resolution to this (unsatisfying because it doesn't tell you anything about the source of the bug): I did what you said and moved emails from one folder to another in chunks. Unfortunately (from the POV of bug-hunting), moving the email solved the problem. In other words, somehow the act of copying emails from one folder to another then copying them back to the original folder eliminated the error. I'm not really sure how moving an email somehow fixes a header issue, but it did. So the bottom line is I now really have no idea which emails were causing the original problem because the effort to figure that out (moving to another folder then back) fixed the problem. Would moving an email fix a malformed header? |
Indirectly, yes it looks like it did. Moving a mail of a folder means you re-upload the mail to the remote in the "other" folder. We add headers (what you bisected) at upload time of a "new" message. Though, I was expecting the same issue to be fully reproductible and raise again. Now, I must understand WHY the issue did not reproduce where it should have. IOW, you have the same message on disk (filename changed), same methods applied on it, same content changes expected on it, same remote server, different results... Weird! |
Totally weird. However, I'm guessing I'll have this error again, so it may be worth leaving this thread open because maybe I'll be able to get a narrower date range next time and just look at the headers and see if I see anything missing or off. The reason I think it'll happen again is because I reported this issue on 2/21; I first started by moving all emails from that folder prior to 2/21 into a different folder; this reduced the error count from 4 to 2, which means that I got this error twice more after initially reporting it. Here's one thought though: the error is in my SMS folder, which is the folder I use to backup text messages from my phone. The program I use is SMS Backup+ (https://play.google.com/store/apps/details?id=com.zegoggles.smssync&hl=en), which sends my SMSes to my local (Zarafa) IMAP. Perhaps this program is occasionally creating an incorrect header or conflicting with Offlineimap in some way. Of course, this doesn't explain why moving the email would fix the header, but maybe the source is somewhere between these two programs? |
Will know more with the headers. I keep this open. Thanks. |
Okay so this error happened again and I managed to track it in time to figure out which message was causing it. It's on my local but won't sync to Gmail because of that APPEND error. Here are the headers from the offending message (with personally identifiable stuff x'ed out). Does this help at all? Subject: SMS with xxxxxxxx |
I don't see any problem in these headers. You could try by removing one header line at a time to track down the offender. |
How do I remove headers from an email I've already received in order to do that? Also, I checked other emails of the same kind and they all the have the same headers and sync perfectly, so perhaps it's not a header issue. But it's definitely something with that particular email as that's the one that generates that APPEND error. Is there some other tool that could better debug the problem with that email? |
Could you send this offending mail to me privately? |
Sure there's really nothing all that private in it. Where should I forward it to? |
By mail, or a gist if it doesn't hurt. |
I'm not actually sure how to attach an email to a gist. The text of the email was nothing - "Check out this video on Youtube" along with a Youtube link. I mentioned above that I use a program on my phone that backs up my SMS messages via IMAP and this was one of those messages. In fact all of the messages that generated this error are from that same SMS backup folder. |
A little update to this: I get the exact same error when trying to sync an email with a very large attachment, one that's larger than the send or receive limit on one of the IMAP servers. I don't know if that helps as the original error pointed to an email that was very tiny and with no attachments, just a link, but I thought I'd let you know I'd seen it again in a different context. |
On Sat, May 09, 2015 at 08:56:09AM -0700, mobamoba wrote:
Always good to have more info. Nicolas Sebrecht |
Any news on this? |
I haven't seen this error in a while and knock wood it's gone for good. |
Ok, thanks for the feedback. |
I've been using Offlineimap for a few years and, since going to from 6.5.6. to 6.5.7rc2, I've started receiving the following error message when syncing one of my folders to Gmail:
Establishing connection to imap.gmail.com:993
ERROR: Saving msg ([unknown message-id]) folder 'SMS', repo 'Remote'failed (error). Server responded: APPEND command error: BAD ['Invalid Arguments: Unable to parse message']. Data: LIGG20 APPEND SMS (\Seen) {1}
Message content was: 4
ERROR: Saving msg ([unknown message-id]) folder 'SMS', repo 'Remote'failed (error). Server responded: APPEND command error: BAD ['Invalid Arguments: Unable to parse message']. Data: OJOA7 APPEND SMS (\Seen) {1}
Message content was: 4
The text was updated successfully, but these errors were encountered: