hashicorp / hashicorp/packer

Post reboot of unattend installation, jenkins failed to make connection to windows 2016 instance

Open
#11,801 0 comments 0 reactions 0 assignees View on GitHub
bug crash
Dominant language
Go
Stars
15.8k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

I'm trying to build windows 2016 AMI using packer amazon-ebs based AMI. The packer build was going smooth until exection of unattended installation. When the instances is rebooting, then jenkins job failed to make connection to the instance to execute remaining process and timing out. Could you please help me on this to find the issue.
1. WinRM service is running post reboot
2. Security groups are fine
3. I have tried to diable the windows firewall, but it doesn't help

Below is the error logs,
2022/05/23 13:05:01 packer-provisioner-windows-restart plugin: Check if machine is rebooting...
2022/05/23 13:05:01 packer-builder-amazon-ebs plugin: [DEBUG] Opening new ssh session
2022/05/23 13:05:02 packer-builder-amazon-ebs plugin: [DEBUG] starting remote command: shutdown /r /f /t 60 /c "packer restart test"
==> amazon-ebs: The interface is unknown.(1717)
2022/05/23 13:05:02 packer-builder-amazon-ebs plugin: [ERROR] Remote command exited with '181': shutdown /r /f /t 60 /c "packer restart test"
2022/05/23 13:05:02 packer-builder-amazon-ebs plugin: [INFO] RPC endpoint: Communicator ended with: 181
2022/05/23 13:05:02 [INFO] 0 bytes written for 'stdout'
2022/05/23 13:05:02 [INFO] 32 bytes written for 'stderr'
2022/05/23 13:05:02 [INFO] RPC client: Communicator ended with: 181
2022/05/23 13:05:02 [INFO] RPC endpoint: Communicator ended with: 181
2022/05/23 13:05:02 packer-provisioner-windows-restart plugin: [INFO] 0 bytes written for 'stdout'
2022/05/23 13:05:02 packer-provisioner-windows-restart plugin: [INFO] 32 bytes written for 'stderr'
2022/05/23 13:05:02 packer-provisioner-windows-restart plugin: [INFO] RPC client: Communicator ended with: 181
2022/05/23 13:05:02 packer-provisioner-windows-restart plugin: Check if machine is rebooting...
2022/05/23 13:05:02 packer-builder-amazon-ebs plugin: [DEBUG] Opening new ssh session
2022/05/23 13:05:02 packer-builder-amazon-ebs plugin: [DEBUG] starting remote command: shutdown /r /f /t 60 /c "packer restart test"
==> amazon-ebs: The entered computer name is not valid or remote shutdown is not supported on the target computer. Check the name and then try again or contact your system administrator.(53)
2022/05/23 13:05:02 packer-builder-amazon-ebs plugin: [ERROR] Remote command exited with '53': shutdown /r /f /t 60 /c "packer restart test"
2022/05/23 13:05:02 packer-builder-amazon-ebs plugin: [INFO] RPC endpoint: Communicator ended with: 53
2022/05/23 13:05:02 [INFO] 0 bytes written for 'stdout'
2022/05/23 13:05:02 [INFO] 175 bytes written for 'stderr'
2022/05/23 13:05:02 [INFO] RPC client: Communicator ended with: 53
2022/05/23 13:05:02 [INFO] RPC endpoint: Communicator ended with: 53
2022/05/23 13:05:02 packer-provisioner-windows-restart plugin: [INFO] 0 bytes written for 'stdout'
2022/05/23 13:05:02 packer-provisioner-windows-restart plugin: [INFO] 175 bytes written for 'stderr'
2022/05/23 13:05:02 packer-provisioner-windows-restart plugin: [INFO] RPC client: Communicator ended with: 53
2022/05/23 13:05:02 packer-provisioner-windows-restart plugin: Check if machine is rebooting...
2022/05/23 13:05:02 packer-builder-amazon-ebs plugin: [DEBUG] Opening new ssh session
2022/05/23 13:05:02 packer-builder-amazon-ebs plugin: [DEBUG] starting remote command: shutdown /r /f /t 60 /c "packer restart test"
2022/05/23 13:05:02 [INFO] 0 bytes written for 'stdout'
2022/05/23 13:05:02 [INFO] 0 bytes written for 'stderr'
2022/05/23 13:05:02 packer-provisioner-windows-restart plugin: [INFO] 0 bytes written for 'stdout'
2022/05/23 13:05:02 packer-provisioner-windows-restart plugin: [INFO] 0 bytes written for 'stderr'
2022/05/23 13:05:02 packer-provisioner-windows-restart plugin: Waiting for machine to reboot with timeout: 5m0s
2022/05/23 13:05:02 packer-provisioner-windows-restart plugin: Waiting for machine to become available...
2022/05/23 13:05:02 packer-provisioner-windows-restart plugin: Checking that communicator is connected with: 'powershell -command "& {Write-Output 'restarted.'}"'
2022/05/23 13:05:07 packer-builder-amazon-ebs plugin: [DEBUG] Opening new ssh session
==> amazon-ebs: Timeout waiting for machine to restart.
2022/05/23 13:09:56 packer-provisioner-windows-restart plugin: Communication connection err: connection is shut down
2022/05/23 13:09:56 [INFO] (telemetry) ending windows-restart
2022/05/23 13:09:56 packer-provisioner-windows-restart plugin: [INFO] 0 bytes written for 'stdout'
2022/05/23 13:09:56 packer-provisioner-windows-restart plugin: [INFO] 0 bytes written for 'stderr'
==> amazon-ebs: Provisioning step had errors: Running the cleanup provisioner, if present...
==> amazon-ebs: Terminating the source AWS instance...
2022/05/23 13:10:01 packer-provisioner-windows-restart plugin: Communication connection err: connection is shut down
2022/05/23 13:10:06 packer-provisioner-windows-restart plugin: Communication connection err: connection is shut down
2022/05/23 13:10:06 packer-provisioner-windows-restart plugin: [ERR] 'stderr' accept error: timeout waiting for accept
2022/05/23 13:10:06 packer-provisioner-windows-restart plugin: [ERR] 'stdout' accept error: timeout waiting for accept
2022/05/23 13:10:06 packer-provisioner-windows-restart plugin: [ERR] Error accepting response stream 159: timeout waiting for accept
2022/05/23 13:10:11 packer-provisioner-windows-restart plugin: [ERR] 'stderr' accept error: timeout waiting for accept
2022/05/23 13:10:11 packer-provisioner-windows-restart plugin: Communication connection err: connection is shut down
2022/05/23 13:10:11 packer-provisioner-windows-restart plugin: [ERR] 'stdout' accept error: timeout waiting for accept
2022/05/23 13:10:11 packer-provisioner-windows-restart plugin: [ERR] Error accepting response stream 162: timeout waiting for accept
2022/05/23 13:10:11 packer-provisioner-windows-restart plugin: panic: close of closed channel
2022/05/23 13:10:11 packer-provisioner-windows-restart plugin:
2022/05/23 13:10:11 packer-provisioner-windows-restart plugin: goroutine 359 [running]:
2022/05/23 13:10:11 packer-provisioner-windows-restart plugin: github.com/hashicorp/packer/packer.(*RemoteCmd).SetExited(0xc0003e1650, 0x7b)
2022/05/23 13:10:11 packer-provisioner-windows-restart plugin: /home/circleci/project/packer/packer/communicator.go:181 +0x72
2022/05/23 13:10:11 packer-provisioner-windows-restart plugin: github.com/hashicorp/packer/packer/rpc.(*communicator).Start.func4(0xc0004de0a0, 0xc0000000a2, 0xc000072060, 0xc0003e1650)
2022/05/23 13:10:11 packer-provisioner-windows-restart plugin: /home/circleci/project/packer/packer/rpc/communicator.go:112 +0x152
2022/05/23 13:10:11 packer-provisioner-windows-restart plugin: created by github.com/hashicorp/packer/packer/rpc.(*communicator).Start
2022/05/23 13:10:11 packer-provisioner-windows-restart plugin: /home/circleci/project/packer/packer/rpc/communicator.go:106 +0xfa
2022/05/23 13:10:11 /usr/local/bin/packer: plugin process exited
==> amazon-ebs: Cleaning up any extra volumes...

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.