Issue #927: Intermittent Twitter::Error::ClientError - end of file reached errors being hit by number of Twitter Gem devs in last day or so...

Please have a look at:

https://github.com/sferik/twitter/issues/370

https://github.com/sferik/twitter/issues/369

and

https://github.com/sferik/twitter/issues/354

Various solutions (disable HTTPS, change default HTTP adaptor via setting a custom middleware stack, using gem 'faraday', '0.9.0.pre' [https://github.com/sferik/twitter/issues/354#issuecomment-14140759], and switching between tokens [https://github.com/sferik/twitter/issues/370#issuecomment-15191639] have been tried. They sometimes work.

As I am writing up this issue, here's the identical results I'm getting on two different macs (a imac 2009, os upgraded repeatedly and a MBP Retina, bought 2 months ago):

thetweets = Twitter.search('git', :count => 10, :lang => "en", :result_type => "recent") -- works

thetweets = Twitter.search('1git', :count => 10, :lang => "en", :result_type => "recent") -- Twitter::Error::ClientError: end of file reached

Ran the same on other similar terms - "got" worked, "1got" did not.

BTW, All searches returned results in twitter.com in browser.

I can't see how, especially when switching tokens and repeating the request worked that this can be some sort of error out here. ---> [https://github.com/sferik/twitter/issues/370#issuecomment-15191639]

Regards,
Bob Walsh
[email protected]

Updates

Underlying cause is that "Accept-Encoding: gzip" and "Connection: close" requests trim the trailing 0 chunk size from the resulting "Transfer-Encoding: chunked" response, making it look like the connection was closed before the entire response was read, even though in reality no data is missing. We will be implementing a fix for this behavior.