`rescue in rbuf_fill': Timeout::Error (Timeout::Error)

I am using the StorageRoom App Ruby Gem with the StorageRoom App API.
The following script is giving me a weird error:

#!/usr/bin/env ruby -rubygems

require File.join(File.dirname(FILE), ‘authentication’)

require “csv” # faster_csv (ruby 1.9)

lines = CSV.read(File.join(File.dirname(FILE), ‘karaoke.csv’)) #
Exported an Excel file as CSV

lines.slice!(0) # remove header line

collection = StorageRoom::Collection.find(‘collection ID’)
Song = collection.entry_class

lines.each do |row|
karaoke = Song.new(:artist => row[0], :song => row[1], :genre =>
row[2], :file =>
StorageRoom::File.new_with_filename("#{karaoke.artist}#{karaoke.song}.mov"))

if karaoke.save
puts “Misuero Karaoke Latino saved: #{karaoke.artist},
#{karaoke.song}, #{karaoke.genre}”
else
puts “Misuero Karaoke Latino could not be saved:
#{karaoke.errors.join(’, ')}”
end
end

And the error is:

/usr/local/lib/ruby/1.9.1/net/protocol.rb:140:in rescue in rbuf_fill': Timeout::Error (Timeout::Error) from /usr/local/lib/ruby/1.9.1/net/protocol.rb:134:inrbuf_fill’
from /usr/local/lib/ruby/1.9.1/net/protocol.rb:116:in readuntil' from /usr/local/lib/ruby/1.9.1/net/protocol.rb:126:inreadline’
from /usr/local/lib/ruby/1.9.1/net/http.rb:2219:in read_status_line' from /usr/local/lib/ruby/1.9.1/net/http.rb:2208:inread_new’
from /usr/local/lib/ruby/1.9.1/net/http.rb:1191:in transport_request' from /usr/local/lib/ruby/1.9.1/net/http.rb:1177:inrequest’
from /usr/local/lib/ruby/1.9.1/net/http.rb:1170:in block in request' from /usr/local/lib/ruby/1.9.1/net/http.rb:627:instart’
from /usr/local/lib/ruby/1.9.1/net/http.rb:1168:in request' from /usr/local/lib/ruby/gems/1.9.1/gems/httparty-0.8.1/lib/httparty/request.rb:73:inperform’
from
/usr/local/lib/ruby/gems/1.9.1/gems/httparty-0.8.1/lib/httparty.rb:391:in
perform_request' from /usr/local/lib/ruby/gems/1.9.1/gems/httparty-0.8.1/lib/httparty.rb:359:inpost’
from
/home/hanleyhansen/Desktop/thriventures-storage_room_gem-f7015ed/lib/storage_room/model.rb:69:in
block (2 levels) in create' from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:403:in_run__3801264735883484179__create__2558870880708463764__callbacks’
from
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:405:in
__run_callback' from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:385:in_run_create_callbacks’
from
/home/hanleyhansen/Desktop/thriventures-storage_room_gem-f7015ed/lib/storage_room/model.rb:68:in
block in create' from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:403:in_run__3801264735883484179__save__2558870880708463764__callbacks’
from
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:405:in
__run_callback' from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:385:in_run_save_callbacks’
from
/home/hanleyhansen/Desktop/thriventures-storage_room_gem-f7015ed/lib/storage_room/model.rb:67:in
create' from /home/hanleyhansen/Desktop/thriventures-storage_room_gem-f7015ed/lib/storage_room/model.rb:61:insave’
from import_csv.rb:17:in block in <main>' from import_csv.rb:14:ineach’
from import_csv.rb:14:in `’

I’m interested in learning why this error occurred as well as the
solution. Thanks in advance!

On Wed, Apr 4, 2012 at 6:41 PM, Hanley H. [email protected] wrote:

I am using the StorageRoom App Ruby Gem with the StorageRoom App API.
The following script is giving me a weird error:

[snip]

And the error is:

/usr/local/lib/ruby/1.9.1/net/protocol.rb:140:in `rescue in rbuf_fill’:
Timeout::Error (Timeout::Error)

[snip]

from /usr/local/lib/ruby/1.9.1/net/http.rb:1168:in `request’

Looks like your HTTP request is timing out. Are you trying this from
behind a proxy? If so you can set it using a class method on HTTParty
before calling the StorageRoom API.
Otherwise, look for other reasons why your connection is failing.

Regards,
Sean