BadIMAPResponseError: "Cannot find saved message"
Hello, I've just started using Spambayes 1.1a2, and I'm quite happy with it (I had been using the Outlook plugin until now). However, I'm seeing an intermittent problem with sb_imapfilter.py. It will routinely crash while talking to the IMAP server, and always with the same error message: Traceback (most recent call last): File "/usr/bin/sb_imapfilter.py", line 1284, in ? run() File "/usr/bin/sb_imapfilter.py", line 1266, in run imap_filter.Filter() File "/usr/bin/sb_imapfilter.py", line 1067, in Filter self.unsure_folder, self.ham_folder) File "/usr/bin/sb_imapfilter.py", line 970, in Filter msg.Save() File "/usr/bin/sb_imapfilter.py", line 723, in Save raise BadIMAPResponseError("recent", "Cannot find saved message") __main__.BadIMAPResponseError: The command 'recent' failed to give an OK response. Cannot find saved message Usually it'll run OK for a day or two, but sometimes for just a few hours before crashing. If I don't notice for a while and messages pile up in the inbox without being classified, Spambayes will sometimes crash before classifying a dozen or less messages, when I start it again. I've tried training several times, and have never seen this error; it's only appeared when classifying. Also, the server runs Courier IMAP, but I don't know the version. I'm using IMAP over SSL, on port 993. I found that I'm not the first person to see this error message: http://mail.python.org/pipermail/spambayes-dev/2004-November/003232.html I ran imapfilter with -i4 as suggested there, and saw the following just before the crash. The pattern repeats what looks like 100 times - I see a loop in the code at line 717, I guess this loop fails against my IMAP server sometimes. 06:50.02 untagged responses dump: MYRIGHTS: ""acdilrsw"" EXISTS: "31" "33" "34" "35" PERMANENTFLAGS: "(\* \Draft \Answered \Flagged \Deleted \Seen)" READ-WRITE: "" FLAGS: "(\Draft \Answered \Flagged \Deleted \Seen \Recent)" APPENDUID: "1063604858 55181" "1063604858 55182" "1063604858 55183" "1063604858 55184" "1077921887 9359" UIDVALIDITY: "1063604858" 06:50.02 > GFNI156 NOOP 06:50.03 < GFNI156 OK NOOP completed Now, this run was after a few messages had piled up since the last time Spambayes had crashed. Here's what looks like happened: messages 1-19 in the INBOX were previously classified. New messages were 20-31. Spambayes classified messages 20-24, the first four were ham and the last was spam. The messages were written out OK; 32-35 are copies of the ham with added headers, and the spam ended up in the spam folder. So if I'm reading the output right, Spambayes was looking for messages 31, 33, 34, and 35. That looks odd - if 32-35 were just written out, why is Spambayes querying message 31 and not 32? The full output is attached; hopefully it can help. -- Thanks for any help, Matt Stegman
Matt Stegman <matts@ksu.edu> writes:
Hello,
I've just started using Spambayes 1.1a2, and I'm quite happy with it (I had been using the Outlook plugin until now). However, I'm seeing an intermittent problem with sb_imapfilter.py. It will routinely crash while talking to the IMAP server, and always with the same error message:
Traceback (most recent call last): File "/usr/bin/sb_imapfilter.py", line 1284, in ? run() File "/usr/bin/sb_imapfilter.py", line 1266, in run imap_filter.Filter() File "/usr/bin/sb_imapfilter.py", line 1067, in Filter self.unsure_folder, self.ham_folder) File "/usr/bin/sb_imapfilter.py", line 970, in Filter msg.Save() File "/usr/bin/sb_imapfilter.py", line 723, in Save raise BadIMAPResponseError("recent", "Cannot find saved message") __main__.BadIMAPResponseError: The command 'recent' failed to give an OK response. Cannot find saved message
Usually it'll run OK for a day or two, but sometimes for just a few hours before crashing. If I don't notice for a while and messages pile up in the inbox without being classified, Spambayes will sometimes crash before classifying a dozen or less messages, when I start it again. I've tried training several times, and have never seen this error; it's only appeared when classifying. Also, the server runs Courier IMAP, but I don't know the version. I'm using IMAP over SSL, on port 993.
I found that I'm not the first person to see this error message:
http://mail.python.org/pipermail/spambayes-dev/2004-November/003232.html
And not the last either. I can confirm that I've seen the same effect. Unfortunately, IIRC, nobody is actively maintaining sb_imapfilter.py because none of the spambayesians really understands IMAP well. We need someone who understands the protocol to fix these things. -- Dave Abrahams Boost Consulting www.boost-consulting.com
David Abrahams <dave@boost-consulting.com> writes:
I found that I'm not the first person to see this error message:
http://mail.python.org/pipermail/spambayes-dev/2004-November/003232.html
And not the last either. I can confirm that I've seen the same effect.
Unfortunately, IIRC, nobody is actively maintaining sb_imapfilter.py because none of the spambayesians really understands IMAP well. We need someone who understands the protocol to fix these things.
I believe this may be due to a race condition as described in http://mail.python.org/pipermail/python-list/2004-March/213029.html which might explain why http://mail.python.org/pipermail/spambayes-dev/2004-November/003235.html says that adding debugging output cures the problem. It's probably safe when training, but I just lost a whole lotta messages when classifying because of this bug :( -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (2)
-
David Abrahams -
Matt Stegman