Greetings,
I'm not sure whether to file this as an error with the Chocolatey package manager, or Packer itself, so I thought I would start here first.
I'm using Packer to build a Windows 2012 R2 base image on AWS for our deployments. I run into an issue related to the KB3035131 package. Basically, however it installs itself (whether directly, or as part of installing the dotnetcore-runtime package) it always fails with the following error:
amazon-ebs: Failures
amazon-ebs: - kb3035131 (exited 5) - Error while running 'C:\ProgramData\chocolatey\lib\KB3035131\Tools\ChocolateyInstall.ps1'.
amazon-ebs: See log for details.
amazon-ebs: Installing KB3035131...
amazon-ebs: WARNING: User (you) cancelled the installation.
amazon-ebs: WARNING: Update KB3035131 installation failed (exit code 5).
amazon-ebs: WARNING: More details may be found in the installation log (C:\Users\Administrator\AppData\Local\Temp\chocolatey\KB3035131.Install.evt) or the system CBS log (C:\Windows\Logs\CBS\CBS.log).
amazon-ebs: ERROR: Update KB3035131 installation failed (exit code 5).
amazon-ebs: The install of kb3035131 was NOT successful.
amazon-ebs: Error while running 'C:\ProgramData\chocolatey\lib\KB3035131\Tools\ChocolateyInstall.ps1'.
amazon-ebs: See log for details.
This is similar to a previous issue: https://github.com/chocolatey/chocolatey-coreteampackages/issues/623
Chocolatey should install the kb3035131 package in Packer via WinRM without throwing an error.
Installation fails no matter how you install the package
Gist containing all of the relevant files and logs: https://gist.github.com/sc250024/fede4468306417c9cdee5e2702a6cb09
KB3035131 v1.0.1For anyone experiencing this, I found a solution:
"provisioners": [
{
"type": "powershell",
"elevated_user": "Administrator",
"elevated_password": "{{ .WinRMPassword }}",
"inline": [
"Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))",
"choco install -y dotnetcore-runtime"
]
}
]
Simply run the commands with the elevated_ tags I have above, and that does the trick. Seems fairly obvious now, but definitely wasn't at the time 馃槃
@sc250024 glad that you found a way to make it work. Sorry about not responding to the issue before now though.
For anyone experiencing this, I found a solution:
"provisioners": [ { "type": "powershell", "elevated_user": "Administrator", "elevated_password": "{{ .WinRMPassword }}", "inline": [ "Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))", "choco install -y dotnetcore-runtime" ] } ]Simply run the commands with the
elevated_tags I have above, and that does the trick. Seems fairly obvious now, but definitely wasn't at the time 馃槃
thanks you saved my life
Most helpful comment
For anyone experiencing this, I found a solution:
Simply run the commands with the
elevated_tags I have above, and that does the trick. Seems fairly obvious now, but definitely wasn't at the time 馃槃