Bug 854840 - Error "Name or service not known (SocketError)" is diaplayed when using rhc with network stopped
Summary: Error "Name or service not known (SocketError)" is diaplayed when using rhc w...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: oc
Version: 2.x
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Clayton Coleman
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-06 06:31 UTC by joycezhang
Modified: 2015-05-15 02:04 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-12-19 19:26:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description joycezhang 2012-09-06 06:31:43 UTC
Description of problem:
The error is displayed while performing with network stopped:

rhc app create -a myscapp1 -t python-2.6 -p xxx
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:762:in `initialize': getaddrinfo: No such
host is known.  (SocketError)
        from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:762:in `open'
        from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:762:in `block in connect'
        from C:/Ruby193/lib/ruby/1.9.1/timeout.rb:68:in `timeout'
        from C:/Ruby193/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
        from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:762:in `connect'
        from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
        from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:744:in `start'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.98.8/lib/rhc-common.rb:37
6:in `http_post'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.98.8/lib/rhc-common.rb:22
0:in `get_user_info'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.98.8/bin/rhc-app:111:in `
create_app'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.98.8/bin/rhc-app:505:in `
<top (required)>'
        from C:/Ruby193/bin/rhc-app:23:in `load'
        from C:/Ruby193/bin/rhc-app:23:in `<main>'
Version-Release number of selected component (if applicable):
rhc-0.98.8.gem
devenv_2119

How reproducible:
always

Steps to Reproduce:
1.Stop the network
2.Test rhc command like: create a domain, create an app or ctl an app status

  
Actual results:
The error is shown when using rhc commands.


Expected results:
The error should be thrown in background, resonable message is shown to user in  command line. 
Please refer to the message which is from rhc-0.96.8.gem:
C:\Users\Win7x64>rhc app create -a myscapp1 -t python-2.6 -s
Password: *
There was a problem communicating with the server. Response message: getaddrinfo
: No such host is known.
If you were disconnected it is possible the operation finished without being abl
e to report success.
You can use 'rhc domain show' and 'rhc app status' to learn about the status of
your user and application(s).


Additional info:

Comment 1 joycezhang 2012-09-07 08:01:43 UTC
If try to stop network of client during rhc operation, following error are shown:
# rhc app create -a ruby19 -t ruby-1.9
Password: *

Creating application: ruby19 in joycedev5
/usr/lib/ruby/1.8/timeout.rb:64:in `rbuf_fill': execution expired (Timeout::Error)
	from /usr/lib/ruby/1.8/net/protocol.rb:134:in `rbuf_fill'
	from /usr/lib/ruby/1.8/net/protocol.rb:116:in `readuntil'
	from /usr/lib/ruby/1.8/net/protocol.rb:126:in `readline'
	from /usr/lib/ruby/1.8/net/http.rb:2028:in `read_status_line'
	from /usr/lib/ruby/1.8/net/http.rb:2017:in `read_new'
	from /usr/lib/ruby/1.8/net/http.rb:1051:in `__request__'
	from /var/lib/gems/1.8/gems/rest-client-1.6.7/lib/restclient/net_http_ext.rb:51:in `request'
	from /var/lib/gems/1.8/gems/rhc-0.98.9/lib/rhc-common.rb:376:in `http_post'
	from /usr/lib/ruby/1.8/net/http.rb:543:in `start'
	from /var/lib/gems/1.8/gems/rhc-0.98.9/lib/rhc-common.rb:376:in `http_post'
	from /var/lib/gems/1.8/gems/rhc-0.98.9/lib/rhc-common.rb:542:in `create_app'
	from /var/lib/gems/1.8/gems/rhc-0.98.9/bin/rhc-app:230:in `create_app'
	from /var/lib/gems/1.8/gems/rhc-0.98.9/bin/rhc-app:505
	from /usr/local/bin/rhc-app:19:in `load'
	from /usr/local/bin/rhc-app:19

Expected results:
Reasonable message are shown to indicate the communication problem with server instead of the error.

Comment 2 John (J5) Palmieri 2012-10-04 16:05:57 UTC
You will still get a socket error but it shouldn't show the traceback

