Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hostname missing when waiting for ssh service in create action #122

Closed
litjoco opened this issue May 20, 2015 · 5 comments · Fixed by #124
Closed

hostname missing when waiting for ssh service in create action #122

litjoco opened this issue May 20, 2015 · 5 comments · Fixed by #124
Assignees
Labels

Comments

@litjoco
Copy link

litjoco commented May 20, 2015

During the create action the instance is created and logged as ready. Following this the ssh connection is being checked. The connection is always fails made and eventually times out. I am able to manually connect during this time using same keypair. From the log it looks like the hostname is not getting set.

I have tried explicitly setting the interface_type and leaving it as default with same result.

       Waiting for SSH service on :22, retrying in 3 seconds
D      [SSH] opening connection to ec2-user@<{:user_known_hosts_file=>"/dev/null", :paranoid=>false, :port=>22, :compression=>"zlib", :compression_level=>6, :keepalive=>true, :keepalive_interval=>60, :timeout=>120, :keys_only=>true, :keys=>["/some/path/key.pem"], :user=>"ec2-user"}>
D      [SSH] connection failed (#<Errno::ECONNREFUSED: Connection refused - connect(2) for "" port 22>)

fyi: After the time out the state file is created with the instance id but hostname is empty

@dsavinkov
Copy link
Contributor

@litjoco
Make sure to adjust your .kitchen.yml file:

...
platforms:
  - name: centos-6.3
    driver_plugin: ec2
    transport:
      username: test
      ssh_key: <%= ENV['AWS_SSH_KEY']%>
...

It works correctly for me.

@callmeradical
Copy link

If the hostname is not set, we are having an issue where it attempts to converge on localhost. This is very bad.

This also looks to be largely a problem around not specifying an 'interface'

@huntertj
Copy link

I'm having the same problem, I noticed the .kitchen/default- is missing the hostname field, no matter if I specify the lines suggested by @dsavinkov, also tried specifying interface: to dns, internal or public with the same results

last_action: destroy
server_id: i-5ec8f688
hostname: ''

@litjoco
Copy link
Author

litjoco commented May 20, 2015

Thanks for the suggestion @dsavinkov.
If I manually update the state file to have the hostname or ip, that should be populated, then the additional actions such as converge, verify and login all work as expected.

This makes me think that my config is correct

@callmeradical
Copy link

merge request #123 should resolve this issue, by returning private_ip_address by default and wiring up an interface variable in the config to specify dns, private, or public.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants