error while running `bosh aws creates`

60 views
Skip to first unread message

Aleksey Zalesov

unread,
Nov 28, 2014, 9:42:01 AM11/28/14
to bosh-...@cloudfoundry.org
Hi all!

I am following this tutorial to install CF on AWS. But when I print `bosh aws create` I get a SocketError. What's wrong?

$ bosh aws create
/usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/net/http.rb:763:in `initialize': getaddrinfo: Name or service not known (SocketError)
from /usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/net/http.rb:763:in `open'
from /usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/net/http.rb:763:in `block in connect'
from /usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/timeout.rb:69:in `timeout'
from /usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/timeout.rb:100:in `timeout'
from /usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/net/http.rb:763:in `connect'
from /usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/net/http.rb:756:in `do_start'
from /usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/net/http.rb:751:in `start'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-1.44.0/lib/aws/core/http/connection_pool.rb:321:in `start_session'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-1.44.0/lib/aws/core/http/connection_pool.rb:125:in `session_for'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-1.44.0/lib/aws/core/http/net_http_handler.rb:55:in `handle'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-1.44.0/lib/aws/core/client.rb:253:in `block in make_sync_request'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-1.44.0/lib/aws/core/client.rb:289:in `retry_server_errors'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-1.44.0/lib/aws/core/client.rb:249:in `make_sync_request'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-1.44.0/lib/aws/core/client.rb:511:in `block (2 levels) in client_request'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-1.44.0/lib/aws/core/client.rb:391:in `log_client_request'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-1.44.0/lib/aws/core/client.rb:477:in `block in client_request'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-1.44.0/lib/aws/core/client.rb:373:in `return_or_raise'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-1.44.0/lib/aws/core/client.rb:476:in `client_request'
from (eval):3:in `list_buckets'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-1.44.0/lib/aws/s3/bucket_collection.rb:140:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/bosh_cli_plugin_aws-1.2778.0/lib/bosh_cli_plugin_aws/s3.rb:37:in `map'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/bosh_cli_plugin_aws-1.2778.0/lib/bosh_cli_plugin_aws/s3.rb:37:in `bucket_names'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/bosh_cli_plugin_aws-1.2778.0/lib/bosh_cli_plugin_aws/s3.rb:41:in `bucket_exists?'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/bosh_cli_plugin_aws-1.2778.0/lib/bosh_cli_plugin_aws/migrator.rb:62:in `bucket_name'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/bosh_cli_plugin_aws-1.2778.0/lib/bosh_cli_plugin_aws/migrator.rb:52:in `ensure_bucket_exists'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/bosh_cli_plugin_aws-1.2778.0/lib/bosh_cli_plugin_aws/migrator.rb:39:in `needs_migration?'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/bosh_cli_plugin_aws-1.2778.0/lib/bosh_cli_plugin_aws/migrator.rb:11:in `migrate'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/bosh_cli_plugin_aws-1.2778.0/lib/bosh/cli/commands/aws.rb:130:in `create'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/bosh_cli-1.2778.0/lib/cli/command_handler.rb:57:in `run'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/bosh_cli-1.2778.0/lib/cli/runner.rb:56:in `run'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/bosh_cli-1.2778.0/lib/cli/runner.rb:16:in `run'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/bosh_cli-1.2778.0/bin/bosh:7:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p551/bin/bosh:23:in `load'
from /usr/local/rvm/gems/ruby-1.9.3-p551/bin/bosh:23:in `<main>'
from /usr/local/rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in `eval'
from /usr/local/rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in `<main>'

Dmitriy Kalinin

unread,
Dec 1, 2014, 12:40:54 PM12/1/14
to bosh-...@cloudfoundry.org
Seems like the machine you are running this command on cannot resolve AWS API address. Does this machine have access to the internet? Does 'host google.com' work?

Zalesov Aleksey

unread,
Dec 2, 2014, 11:24:56 AM12/2/14
to bosh-...@cloudfoundry.org
Yes, this machine has Internet access. It is AWS instance and security group allows all outgoing traffic.

Additionally I have tested aws cli and was able to information from aws services:
$ aws ec2 describe-instances --filters "Name=instance-type,Values=t2.micro"

Dmitriy Kalinin

unread,
Dec 2, 2014, 6:24:59 PM12/2/14
to bosh-...@cloudfoundry.org
Could you provide output for `curl -vvv http://google.com` from that machine?

Aleksey Zalesov

unread,
Dec 3, 2014, 11:54:59 AM12/3/14
to bosh-...@cloudfoundry.org
$ curl -vvv http://google.com

* Rebuilt URL to: http://google.com/
* Hostname was NOT found in DNS cache
*   Trying 74.125.228.66...
* Connected to google.com (74.125.228.66) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.35.0
> Host: google.com
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Content-Type: text/html; charset=UTF-8
< Date: Wed, 03 Dec 2014 16:53:53 GMT
< Expires: Fri, 02 Jan 2015 16:53:53 GMT
< Cache-Control: public, max-age=2592000
* Server gws is not blacklisted
< Server: gws
< Content-Length: 219
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: SAMEORIGIN
< Alternate-Protocol: 80:quic,p=0.02
<
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
* Connection #0 to host google.com left intact


On 03 Dec 2014, at 02:24, Dmitriy Kalinin <dkal...@pivotal.io> wrote:


Dmitriy Kalinin

unread,
Dec 3, 2014, 8:36:03 PM12/3/14
to bosh-...@cloudfoundry.org
Hmm. what about `curl -vvv ec2.us-east-1.amazonaws.com`. 

bosh aws create uses aws-sdk gem to issue AWS commands.

Here is another thing to try:

ruby -r net/http -e 'puts Net::HTTP.get_response(URI.parse("http://ec2.us-east-1.amazonaws.com"))'

Aleksey Zalesov

unread,
Dec 4, 2014, 2:54:32 AM12/4/14
to bosh-...@cloudfoundry.org
* Hostname was NOT found in DNS cache
*   Trying 176.32.103.169...
* Connected to ec2.us-east-1.amazonaws.com (176.32.103.169) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.35.0
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Content-Length: 0
< Date: Thu, 04 Dec 2014 07:51:51 GMT
* Server AmazonEC2 is not blacklisted
< Server: AmazonEC2
<
* Connection #0 to host ec2.us-east-1.amazonaws.com left intact

$ gem list| grep aws-sdk
aws-sdk (1.44.0)

$ ruby -r net/http -e 'puts Net::HTTP.get_response(URI.parse("http://ec2.us-east-1.amazonaws.com"))'
#<Net::HTTPMovedPermanently:0x00000001ae6bd0>

Everything is fine with net, in my opinion.
Reply all
Reply to author
Forward
0 new messages