slayedbylucifer
slayedbylucifer

Reputation: 23522

knife ec2 bootstrap is failing

I am creating ec2 instance using chef knife. the process goes fine until it registers the newly created instance with the chef server.

I am using my own chef server.

When I do the ec2 bootstrap, I get following:

my-ec2-instance-public-name ##########################################  ( 97%)
my-ec2-instance-public-name ########################################### [100%]
my-ec2-instance-public-name Thank you for installing Chef!
my-ec2-instance-public-name Starting Chef Client, version 11.4.4
my-ec2-instance-public-name Creating a new client identity for i-fc1919ab using the validator key.
my-ec2-instance-public-name
my-ec2-instance-public-name ================================================================================
my-ec2-instance-public-name Chef encountered an error attempting to create the client "i-fc1919ab"
my-ec2-instance-public-name ================================================================================
my-ec2-instance-public-name
my-ec2-instance-public-name
my-ec2-instance-public-name Network Error:
my-ec2-instance-public-name --------------
my-ec2-instance-public-name There was a network error connecting to the Chef Server:
my-ec2-instance-public-name Error connecting to https://my-local-chef-server-name/clients - getaddrinfo: Name or service not known
my-ec2-instance-public-name
my-ec2-instance-public-name
my-ec2-instance-public-name
my-ec2-instance-public-name Relevant Config Settings:
my-ec2-instance-public-name -------------------------
my-ec2-instance-public-name chef_server_url  "https://my-local-chef-server-name"
my-ec2-instance-public-name
my-ec2-instance-public-name If your chef_server_url is correct, your network could be down.
my-ec2-instance-public-name
my-ec2-instance-public-name
my-ec2-instance-public-name
my-ec2-instance-public-name [2013-07-22T05:45:55-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
my-ec2-instance-public-name [2013-07-22T05:45:55-04:00] FATAL: SocketError: Error connecting to https://my-local-chef-server-name/clients - getaddrinfo: Name or service not known

I have replaced some information in above output so as to paste it on stackoverflow.

The error getaddrinfo: Name or service not known mentioned above cannot be true as DNS resolution works fine. Also, I looked at /var/chef/cache/chef-stacktrace.out on my ec2 instance and it says the same thing that getaddrinfo: Name or service not known

Now,

If I bootstrap a local VM within my lab where the chef server is sitting, it works just fine.

Here is the output from local VM bootstrapping:

my-local-vm-name ##########################################  ( 97%)
my-local-vm-name ########################################### [100%]
my-local-vm-name Thank you for installing Chef!
my-local-vm-name Starting Chef Client, version 11.4.4
my-local-vm-name Creating a new client identity for my-local-vm-name using the validator key.
my-local-vm-name resolving cookbooks for run list: []
my-local-vm-name Synchronizing Cookbooks:
my-local-vm-name Compiling Cookbooks...
my-local-vm-name [2013-07-22T14:56:14+05:30] WARN: Node my-local-vm-name has an empty run list.
my-local-vm-name Converging 0 resources
my-local-vm-name Chef Client finished, 0 resources updated

Question:

I am not able to figure why my ec2 instance bootstrapping fails with getaddrinfo: Name or service not known whereas the local vm bootstrapping works fine. Is there something obvious that I overlooked? Any help/suggestion would be of great help to me.

Thanks.

Upvotes: 1

Views: 897

Answers (1)

slayedbylucifer
slayedbylucifer

Reputation: 23522

It seems obvious to me that my Chef server is hosted inside my lab and it is not available publicly. Hence there is no way that my ec2 instance will be able to communicate with the chef server. I guess that's why I am receiving above error.

Upvotes: 2

Related Questions