Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EOFError: end of file reached #46

Closed
JustinAiken opened this issue Dec 9, 2013 · 10 comments
Closed

EOFError: end of file reached #46

JustinAiken opened this issue Dec 9, 2013 · 10 comments
Milestone

Comments

@JustinAiken
Copy link

Seeing this behavior on both 0.5.0 and HEAD:

logger.info "HTTP.send(#{method},#{url},#{opts})"

#HTTP.send(get,http://127.0.0.1:3000/api/v1/agent_status/maximum_calls,{:params=>{:prospect_type=>:appointment}})

request = HTTP.accept(:json).with_response(:object).send(method, url, opts)
logger.info "request = #{request.inspect}"

#17:56:22 ahn.1  | [2013-12-09 17:56:22] INFO  TyphoeusHelper::SharedHydra: request = #<HTTP::Response/1.1 200 OK @headers={"Content-Type"=>"application/json; charset=utf-8", "Vary"=>"Accept-Encoding", "X-Ua-Compatible"=>"IE=Edge", "Etag"=>"\"64108005385238b566cf18d4efaa73f2\"", "Cache-Control"=>"max-age=0, private, must-revalidate", "X-Request-Id"=>"930be09be03d13110e09b6e9c0cae0c8", "X-Runtime"=>"0.058730", "Connection"=>"close", "Server"=>"thin 1.5.1 codename Straight Razor"}>

logger.info "body = #{request.body}"
#EOFError: end of file reached

(Don't mind the Hyrda stuff, switching from Typheous haven't renamed the classes yet)

@tarcieri
Copy link
Member

tarcieri commented Dec 9, 2013

Can you post the backtrace? (at least the parts happening inside the HTTP Gem itself)

@JustinAiken
Copy link
Author

Oh yes, certainly.. I guess my error reports get half-assed when leaving one place to head for another :p

17:56:22 ahn.1  | EOFError: end of file reached
17:56:22 ahn.1  |   /Users/jaiken/.rvm/gems/ruby-1.9.3-p448@talkbox/bundler/gems/http-a06f7893177a/lib/http/client.rb:86:in `readpartial'
17:56:22 ahn.1  |   /Users/jaiken/.rvm/gems/ruby-1.9.3-p448@talkbox/bundler/gems/http-a06f7893177a/lib/http/client.rb:86:in `block in perform'
17:56:22 ahn.1  |   /Users/jaiken/.rvm/gems/ruby-1.9.3-p448@talkbox/bundler/gems/http-a06f7893177a/lib/http/response.rb:117:in `call'
17:56:22 ahn.1  |   /Users/jaiken/.rvm/gems/ruby-1.9.3-p448@talkbox/bundler/gems/http-a06f7893177a/lib/http/response.rb:117:in `body'
17:56:22 ahn.1  |   /Users/jaiken/projects/phrg/nitro-talkbox/lib/typhoeus_helper.rb:13:in `process_request'
17:56:22 ahn.1  |   /Users/jaiken/projects/phrg/nitro-talkbox/lib/typhoeus_helper.rb:26:in `get'
17:56:22 ahn.1  |   /Users/jaiken/projects/phrg/nitro-talkbox/lib/agent_status_bridge.rb:34:in `run_get'
17:56:22 ahn.1  |   /Users/jaiken/projects/phrg/nitro-talkbox/lib/agent_status_bridge.rb:24:in `get_maximum_calls_for_prospect_type'
17:56:22 ahn.1  |   /Users/jaiken/projects/phrg/nitro-talkbox/lib/queue_call_loop/queue_worker.rb:22:in `tick'
17:56:22 ahn.1  |   /Users/jaiken/projects/phrg/nitro-talkbox/lib/queue_call_loop/plugin.rb:27:in `run'
17:56:22 ahn.1  |   /Users/jaiken/projects/phrg/nitro-talkbox/lib/queue_call_loop/plugin.rb:19:in `block in initialize'
17:56:22 ahn.1  |   /Users/jaiken/.rvm/gems/ruby-1.9.3-p448@talkbox/gems/celluloid-0.15.2/lib/celluloid/actor.rb:416:in `block in task'
17:56:22 ahn.1  |   /Users/jaiken/.rvm/gems/ruby-1.9.3-p448@talkbox/gems/celluloid-0.15.2/lib/celluloid/tasks.rb:55:in `block in initialize'
17:56:22 ahn.1  |   /Users/jaiken/.rvm/gems/ruby-1.9.3-p448@talkbox/gems/celluloid-0.15.2/lib/celluloid/tasks/task_fiber.rb:13:in `block in create'

@JustinAiken
Copy link
Author

Also, here's a curl for comparison if it helps:

jaiken@firefly➜ nitro-talkbox git:(develop) ✗ curl -i "http://127.0.0.1:3000/api/v1/agent_status/maximum_calls?prospect_type=appointment"
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Vary: Accept-Encoding
X-UA-Compatible: IE=Edge
ETag: "64108005385238b566cf18d4efaa73f2"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 6b2f03df1b7a0953789b4beb8bd93412
X-Runtime: 0.059008
Connection: close
Server: thin 1.5.1 codename Straight Razor

{"maximum_calls":0}%

@tarcieri
Copy link
Member

It's likely it simply isn't properly handling EOFError here. We've been moving to encapsulate all these things as SocketErrors, but it looks like this case was missing.

Thanks for the report. It should be easy to fix.

@blambeau
Copy link
Contributor

Observing the same behavior here (possibly when Content-Length is not set on response headers).

The following fix, that I use so far, seems to work: blambeau@b967bf9

Unfortunately, I'm currently unable to run the tests on my computer...

@tarcieri
Copy link
Member

tarcieri commented Mar 4, 2014

Should we merge blambeau@b967bf9 ?

@sferik
Copy link
Contributor

sferik commented Mar 4, 2014

@tarcieri 👍

@tarcieri
Copy link
Member

tarcieri commented Mar 4, 2014

Boom: 78036f3

Call this one good then?

@sferik sferik closed this as completed Mar 4, 2014
@sferik
Copy link
Contributor

sferik commented Mar 4, 2014

@JustinAiken Please re-open if this issue continues to occur in HEAD.

@tarcieri
Copy link
Member

tarcieri commented Mar 4, 2014

@blambeau thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants