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

SSH hadnshake failure in packer 1.8.6 #101

Open
kashifest opened this issue Apr 25, 2023 · 3 comments
Open

SSH hadnshake failure in packer 1.8.6 #101

kashifest opened this issue Apr 25, 2023 · 3 comments
Labels

Comments

@kashifest
Copy link

kashifest commented Apr 25, 2023

I previously reported a similar bug here hashicorp/packer#11656 but since I couldn't comment there , I am opening up a new issue here.

Packer version: 1.8.6
Tested with: CentOS Stream 9 and Ubuntu 22.04

Error:

Error waiting for SSH: Packer experienced an authentication error when trying to connect via SSH. This can happen if your username/password are wrong. You may want to double-check your credentials as part of your debugging process. original error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain

Packer log:

2023/04/25 12:12:55 ui: ==> openstack: Using SSH communicator to connect: xx.xx.xx.xx
2023/04/25 12:12:55 packer-builder-openstack plugin: [INFO] Waiting for SSH, up to timeout: 5m0s
2023/04/25 12:12:55 ui: ==> openstack: Waiting for SSH to become available...
2023/04/25 12:12:55 packer-builder-openstack plugin: [DEBUG] Using floating IP xx.xx.xx.xx to connect
2023/04/25 12:12:57 packer-builder-openstack plugin: [DEBUG] TCP connection to SSH ip/port failed: dial tcp xx.xx.xx.xx:22: connect: connection refused
2023/04/25 12:13:02 packer-builder-openstack plugin: [DEBUG] Using floating IP xx.xx.xx.xx to connect
2023/04/25 12:13:02 packer-builder-openstack plugin: [DEBUG] TCP connection to SSH ip/port failed: dial tcp xx.xx.xx.xx:22: connect: connection refused
2023/04/25 12:13:07 packer-builder-openstack plugin: [DEBUG] Using floating IP xx.xx.xx.xx to connect
2023/04/25 12:13:07 packer-builder-openstack plugin: [DEBUG] TCP connection to SSH ip/port failed: dial tcp xx.xx.xx.xx:22: connect: connection refused
2023/04/25 12:13:12 packer-builder-openstack plugin: [DEBUG] Using floating IP xx.xx.xx.xx to connect
2023/04/25 12:13:12 packer-builder-openstack plugin: [INFO] Attempting SSH connection to xx.xx.xx.xx:22...
2023/04/25 12:13:12 packer-builder-openstack plugin: [DEBUG] reconnecting to TCP connection for SSH

Workaround:
Adding the following in builder template works:
"temporary_key_pair_type": "ed25519"

@kashifest kashifest added the bug label Apr 25, 2023
@nywilken
Copy link
Member

Hi @kashifest this looks to be an issue with OpenStack, which may have already been fixed in the in the latest release of the plugin. Looking at the provided build logs I believe you are using the version of OpenStack that is bundled with Packer in 1.8.6, which may be old. Please upgrade your version of the OpenStack plugin and try again.

You can upgrade by using the Packer plugins install command packer plugins install github.com/hashicorp/openstack or if you are using HCL2 templates you can add the required plugins block to your template file and run packer init to install the required plugin.

packer {
  required_plugins {
    openstack = {
      version = ">= 1.1.0"
      source  = "github.com/hashicorp/openstack"
    }
  }
}

I'm going to move this issue to the OpenStack Plugin repo as this is not an issue with Packer core.

@nywilken nywilken transferred this issue from hashicorp/packer Apr 25, 2023
@nywilken
Copy link
Member

Please feel free to close the issue if you find that ssh is working without having to set the key pair type after upgrading.

@kashifest
Copy link
Author

Please feel free to close the issue if you find that ssh is working without having to set the key pair type after upgrading.

Thanks I will check and get back, we build a docker image with packer as one of the base images and use that with an image builder template json file. Is there anyway to specify the openstack plugin version in the template without needing to packer init ?

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

No branches or pull requests

2 participants