Comment 3 joycezhang 2012-10-08 09:22:28 UTC
This bug has been verified and fixed. Please refer to the details as below:


Verified Steps:
1.Stop the network
2.Test rhc command like: create a domain, create an app or ctl an app status

Actual results:
#rhc app create -a php5 -t php-5.3 -p a

**********
Failed to access resource: getaddrinfo: Name or service not known

The traceback is not shown so mark it as verified. Thanks.

Comment 4 Wei Sun 2012-10-19 10:11:58 UTC
Re-open this bug,because it is reproduced on devenv_2348,rhc client is :rhc 0.99.9


Result:

[sunwei@dhcp-8-229 ~]$ rhc domain create -n wsundev195

Creating domain with namespace 'wsundev195'

Password: 

/usr/share/ruby/net/http.rb:762:in `initialize': getaddrinfo: Name or service not known (SocketError)
	from /usr/share/ruby/net/http.rb:762:in `open'
	from /usr/share/ruby/net/http.rb:762:in `block in connect'
	from /usr/share/ruby/timeout.rb:54:in `timeout'
	from /usr/share/ruby/timeout.rb:99:in `timeout'
	from /usr/share/ruby/net/http.rb:762:in `connect'
	from /usr/share/ruby/net/http.rb:755:in `do_start'
	from /usr/share/ruby/net/http.rb:744:in `start'
	from /usr/local/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
	from /usr/local/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
	from /home/sunwei/.gem/ruby/1.9.1/gems/rhc-0.99.9/lib/rhc/rest/client.rb:50:in `initialize'
	from /home/sunwei/.gem/ruby/1.9.1/gems/rhc-0.99.9/lib/rhc/commands/base.rb:106:in `new'
	from /home/sunwei/.gem/ruby/1.9.1/gems/rhc-0.99.9/lib/rhc/commands/base.rb:106:in `rest_client'
	from /home/sunwei/.gem/ruby/1.9.1/gems/rhc-0.99.9/lib/rhc/commands/domain.rb:14:in `create'
	from /home/sunwei/.gem/ruby/1.9.1/gems/rhc-0.99.9/lib/rhc/commands.rb:129:in `block (3 levels) in to_commander'
	from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/command.rb:180:in `call'
	from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/command.rb:180:in `call'
	from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/command.rb:155:in `run'
	from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/runner.rb:402:in `run_active_command'
	from /home/sunwei/.gem/ruby/1.9.1/gems/rhc-0.99.9/lib/rhc/command_runner.rb:58:in `run!'
	from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/delegates.rb:11:in `run!'
	from /home/sunwei/.gem/ruby/1.9.1/gems/rhc-0.99.9/lib/rhc/cli.rb:40:in `start'
	from /home/sunwei/.gem/ruby/1.9.1/gems/rhc-0.99.9/bin/rhc:21:in `<top (required)>'
	from /home/sunwei/bin/rhc:23:in `load'
	from /home/sunwei/bin/rhc:23:in `<main>'

Comment 5 Clayton Coleman 2012-11-09 19:31:50 UTC
Fixed in https://github.com/openshift/rhc/pull/210

Comment 6 joycezhang 2012-11-12 02:37:08 UTC
This bug has been verified and fixed on devenv_2452 with rhc client built from devenv_2452.

Meaningful message is shown when using rhc client with network stopped.

Please refer to the detail message as below:

# rhc domain create testdmaa

Creating domain with namespace 'testdmaa'

Password: *

Unable to connect to the server (getaddrinfo: Name or service not known). Check that you have correctly specified your
proxy server 'http://file.rdu.redhat.com:3128' as well as your OpenShift server
'https://ec2-50-17-139-209.compute-1.amazonaws.com/broker/rest/api'.


# rhc app create test1 jbsseap-6.0 -p a
Unable to connect to the server (getaddrinfo: Name or service not known). Check that you have correctly specified your
proxy server 'http://file.rdu.redhat.com:3128' as well as your OpenShift server
'https://ec2-50-17-139-209.compute-1.amazonaws.com/broker/rest/api'

Thanks.


Note You need to log in before you can comment on or make changes to this bug.