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

Cannot SSH into EC2 instance. #588

Open
kevinaloys opened this issue Aug 9, 2022 · 1 comment
Open

Cannot SSH into EC2 instance. #588

kevinaloys opened this issue Aug 9, 2022 · 1 comment

Comments

@kevinaloys
Copy link

Brief Description

Kitchen EC2 driver is unable to SSH into EC2 instance.

Version

Chef Workstation version: 22.7.1006
Chef Habitat version: 1.6.420
Test Kitchen version: 3.3.1
Cookstyle version: 7.32.1
Chef Infra Client version: 17.10.0
Chef InSpec version: 4.56.20
Chef CLI version: 5.6.1

Environment

MacOS 12.5

Scenario

Used automated keypair generation & security group in the kitchen.yml file but apparently I'm able to manually SSH into the ec2 instance after retrieving the kitchen generated keypair via kitchen debug mode. But kitchen is unable to SSH into the instance. Tried this also by manually providing an SSH keypair but kitchen is unable to SSH, times-out waiting for the instance.

Steps to Reproduce

Regular EC2 SSH from kitchen seems to be not working.

Expected Result

Kitchen SSH into the ec2 instance to start kitchen convergence process.

Actual Result

-----> Starting Test Kitchen (v3.3.1)
WARNING: Nokogiri was built against libxml version 2.9.4, but has dynamically loaded 2.9.13
-----> Creating ...
If you are not using an account that qualifies under the AWS
free-tier, you may be charged to run these suites. The charge
should be minimal, but neither Test Kitchen nor its maintainers
are responsible for your incurred costs.

   Created automatic security group sg-07e90946be11a7b1c
   Created automatic key pair kitchen-defaultal2022-root-KevinsMacBookPro2loca-2022-08-09T06:12:17Z-sx7x46v3
   Instance <i-08cd1c46fae0fbfd7> requested.
   Polling AWS for existence, attempt 0...
   Polling AWS for existence, attempt 1...
   EC2 instance <i-08cd1c46fae0fbfd7> created.
   Waited 0/300s for instance <i-08cd1c46fae0fbfd7> to become ready.
   Waited 5/300s for instance <i-08cd1c46fae0fbfd7> to become ready.
   Waited 10/300s for instance <i-08cd1c46fae0fbfd7> to become ready.
   EC2 instance <i-08cd1c46fae0fbfd7> ready (hostname: ec2-54-161-191-150.compute-1.amazonaws.com).
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
   Waiting for SSH service on ec2-54-161-191-150.compute-1.amazonaws.com:22, retrying in 3 seconds
@kevinaloys kevinaloys changed the title Cannot SSH into ec2 instance. Cannot SSH into EC2 instance. Aug 9, 2022
@vkarve-chef
Copy link

@kevinaloys can you please share the kitchen.yml (with credentials masked) that you used here?

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

No branches or pull requests

2 participants