-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error on Windows Server build during chocolatey installation #585
Comments
Hello, Kennochas! 🖐 Thank you for your submitting an issue for the project. We will respond soon. If you want to contribute to this project, please review the contributing guidelines. |
I looks like chocolatey changed the install source... From: https://chocolatey.org/install.ps1 To: https://community.chocolatey.org/install.ps1 Mind testing that? |
Please note that the |
Both of those URL's work, and actually go to the same file. |
You can see it more, if you open https://community.chocolatey.org/api/v2/package/chocolatey and dig into the package for the chocolateysetup.psm1 file. https://docs.chocolatey.org/en-us/choco/release-notes under breaking changes: Upgrade to target version 4.8 of the .NET Framework - see #2738. |
Thanks for the issue. I'll take a look but may remove chocolatey from One option might be to test flipping the following so that updates occur first - not sure if that will resolve the issue however. provisioner "windows-update" {
pause_before = "30s"
search_criteria = "IsInstalled=0"
filters = [
"exclude:$_.Title -like '*VMware*'",
"exclude:$_.Title -like '*Preview*'",
"exclude:$_.Title -like '*Defender*'",
"exclude:$_.InstallationBehavior.CanRequestUserInput",
"include:$true"
]
restart_timeout = "120m"
}
provisioner "powershell" {
elevated_user = var.build_username
elevated_password = var.build_password
inline = var.inline
} |
Yea, I personally just commented out Chocolatey. Another way that I know for sure you could do, is use ansible to provision the .net 4.8 and reboot if required, and then install chocolatey. |
Removes the installation of Chocolatey from the Microsoft Windows guest operating system builds. .Net 4.8 is required before installation. This can be managed by the user instead of this project. Ref: #585 Signed-off-by: Ryan Johnson <[email protected]>
Removes the installation of Chocolatey from the Microsoft Windows guest operating system builds. .Net 4.8 is required before installation. This can be managed by the user instead of this project. Ref: #585 Signed-off-by: Ryan Johnson <[email protected]>
Removes the installation of Chocolatey from the Microsoft Windows guest operating system builds. .Net 4.8 is required before installation. This can be managed by the user instead of this project. Ref: #585 Signed-off-by: Ryan Johnson <[email protected]>
I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. |
Code of Conduct
Project Version
main
VMware vSphere
7
HashiCorp Packer
1.8.2
HashiCorp Packer Plugin for VMware vSphere
1.0.6
Guest Operating System
Windows Server
Environment Details
No response
Description
It seems like something happened upstream with chocolatey, where .NET Framework 4.8 is required now, and breaks the current method the install uses
Chocolatey installs it in chocolateysetup.psm1 via the function Install-DotNet48IfMissing, then returns that a reboot is required.
Expected Behavior
Image built
Actual Behavior
==> vsphere-iso.windows-server-standard-core: Provisioning with powershell script: /tmp/powershell-provisioner1242506124
vsphere-iso.windows-server-standard-core: Forcing web requests to allow TLS v1.2 (Required for requests to Chocolatey.org)
vsphere-iso.windows-server-standard-core: Getting latest version of the Chocolatey package for download.
vsphere-iso.windows-server-standard-core: Not using proxy.
vsphere-iso.windows-server-standard-core: Getting Chocolatey from https://community.chocolatey.org/api/v2/package/chocolatey/2.0.0.
vsphere-iso.windows-server-standard-core: Downloading https://community.chocolatey.org/api/v2/package/chocolatey/2.0.0 to C:\Users\admin
1\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip1\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip to C:\Users\adminvsphere-iso.windows-server-standard-core: Not using proxy.
vsphere-iso.windows-server-standard-core: Extracting C:\Users\admin
1\AppData\Local\Temp\chocolatey\chocoInstall1\AppData\Local\Temp\ndp48-x86-x64-allos-enu.exe' - the installer is 100+ MBs, so this could take a while on a slow connection.vsphere-iso.windows-server-standard-core: Installing Chocolatey on the local machine
vsphere-iso.windows-server-standard-core: The registry key for .Net 4.8 was not found or this is forced
vsphere-iso.windows-server-standard-core: Downloading 'https://download.visualstudio.microsoft.com/download/pr/2d6bb6b2-226a-4baa-bdec-798822606ff1/8494001c276a4b96804cde7829c04d7f/ndp48-x86-x64-allos-enu.exe' to 'C:\Users\admin
vsphere-iso.windows-server-standard-core: Installing 'C:\Users\admin~1\AppData\Local\Temp\ndp48-x86-x64-allos-enu.exe' - this may take awhile with no output.
vsphere-iso.windows-server-standard-core: .NET Framework 4.8 was installed, but a reboot is required.
vsphere-iso.windows-server-standard-core: Please reboot the system and try to install/upgrade Chocolatey again.
vsphere-iso.windows-server-standard-core: At C:\Users<sensitive>\AppData\Local\Temp\chocolatey\chocoInstall\tools\chocolateysetup.psm1:815 char:11
vsphere-iso.windows-server-standard-core: + throw ".NET Framework 4.8 was installed, but a reboot is re ...
vsphere-iso.windows-server-standard-core: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vsphere-iso.windows-server-standard-core: + CategoryInfo : OperationStopped: (.NET Framework ...ocolatey again.:String) [], RuntimeException
vsphere-iso.windows-server-standard-core: + FullyQualifiedErrorId : .NET Framework 4.8 was installed, but a reboot is required.
vsphere-iso.windows-server-standard-core: Please reboot the system and try to install/upgrade Chocolatey again.
vsphere-iso.windows-server-standard-core:
==> vsphere-iso.windows-server-standard-core: Provisioning step had errors: Running the cleanup provisioner, if present...
==> vsphere-iso.windows-server-standard-core: Power off VM...
==> vsphere-iso.windows-server-standard-core: Destroying VM...
==> vsphere-iso.windows-server-standard-core: Deleting cd_files image from remote datastore ...
Build 'vsphere-iso.windows-server-standard-core' errored after 12 minutes 57 seconds: Script exited with non-zero exit status: 1. Allowed exit codes are: [0]
Steps to Reproduce
Try to build server 2019 or if you still have 2016, it fails too.
Log Fragments and Files
Screenshots
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: