Skip to content

Connection reset/time out #47

Closed
lamnk opened this Issue Oct 16, 2010 · 4 comments

3 participants

@lamnk
lamnk commented Oct 16, 2010

I am getting this error after getting whois info for around 20-30 random domains (consist mainly of .com and .net):

/home/lamnk/.rvm/gems/ruby-1.9.2-head/gems/whois-1.3.9/lib/whois/server/adapters/base.rb:128:in `read': Connection reset by peer (Errno::ECONNRESET)
    from /home/lamnk/.rvm/gems/ruby-1.9.2-head/gems/whois-1.3.9/lib/whois/server/adapters/base.rb:128:in `ask_the_socket'
    from /home/lamnk/.rvm/gems/ruby-1.9.2-head/gems/whois-1.3.9/lib/whois/server/adapters/pir.rb:24:in `request'
    from /home/lamnk/.rvm/gems/ruby-1.9.2-head/gems/whois-1.3.9/lib/whois/server/adapters/base.rb:85:in `block in query'
    from /home/lamnk/.rvm/gems/ruby-1.9.2-head/gems/whois-1.3.9/lib/whois/server/adapters/base.rb:109:in `with_buffer'
    from /home/lamnk/.rvm/gems/ruby-1.9.2-head/gems/whois-1.3.9/lib/whois/server/adapters/base.rb:84:in `query'
    from /home/lamnk/.rvm/gems/ruby-1.9.2-head/gems/whois-1.3.9/lib/whois/client.rb:79:in `block in query'
    from /home/lamnk/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/timeout.rb:57:in `timeout'
    from /home/lamnk/.rvm/gems/ruby-1.9.2-head/gems/whois-1.3.9/lib/whois/client.rb:77:in `query'
    from /home/lamnk/.rvm/gems/ruby-1.9.2-head/gems/whois-1.3.9/lib/whois.rb:54:in `query'
    from /home/lamnk/.rvm/gems/ruby-1.9.2-head/gems/whois-1.3.9/lib/whois.rb:130:in `whois'
    from dict_vi_en.rb:51:in `block (2 levels) in <main>'
    from dict_vi_en.rb:49:in `each'
    from dict_vi_en.rb:49:in `block in <main>'
    from /home/lamnk/.rvm/gems/ruby-1.9.2-head/gems/sequel-3.16.0/lib/sequel/adapters/mysql.rb:427:in `yield_rows'
    from /home/lamnk/.rvm/gems/ruby-1.9.2-head/gems/sequel-3.16.0/lib/sequel/adapters/mysql.rb:344:in `block in fetch_rows'
    from /home/lamnk/.rvm/gems/ruby-1.9.2-head/gems/sequel-3.16.0/lib/sequel/adapters/mysql.rb:165:in `_execute'
    from /home/lamnk/.rvm/gems/ruby-1.9.2-head/gems/sequel-3.16.0/lib/sequel/adapters/mysql.rb:147:in `block in execute'
    from /home/lamnk/.rvm/gems/ruby-1.9.2-head/gems/sequel-3.16.0/lib/sequel/connection_pool/threaded.rb:84:in `hold'
    from /home/lamnk/.rvm/gems/ruby-1.9.2-head/gems/sequel-3.16.0/lib/sequel/database/connecting.rb:224:in `synchronize'
    from /home/lamnk/.rvm/gems/ruby-1.9.2-head/gems/sequel-3.16.0/lib/sequel/adapters/mysql.rb:147:in `execute'
    from /home/lamnk/.rvm/gems/ruby-1.9.2-head/gems/sequel-3.16.0/lib/sequel/dataset/actions.rb:541:in `execute'
    from /home/lamnk/.rvm/gems/ruby-1.9.2-head/gems/sequel-3.16.0/lib/sequel/adapters/mysql.rb:403:in `execute'
    from /home/lamnk/.rvm/gems/ruby-1.9.2-head/gems/sequel-3.16.0/lib/sequel/adapters/mysql.rb:329:in `fetch_rows'
    from /home/lamnk/.rvm/gems/ruby-1.9.2-head/gems/sequel-3.16.0/lib/sequel/dataset/actions.rb:123:in `each'
    from dict_vi_en.rb:48:in `<main>'

Is it because of the whois servers limiting automated queries ?

@weppos
Owner
weppos commented Oct 16, 2010

Hello lamnk,
not really. The cause of the error is a temporary unavailability of the WHOIS server.

I'm experiencing the same problem quite often in my application.
The problem is noticeable especially with .net and .com domains because the WHOIS request involves multiple WHOIS queries, due to the nature of the Verisign WHOIS architecture.

Usually, this error is caused by the final endpoint, not by Verisign. I'm trying to isolate the problem and understand if it makes sense to return the partial response anyway in case the second WHOIS query doesn't complete successfully.

@lamnk
lamnk commented Oct 17, 2010

Thank weppos, good to know. I am looking forward to updates.

@timmyfury

I ran into this issue as well, just like described above, the issue only happens sometimes. .com domains that I have registered through Dreamhost will occasionally fail if their server refuses the request. clickpickle.com and magnificentmurderbeasts.com are two examples of this.

It looks like the unix whois utility takes this possibility into account and returns the Verisign response without the referral WHOIS server's response.

I forked and was working on a fix. The issue is testing. The referral servers are responding again and I don't have domains to test against at the moment.

Thoughts?

@weppos
Owner
weppos commented Jan 24, 2011

I forked and was working on a fix. The issue is testing. The referral servers are responding again and I don't have domains to test against at the moment.

You should use unit tests for this feature.

My idea was to implement this feature as a Whois::Client option. The user should be able to pass an option to allow partial responses. In case the feature is enabled (disabled by default), the system will return the partial response. Otherwise, a Whois::IncompleteResponse < ServerError error is raised.

@weppos weppos closed this Jun 30, 2012
@weppos weppos was assigned Jun 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.