Open yaakov-h opened 4 years ago
I managed to capture verbose output from another occurrence where the environment variable was missing. Notice that this time it struck a different script, but the problem remains the same:
And some more verbose output from another occurrence where the script file was not found:
This looks like it might be related to recent changes in Windows.
After uninstalling KB4578969 and KB4580346 I managed to get a successful packer build
run.
Overview of the Issue
I use the
hyperv-iso
builder andpowershell
provisioner, and lately I have noticed two different intermittent failures:One is that PowerShell scripts fail to execute as though they are missing. Perhaps they were not transferred correctly to the guest VM:
The second is that the
PACKER_HTTP_ADDR
environment variable does not appear to be always set correctly:Note that the URL we are requesting here starts with
http://${env:PACKER_HTTP_ADDR}/dotnet/
but PowerShell is attempting to download fromhttp:///dotnet/
, i.e. the environment variable fromhttp_directory
has evaluated to an empty string or null.Reproduction Steps
No clear reproduction because it is intermittent.
Packer version
Packer v.1.6.0
Simplified Packer Buildfile
Operating system and Environment details
Host: Windows Server 2016 Version 1607 (OS Build 14393.3986) 64-bit Dell PowerEdge FC630 with 44 CPU cores and 1024GB of RAM Running as a child process of a Windows Service in Session 0 Logged on as an Active Directory domain user with local Administrator privileges
Guest: Windows Server 2012 R2 64-bit