Subject: [sup-talk] Exception

From: [email-masked] (Marc Weber)
Date: Fri, 24 Jul 2009 18:35:15 +0200

Hi, when either running sup-sync or sup (without -n) I get this
exception:

--- NoMethodError from thread: poll after loading inbox
undefined method `to_indexable_s' for nil:NilClass
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/index.rb:244:in `sync_message'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/util.rb:513:in `send'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/util.rb:513:in `method_missing'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/poll.rb:161:in `add_messages_from'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/source.rb:100:in `each'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/util.rb:552:in `send'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/util.rb:552:in `__pass'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/util.rb:539:in `method_missing'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/poll.rb:141:in `add_messages_from'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/poll.rb:98:in `do_poll'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/poll.rb:86:in `each'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/poll.rb:86:in `do_poll'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/poll.rb:85:in `synchronize'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/poll.rb:85:in `do_poll'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/util.rb:513:in `send'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/util.rb:513:in `method_missing'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/modes/poll-mode.rb:17:in `poll'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/poll.rb:53:in `poll'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/util.rb:513:in `send'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/util.rb:513:in `method_missing'
/home/marc/.nix-profile/gems/sup-0.8.1/bin/sup:206
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup.rb:71:in `reporting_thread'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup.rb:69:in `initialize'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup.rb:69:in `new'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup.rb:69:in `reporting_thread'
/home/marc/.nix-profile/gems/sup-0.8.1/bin/sup:206
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/modes/thread-index-mode.rb:663:in `call'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/modes/thread-index-mode.rb:663:in `__unprotected_load_threads'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/modes/thread-index-mode.rb:605:in `call'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/modes/thread-index-mode.rb:605:in `load_n_threads_background'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup.rb:71:in `reporting_thread'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup.rb:69:in `initialize'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup.rb:69:in `new'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup.rb:69:in `reporting_thread'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/modes/thread-index-mode.rb:603:in `load_n_threads_background'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/modes/thread-index-mode.rb:673:in `__unprotected_load_threads'
(eval):12:in `load_threads'
/home/marc/.nix-profile/gems/sup-0.8.1/bin/sup:206
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/bin/.sup-wrapped:19:in `load'
/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/bin/.sup-wrapped:19

Do you see what's happening here or shall I start debugging?

The sup-sync exception trace looks like this:

/nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/index.rb:244:in `sync_message': undefined method `to_indexable_s' for nil:NilClass (NoMethodError)
        from /nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/util.rb:513:in `send'
        from /nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/util.rb:513:in `method_missing'
        from /nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/poll.rb:161:in `add_messages_from'
        from /nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/source.rb:100:in `each'
        from /nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/util.rb:552:in `send'
        from /nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/util.rb:552:in `__pass'
        from /nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/util.rb:539:in `method_missing'
        from /nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/poll.rb:141:in `add_messages_from'
        from /nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/util.rb:513:in `send'
        from /nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/gems/sup-0.8.1/lib/sup/util.rb:513:in `method_missing'
        from /home/marc/.nix-profile/gems/sup-0.8.1/bin/sup-sync:140
        from /home/marc/.nix-profile/gems/sup-0.8.1/bin/sup-sync:135:in `each'
        from /home/marc/.nix-profile/gems/sup-0.8.1/bin/sup-sync:135
        from /nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/bin/.sup-sync-wrapped:19:in `load'
        from /nix/store/cg3g3wyz2bibk8zc5ykhdyr2a166x87l-sup-0.8.1/bin/.sup-sync-wrapped:19

Marc Weber

---

From: [email-masked] (William Morgan)
Date: Mon, 27 Jul 2009 09:41:05 -0700

> undefined method `to_indexable_s' for nil:NilClass

Weird. It looks like a date parsing issue, but I'm having a hard time
seeing where the logic fails such that no date field is set.

Can you try applying the following patch, and then running sup-sync with
-v? I'm hoping that the debugging output prefixed with XX will provide a
clue.

Thanks!

--- a/lib/sup/message.rb
+++ b/lib/sup/message.rb
@@ -92,11 +92,14 @@ class Message
       begin
         Time.parse date
       rescue ArgumentError => e
-        #Redwood::log "faking mangled date header for #{@id} (orig #{header['da
+        Redwood::log "faking mangled date header for #{@id} (orig #{header['dat
         Time.now
       end
-    else
-      #Redwood::log "faking non-existent date header for #{@id}"
+    end
+
+    @date ||= begin
+      Redwood::log "XX original header was #{header["date"].inspect}"
+      Redwood::log "XX faking non-existent date header for #{@id}"
       Time.now
     end

-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (Marc Weber)
Date: Mon, 27 Jul 2009 18:55:46 +0200

You're right. I fixed it today by running sup-sync. (I was still reading
my mails that's why I didn't respond earlier).
I used p m at that location to get a message output saying something
about offset is out of sync. Then I tried sup-sync -c.

The strange thing is that I didn't open the mbox file using another
program such as mutt. Maybe a locking issue or such ? I'm using
procmail.

I was surprised how easy it was to find the cause after starting looking
into it.

Thanks for taking the time sending this patch!

Marc Weber