Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upEOFError: end of file reached #369
Comments
This comment has been minimized.
This comment has been minimized.
|
Furthermore, changing the adapter to :excon seems to result in a different error. In an initializer:
On requesting the same non existing user:
|
This comment has been minimized.
This comment has been minimized.
stuliston
commented
Mar 20, 2013
|
I'm getting the same thing using ruby 2.0. Is this related to #354? I see not everyone got resolution on that one... |
This comment has been minimized.
This comment has been minimized.
stuliston
commented
Mar 20, 2013
|
Sorry guys, scratch that. I went through @sferik's advice from #354 again and this timeI'm getting results, meaning it's a net/http issue. The steps were: Adding typhoeus to my gemfile:
Then changing the default http adapter like so:
Sorry for the trouble. @timhaines, I hope that works for you, too. |
This comment has been minimized.
This comment has been minimized.
|
@stuliston Thanks for the notes. Looks promising. I'll give it a go when I get to my desk. |
This comment has been minimized.
This comment has been minimized.
|
I can confirm that the advice in #354 solves my test case problems (I use excon instead of typhoeus) @sferik I think it would be worth changing the default adapter (or getting to the root cause and making the Twitter gem work around it). A 2nd suggestion would maybe be to update the readme to show what's required to change the adapter - i.e. the full list of middleware required. Although this would be a poor solution going forward, as it means one addition to the default and everyone needs to update. Perhaps allow of the adapter to be adjusted independently? |
This comment has been minimized.
This comment has been minimized.
|
@timhaines I have mixed feelings about changing the default adapter. I do agree, it should be easier to override the default Faraday middleware. I'll work on a patch that does just that for the next minor version. |
This comment has been minimized.
This comment has been minimized.
|
@sferik I understand the mixed feelings on changing the default. My argument would be that getting Net::HTTP fixed is going to require a new release to ruby itself. There's likely to be many people who for some reason or another would be reluctant to update their version of Ruby for this. I suppose having it more easily overridable would be a good solution for those not willing to update their Ruby though. However, that would still mean the Twitter gem is broken by default for those on older Ruby. |
This comment has been minimized.
This comment has been minimized.
|
@timhaines This doesn't seem to be happening on every request, just certainrequests. If I change your example URL: -https://api.twitter.com/1.1/users/show.json?user_id=33978
+http://api.twitter.com/1.1/users/show.json?user_id=33978…the error no longer occurs. If I can better understand the circumstances under which this error occurs, then I may be able to fix it in this library, either by modifying the existing code (e.g. adding middleware to correct the error) or monkey patching |
This comment has been minimized.
This comment has been minimized.
|
@sferik You're right. Sounds good. |
timhaines
closed this
Mar 20, 2013
veesahni
referenced this issue
Mar 20, 2013
Closed
getting -sometimes- Twitter::Error::ClientError: end of file reached #370
This comment has been minimized.
This comment has been minimized.
BobWalsh
commented
Mar 20, 2013
|
you might want to see #370 (comment) |
timhaines commentedMar 19, 2013
By default the Twitter gem uses Net::HTTP right? It seems there's some sort of problem under certain unknown conditions that Net::HTTP doesn't handle responses from Twitter, and returns the 'end of file reached' error.
Here's a reproducible scenario on getting a user with a dud id, and no auth. Excon handles it well: