# NET::HTTP read\_nonblock rbuf\_fill errors

**URL:** <https://www.ruby-forum.com/t/net-http-read-nonblock-rbuf-fill-errors/259511>\
**Category:** Ruby-Forum\
**Created:** [May 7, 2020, 9:55pm UTC](https://www.ruby-forum.com/t/net-http-read-nonblock-rbuf-fill-errors/259511 "2020-05-07T21:55:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubynewbee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/74df32/32.png) [@rubynewbee](https://www.ruby-forum.com/u/rubynewbee)\
**Post date:** [May 7, 2020, 9:55pm UTC](https://www.ruby-forum.com/t/net-http-read-nonblock-rbuf-fill-errors/259511/1 "2020-05-07T21:55:48Z")

</div>

Ruby 1.9.1, Debian Linux 7.3, Pentium 3, old hardware.  
I’m trying to connect to my broker to get today’s prices.  
Every example in ‘ri NET::HTTP’ works for example .com but none work for [etrade.com](http://etrade.com). I suspect it’s a buffer overflow problem but have no clue how to fix it.

require ‘net/http’  
$uri = URI(‘[https://us.etrade.com](https://us.etrade.com)’)  
res = Net::HTTP.get($uri) # =\> String  
puts res

Executing this gives errors:  
/usr/lib/ruby/1.9.1/net/protocol.rb:141:in `read_nonblock': Connection reset by peer (Errno::ECONNRESET) from /usr/lib/ruby/1.9.1/net/protocol.rb:141:in `rbuf\_fill’  
plus a lot more in the trace.

Suggestions will be appreciated.  
Thanks,  
Mike

---

<div class="post-metadata">

**Author:** ![pcl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ecae2f/32.png) [@pcl](https://www.ruby-forum.com/u/pcl)\
**Post date:** [May 7, 2020, 10:49pm UTC](https://www.ruby-forum.com/t/net-http-read-nonblock-rbuf-fill-errors/259511/2 "2020-05-07T22:49:23Z")

</div>

I don’t know if this is a factor, but I tried this with a newer ruby, and the URI you gave evoked a “moved permanently” message. Trying ‘[E\*TRADE | Investing, Trading & Retirement](https://us.etrade.com/home)’ instead got a response, of 58882 characters.

```auto
2.7.1 :004 > Net::HTTP.get(URI('https://us.etrade.com'))
 => "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>301 Moved Permanently</title>\n</head><body>\n<h1>Moved Permanently</h1>\n<p>The document has moved <a href=\"https://us.etrade.com/home\">here</a>.</p>\n</body></html>\n" 
2.7.1 :005 > Net::HTTP.get(URI('https://us.etrade.com/home'))
 => "<!doctype html>\r\n<!--[if lt IE 7]> <html lang=\"en\" class=\"no-js lt-ie9 lt-ie8 lt-ie7 ie\"> <![endif]-->\r\n<!--[if IE 7]> <html lang=\"en\" class=\"no-js lt-ie9 lt-ie8 ie\"> <![endif]-->\r\n<!--[if IE 8]> 
# --- ETC

```

---

<div class="post-metadata">

**Author:** ![rubynewbee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/74df32/32.png) [@rubynewbee](https://www.ruby-forum.com/u/rubynewbee)\
**Post date:** [May 8, 2020, 3:15am UTC](https://www.ruby-forum.com/t/net-http-read-nonblock-rbuf-fill-errors/259511/3 "2020-05-08T03:15:15Z")

</div>

Unfortunately I’m stuck with the version I’ve got for the moment.  
The initial URL I tried was ‘[https://us.etrade.com/e/t/user/login](https://us.etrade.com/e/t/user/login)’  
but since that didn’t fly I shortened it. Another I’ve tried is ‘[TD Ameritrade Login](https://invest1.ameritrade.com/grid/p/site)’. These are the sites my browser uses to allow me to login to my broker sites. The browser is PaleMoon a spinoff of Mozilla/FireFox. I get the same errors trying to connect to etrade’s home with Ruby.  
Further suggestions?  
Thanks for trying.  
Stay home, stay alive.  
Mike

---

<div class="post-metadata">

**Author:** ![rubynewbee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/74df32/32.png) [@rubynewbee](https://www.ruby-forum.com/u/rubynewbee)\
**Post date:** [May 12, 2020, 6:01pm UTC](https://www.ruby-forum.com/t/net-http-read-nonblock-rbuf-fill-errors/259511/4 "2020-05-12T18:01:13Z")

</div>

Having spent several days on this without getting to first base and having found several posts on stackoverflow suggesting that the version installed on my system is broken in this respect, I’ll go back to Perl where I’ve written several similar aps in the past. Ruby will just have to wait.  
Thanks,  
Mike
