Open spencer-cdw opened 1 year ago
Workaround:
force kill sshd
before rebooting.
https://github.com/hashicorp/packer/issues/354#issuecomment-23615630
provisioner "shell" {
# https://github.com/hashicorp/packer/issues/354#issuecomment-23615630
inline = ["ps aux | grep sshd | grep -v grep | awk '{print $2}' | xargs kill && reboot"]
execute_command = "echo 'ubuntu' | sudo -S sh -c '{{ .Vars }} {{ .Path }}'"
expect_disconnect = true
pause_after = "120s"
}
for what it's worth I have the same issue and the workaround does not work for me. Happens while attempting to reboot on AL2.
I am experiencing this issue on AWS as well. The provisioning process just randomly hangs and after ~20 minutes I get the same error:
2023/04/11 15:06:15 packer-builder-amazon-ebs plugin: [ERROR] Remote command exited without exit status or exit signal.
2023/04/11 15:06:15 packer-builder-amazon-ebs plugin: [INFO] RPC endpoint: Communicator ended with: 2300218
2023/04/11 15:06:15 [INFO] 15064 bytes written for 'stdout'
2023/04/11 15:06:15 [INFO] 48650 bytes written for 'stderr'
2023/04/11 15:06:15 [INFO] RPC client: Communicator ended with: 2300218
2023/04/11 15:06:15 [INFO] RPC endpoint: Communicator ended with: 2300218
2023/04/11 15:06:15 packer-provisioner-shell plugin: [INFO] 15064 bytes written for 'stdout'
2023/04/11 15:06:15 packer-provisioner-shell plugin: [INFO] 48650 bytes written for 'stderr'
2023/04/11 15:06:15 packer-provisioner-shell plugin: [INFO] RPC client: Communicator ended with: 2300218
2023/04/11 15:06:15 [INFO] (telemetry) ending shell
Community Note
When filing a bug, please include the following headings if possible. Any example text in this template can be deleted.
Overview of the Issue
When building ubuntu 20.04 images on GCP, packer always errors with the following message
Note that this does not happen with ubuntu 18.04 or ubuntu 22.04 images, nor does it happen with 20.04 images on AWS or Azure.
Reproduction Steps
The error messages have been brought up before in the following issues:
Those issues were closed due to being unable to reproduce. The following packer code reproduces the error 100% of the time.
Packer version
1.8.5
Log Fragments and crash.log files
https://gist.github.com/spencer-cdw/af6d980d91b2d156f96d1a9c9b1485ac