Skip to content

SSH error while building image with CentOS stream 9 cloud images #11656

@kashifest

Description

@kashifest

When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.

Overview of the Issue

While building an image on CentOS stream 9 cloud image, we are facing the following error:

2022/03/11 11:36:55 packer-builder-openstack plugin: [INFO] Waiting for SSH, up to timeout: 10m0s
2022/03/11 11:36:55 packer-builder-openstack plugin: [DEBUG] Using floating IP 89.42.141.82 to connect
2022/03/11 11:37:02 packer-builder-openstack plugin: [DEBUG] TCP connection to SSH ip/port failed: dial tcp 89.42.141.82:22: connect: connection refused
2022/03/11 11:37:07 packer-builder-openstack plugin: [DEBUG] Using floating IP 89.42.141.82 to connect
2022/03/11 11:37:07 packer-builder-openstack plugin: [INFO] Attempting SSH connection to 89.42.141.82:22...
2022/03/11 11:37:07 packer-builder-openstack plugin: [DEBUG] reconnecting to TCP connection for SSH
2022/03/11 11:37:07 packer-builder-openstack plugin: [DEBUG] handshaking with SSH
2022/03/11 11:37:07 packer-builder-openstack plugin: [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
2022/03/11 11:37:07 packer-builder-openstack plugin: [DEBUG] Detected authentication error. Increasing handshake attempts.
2022/03/11 11:37:14 packer-builder-openstack plugin: [DEBUG] Using floating IP 89.42.141.82 to connect
2022/03/11 11:37:14 packer-builder-openstack plugin: [INFO] Attempting SSH connection to 89.42.141.82:22...
2022/03/11 11:37:14 packer-builder-openstack plugin: [DEBUG] reconnecting to TCP connection for SSH
2022/03/11 11:37:14 packer-builder-openstack plugin: [DEBUG] handshaking with SSH
2022/03/11 11:37:15 packer-builder-openstack plugin: [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
2022/03/11 11:37:15 packer-builder-openstack plugin: [DEBUG] Detected authentication error. Increasing handshake attempts.
2022/03/11 11:37:22 packer-builder-openstack plugin: [DEBUG] Using floating IP 89.42.141.82 to connect
2022/03/11 11:37:22 packer-builder-openstack plugin: [INFO] Attempting SSH connection to 89.42.141.82:22...
2022/03/11 11:37:22 packer-builder-openstack plugin: [DEBUG] reconnecting to TCP connection for SSH
2022/03/11 11:37:22 packer-builder-openstack plugin: [DEBUG] handshaking with SSH
2022/03/11 11:37:22 packer-builder-openstack plugin: [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
2022/03/11 11:37:22 packer-builder-openstack plugin: [DEBUG] Detected authentication error. Increasing handshake attempts.
2022/03/11 11:37:29 packer-builder-openstack plugin: [DEBUG] Using floating IP 89.42.141.82 to connect
2022/03/11 11:37:29 packer-builder-openstack plugin: [INFO] Attempting SSH connection to 89.42.141.82:22...
2022/03/11 11:37:29 packer-builder-openstack plugin: [DEBUG] reconnecting to TCP connection for SSH
2022/03/11 11:37:29 packer-builder-openstack plugin: [DEBUG] handshaking with SSH
2022/03/11 11:37:29 packer-builder-openstack plugin: [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
2022/03/11 11:37:29 packer-builder-openstack plugin: [DEBUG] Detected authentication error. Increasing handshake attempts.
2022/03/11 11:37:36 packer-builder-openstack plugin: [DEBUG] Using floating IP 89.42.141.82 to connect
2022/03/11 11:37:36 packer-builder-openstack plugin: [INFO] Attempting SSH connection to 89.42.141.82:22...
2022/03/11 11:37:36 packer-builder-openstack plugin: [DEBUG] reconnecting to TCP connection for SSH
2022/03/11 11:37:36 packer-builder-openstack plugin: [DEBUG] handshaking with SSH
2022/03/11 11:37:37 packer-builder-openstack plugin: [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
2022/03/11 11:37:37 packer-builder-openstack plugin: [DEBUG] Detected authentication error. Increasing handshake attempts.
2022/03/11 11:37:44 packer-builder-openstack plugin: [DEBUG] Using floating IP 89.42.141.82 to connect
2022/03/11 11:37:44 packer-builder-openstack plugin: [INFO] Attempting SSH connection to 89.42.141.82:22...
2022/03/11 11:37:44 packer-builder-openstack plugin: [DEBUG] reconnecting to TCP connection for SSH
2022/03/11 11:37:44 packer-builder-openstack plugin: [DEBUG] handshaking with SSH
2022/03/11 11:37:44 packer-builder-openstack plugin: [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
2022/03/11 11:37:44 packer-builder-openstack plugin: [DEBUG] Detected authentication error. Increasing handshake attempts.
2022/03/11 11:37:51 packer-builder-openstack plugin: [DEBUG] Using floating IP 89.42.141.82 to connect
2022/03/11 11:37:51 packer-builder-openstack plugin: [INFO] Attempting SSH connection to 89.42.141.82:22...
2022/03/11 11:37:51 packer-builder-openstack plugin: [DEBUG] reconnecting to TCP connection for SSH
2022/03/11 11:37:51 packer-builder-openstack plugin: [DEBUG] handshaking with SSH
2022/03/11 11:37:51 packer-builder-openstack plugin: [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
2022/03/11 11:37:51 packer-builder-openstack plugin: [DEBUG] Detected authentication error. Increasing handshake attempts.
2022/03/11 11:37:58 packer-builder-openstack plugin: [DEBUG] Using floating IP 89.42.141.82 to connect
2022/03/11 11:37:58 packer-builder-openstack plugin: [INFO] Attempting SSH connection to 89.42.141.82:22...
2022/03/11 11:37:58 packer-builder-openstack plugin: [DEBUG] reconnecting to TCP connection for SSH
2022/03/11 11:37:58 packer-builder-openstack plugin: [DEBUG] handshaking with SSH
2022/03/11 11:37:59 packer-builder-openstack plugin: [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
2022/03/11 11:37:59 packer-builder-openstack plugin: [DEBUG] Detected authentication error. Increasing handshake attempts.
2022/03/11 11:38:06 packer-builder-openstack plugin: [DEBUG] Using floating IP 89.42.141.82 to connect
2022/03/11 11:38:06 packer-builder-openstack plugin: [INFO] Attempting SSH connection to 89.42.141.82:22...
2022/03/11 11:38:06 packer-builder-openstack plugin: [DEBUG] reconnecting to TCP connection for SSH
2022/03/11 11:38:06 packer-builder-openstack plugin: [DEBUG] handshaking with SSH
2022/03/11 11:38:06 packer-builder-openstack plugin: [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
2022/03/11 11:38:06 packer-builder-openstack plugin: [DEBUG] Detected authentication error. Increasing handshake attempts.
2022/03/11 11:38:13 packer-builder-openstack plugin: [DEBUG] Using floating IP 89.42.141.82 to connect
2022/03/11 11:38:13 packer-builder-openstack plugin: [INFO] Attempting SSH connection to 89.42.141.82:22...
2022/03/11 11:38:13 packer-builder-openstack plugin: [DEBUG] reconnecting to TCP connection for SSH
2022/03/11 11:38:13 packer-builder-openstack plugin: [DEBUG] handshaking with SSH
2022/03/11 11:38:13 packer-builder-openstack plugin: [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
2022/03/11 11:38:13 packer-builder-openstack plugin: [DEBUG] Detected authentication error. Increasing handshake attempts.
==> openstack: 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
2022/03/11 11:38:13 packer-builder-openstack plugin: Error asking for input: no available tty
==> openstack: 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
==> openstack: Step "StepConnect" failed
==> openstack: Deleted temporary floating IP '9679e2b2-ff90-4ea4-a241-14e7169f1d88' (89.42.141.82)
==> openstack: Terminating the source server: a4978b1a-77be-4eb2-ac7e-96c3ba75009e ...
2022/03/11 11:38:16 packer-builder-openstack plugin: Waiting for state to become: [DELETED]
2022/03/11 11:38:16 packer-builder-openstack plugin: Waiting for state to become: [DELETED] currently ACTIVE (0%)
2022/03/11 11:38:19 packer-builder-openstack plugin: Waiting for state to become: [DELETED] currently ACTIVE (0%)
2022/03/11 11:38:21 packer-builder-openstack plugin: [INFO] 404 on ServerStateRefresh, returning DELETED
2022/03/11 11:38:21 [INFO] (telemetry) ending openstack
==> Wait completed after 1 minute 51 seconds
2022/03/11 11:38:21 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2022/03/11 11:38:21 machine readable: openstack,error []string{"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"}
==> Builds finished but no artifacts were created.
2022/03/11 11:38:21 [INFO] (telemetry) Finalizing.
Build 'openstack' errored after 1 minute 51 seconds: 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

==> Wait completed after 1 minute 51 seconds

==> Some builds didn't complete successfully and had errors:
--> openstack: 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

==> Builds finished but no artifacts were created.
2022/03/11 11:38:22 waiting for all plugin processes to complete...
2022/03/11 11:38:22 /bin/packer: plugin process exited
2022/03/11 11:38:22 /bin/packer: plugin process exited
2022/03/11 11:38:22 /bin/packer: plugin process exited

If we only change to CentOS stream 8 cloud image in the whole process, the build is passing. It seems packer is facing issues while SSH handshake in CentOS stream 9.

Packer version

From packer version

1.6.5

Operating system and Environment details

OS, Architecture, and any other information you can provide about the
environment.
https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-20220309.0.x86_64.qcow2

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions