Subject: Re: [sup-devel] turnsole crash on start up

From: William Morgan <[email-masked]>
Date: Wed, 04 May 2011 16:18:39 +0000

Reformatted excerpts from Hamish's message of 2011-05-02:
> Any ideas? Does heliotrope have a console like sup that I could try
> tracking down which message this would be? (I'm using maildir in case
> it makes a difference).

I suspect these are both the same issue---the date for a particular
thread is being set to false instead of to an integer.

I've added bin/heliotrope-console, which is a simple wrapper around irb.
You can see if you can track it down that way. In the meantime I'll
scour the codebase and see if I can find an obvious culprit, or at least
add some protection code.

Thanks for the bug report!
-- 
William <[email-masked]>
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Hamish <[email-masked]>
Date: Mon, 02 May 2011 23:17:56 +0100

I've finally got around to playing with turnsole, and it crashes out
immediately :/

$ ruby1.9.1 -Ilib -I../heliotrope/lib bin/turnsole 
/home/mish/dev/sup/turnsole/lib/turnsole/models.rb:88:in `at': can't convert String into an exact number (TypeError)
        from /home/mish/dev/sup/turnsole/lib/turnsole/models.rb:88:in `initialize'
        from /home/mish/dev/sup/turnsole/lib/turnsole/client.rb:34:in `new'
        from /home/mish/dev/sup/turnsole/lib/turnsole/client.rb:34:in `block (2 levels) in search'
        from /home/mish/dev/sup/turnsole/lib/turnsole/client.rb:34:in `map'
        from /home/mish/dev/sup/turnsole/lib/turnsole/client.rb:34:in `block in search'
        from /home/mish/dev/sup/turnsole/lib/turnsole/ui.rb:76:in `call'
        from /home/mish/dev/sup/turnsole/lib/turnsole/ui.rb:76:in `step'
        from bin/turnsole:134:in `<main>'

I tried in the web browser, and a search appears to work fine (and is
impressively quick :) for a couple of terms I tried. But when I click on
the inbox link, I go to URL:

http://localhost:8042/search?q=~inbox

and get a big old error page :( The relevant parts are:

TypeError at /search
false can't be coerced into Fixnum
file: heliotrope-server location: - line: 377

[snip]

bin/heliotrope-server in -
377.    date = escape_html Time.at(thread[:date]).strftime("%Y/%m/%d %H:%M")
bin/heliotrope-server in strftime
377.    date = escape_html Time.at(thread[:date]).strftime("%Y/%m/%d %H:%M")
bin/heliotrope-server in threadinfo_to_html
377.    date = escape_html Time.at(thread[:date]).strftime("%Y/%m/%d %H:%M")
bin/heliotrope-server in block (2 levels) in <class:HeliotropeServer>
157.        results.map { |r| threadinfo_to_html r }.join +
bin/heliotrope-server in map
157.        results.map { |r| threadinfo_to_html r }.join +
bin/heliotrope-server in block in <class:HeliotropeServer>
157.        results.map { |r| threadinfo_to_html r }.join +
/usr/lib/ruby/1.9.1/webrick/httpserver.rb in service
111.      si.service(req, res)
/usr/lib/ruby/1.9.1/webrick/httpserver.rb in run
70.          server.service(req, res)
/usr/lib/ruby/1.9.1/webrick/server.rb in block in start_thread
183.          block ? block.call(sock) : run(sock)

[snip]

Any ideas? Does heliotrope have a console like sup that I could try
tracking down which message this would be? (I'm using maildir in case it
makes a difference).

Hamish Downer