tags:

views:

502

answers:

2

I am running windows XP with ruby 1.8.6 patchlevel 111. I am using HTTP to connect to a remote server and it has been running fine. All of a sudden it started to through the exception listed below (I did not change any code since the last time I ran it successfully). Does anybody know what is going on?

c:/ruby/lib/ruby/1.8/timeout.rb:54:in `rbuf_fill': execution expired (Timeout::E
rror)  
        from c:/ruby/lib/ruby/1.8/timeout.rb:56:in `timeout'  
        from c:/ruby/lib/ruby/1.8/timeout.rb:76:in `timeout'  
        from c:/ruby/lib/ruby/1.8/net/protocol.rb:132:in `rbuf_fill'  
        from c:/ruby/lib/ruby/1.8/net/protocol.rb:116:in `readuntil'  
        from c:/ruby/lib/ruby/1.8/net/protocol.rb:126:in `readline'  
        from c:/ruby/lib/ruby/1.8/net/http.rb:2029:in `read_status_line'  
        from c:/ruby/lib/ruby/1.8/net/http.rb:2018:in `read_new'  
        from c:/ruby/lib/ruby/1.8/net/http.rb:1059:in `request'  
         ... 19 levels...  
        from c:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:216:in `run'  
        from c:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:12:in `run'  
        from c:/ruby/lib/ruby/1.8/test/unit.rb:278  
        from c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader
.rb:5  
rake aborted!  
Command failed with status (3): [c:/ruby/bin/ruby -Ilib;test "c:/ruby/lib/r...]
+1  A: 

Maybe the remote host is down? Or a new firewall has been put between your machine and the remote host?

"Timeout::Error" usually points to that direction.

Vinko Vrsalovic
+1. The only time this error comes up is when the net is down, or is clogged up and it takes too long to get the response. I believe the default timeout is 5 seconds which is a bit low
Orion Edwards
A: 

besides the obvious (firewall, you got blacklisted for bad user-agent or ignoring robots.txt), you can try curl

http://curl.haxx.se/libcurl/ruby/

OR increase net/http timeout to say, 30+ seconds

http://groups.google.com/group/rubyonrails-talk/msg/cc89e8ae6703d6fb

Gene T