hashicorp / hashicorp/packer-plugin-amazon
WinRM issue?
- Dominant language
- Go
- Stars
- 91
- Forks
- 141
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 3
Description
When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.
####
With 1.5.0 version, I started seeing issues in post-processor.
Please note that this issue does not happen in 1.4.0
Not sure whether this is WinRM issue or sysprep, or something else, but it looks like it was implemented by https://github.com/hashicorp/packer-plugin-amazon/pull/573
snippet from my build:
provisioner "windows-shell" {
inline = ["\"%programfiles%\\amazon\\ec2Launch\\ec2launch.exe\" sysprep --shutdown=false"]
}
provisioner "windows-shell" {
inline = ["shutdown -s "]
pause_before = "5m0s"
}
post-processor "manifest" {
}
#### Reproduction Steps
Init 1.5.0 version
### Plugin and Packer version
1.5.0
### Simplified Packer Buildfile
If the file is longer than a few dozen lines, please include the URL to the
[gist](https://gist.github.com/) of the log or use the [Github detailed
format](https://gist.github.com/ericclemmons/b146fe5da72ca1f706b2ef72a20ac39d)
instead of posting it directly in the issue.
### Operating system and Environment details
I use Docker container image `'hashicorp/packer` running on Amazon Linux 2023
### Log Fragments and crash.log files
Error without debug:
21:37:01 1758825421,,ui,say,==> amazon-ebs.windows-L1-ami: C:\Users\vagrant>"C:\Program Files\amazon\ec2Launch\ec2launch.exe" sysprep --shutdown=false
21:37:01 1758825421,,ui,say,==> amazon-ebs.windows-L1-ami: agent ran successfully
21:37:01 1758825421,,ui,say,==> amazon-ebs.windows-L1-ami: Sysprep sub-command: shutdown: false clean: false
21:37:01 1758825421,,ui,say,==> amazon-ebs.windows-L1-ami: 2025-09-25 18:37:00 Info: Preparing items to run Sysprep.
21:37:01 1758825421,,ui,say,==> amazon-ebs.windows-L1-ami: 2025-09-25 18:37:00 Console: Message: Successfully disabled hibernation
21:37:01 1758825421,,ui,say,==> amazon-ebs.windows-L1-ami: 2025-09-25 18:37:00 Info: Run sysprep
21:37:01 1758825421,,ui,say,==> amazon-ebs.windows-L1-ami: 2025-09-25 18:37:00 Info: Sysprep command: C:\Windows\System32\Sysprep\Sysprep.exe /oobe /quit /generalize /unattend:C:\ProgramData\Amazon\EC2Launch\sysprep\unattend.xml
21:37:47 1758825460,,ui,say,==> amazon-ebs.windows-L1-ami: Pausing 5m0s before the next provisioner...
21:42:54 1758825760,,ui,say,==> amazon-ebs.windows-L1-ami: Provisioning with windows-shell...
21:42:54 1758825760,,ui,say,==> amazon-ebs.windows-L1-ami: Provisioning with shell script: /var/tmp/windows-shell-provisioner858587302
21:47:45 1758826062,,ui,say,==> amazon-ebs.windows-L1-ami: Provisioning step had errors: Running the cleanup provisioner%!(PACKER_COMMA) if present...
21:47:45 1758826062,,ui,say,==> amazon-ebs.windows-L1-ami: Terminating the source AWS instance...
21:49:52 1758826183,,ui,say,==> amazon-ebs.windows-L1-ami: Cleaning up any extra volumes...
21:49:52 1758826183,,ui,say,==> amazon-ebs.windows-L1-ami: No volumes to clean up%!(PACKER_COMMA) skipping
21:49:52 1758826183,,ui,say,==> amazon-ebs.windows-L1-ami: Deleting temporary keypair...
21:49:52 1758826183,,ui,error,Build 'amazon-ebs.windows-L1-ami' errored after 45 minutes 30 seconds: Command has already been closed
21:49:52 1758826183,,ui,say,\n==> Wait completed after 45 minutes 30 seconds
21:49:52 1758826183,,error-count,1
21:49:52 1758826183,,ui,error,\n==> Some builds didn't complete successfully and had errors:
21:49:52 1758826183,amazon-ebs.windows-L1-ami,error,Command has already been closed
21:49:52 1758826183,,ui,error,--> amazon-ebs.windows-L1-ami: Command has already been closed
21:49:52 1758826183,,ui,say,\n==> Builds finished but no artifacts were created.
A paragraph or two about the issue you're experiencing.
Set the env var `PACKER_LOG=1` for maximum log detail.
Please see the attached file
[packer_debug.txt](https://github.com/user-attachments/files/22556863/packer_debug.txt)
Contributor guide
Assessment
This issue has not been assessed yet.