-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 #369
Comments
Furthermore, changing the adapter to :excon seems to result in a different error. In an initializer:
On requesting the same non existing user:
|
I'm getting the same thing using ruby 2.0. Is this related to #354? I see not everyone got resolution on that one... |
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. |
@stuliston Thanks for the notes. Looks promising. I'll give it a go when I get to my desk. |
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? |
@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. |
@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. |
@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 |
@sferik You're right. Sounds good. |
you might want to see #370 (comment) |
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:
The text was updated successfully, but these errors were encountered: