-
Notifications
You must be signed in to change notification settings - Fork 897
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
Rerunning Install Script after reboot should not be necessary #3327
Comments
This commit introduces the idea that the dotnet installation needing a reboot should not immediately halt the Chocolatey installation, but instead proceed as far as possible - then prompt for a reboot.
I believe when I originally spoke to people about this I suggested that we could make it non-default behaviour, behind a switch or environment variable (similar to using Windows compression instead of 7zip), but as I have encountered this issue more I have decided that this is not a breaking change and is fine to be the default behaviour. We could throw at the end of the install script, though, if we really wanted to indicate that something went wrong. I would suggest we follow msiexec, for instance, though, and exit without throwing. |
This commit introduces the idea that the dotnet installation needing a reboot should not immediately halt the Chocolatey installation, but instead proceed as far as possible - then prompt for a reboot.
I'm encountering this problem with a client at the moment. They use VMs based on Windows Server 2019 Datacenter edition. Chocolatey is deployed via PowerShell DSC but installation fails since Chocolatey 2.x for this exact reason. Rebooting and trying again hasn't proven a reliable solution. Merging the related PR should solve our issues. |
@leonmelein have you tried installing .NET 4.8, rebooting and then installing Chocolatey CLI?
Can you elaborate on this? |
@pauby The Chocolatey installation is performed by means of a custom script extension in Azure, performed after deployment of the VM. The extension pull the latest version of Chocolatey from an internal repository and runs the install script. Custom script extensions cannot handle reboots in Azure, as per Microsoft:
Given the circumstances at this client, I cannot change the way the machines are provisioned, e.g. providing a custom image or using a more recent Windows Server image. Hope that gives a little more clarity. When I perform the installation manually, everything works as advertised. |
@leonmelein that helps. If you install. NET 4.8 you need to reboot before you can install Chocolatey CLI (or anything as .NET 4.8 requires a reboot too be installed). If you install Chocolatey CLI then it will install .NET 4.8 and require you to reboot before you can use it. In both situations you need to reboot, which you can't do. Can you explain how this PR will fix your situation? On the surface it sounds like the requirement for .NET 4.8, however it's done, is going to have the same result? |
Yes, eventually a reboot will be necessary. If the Chocolatey installation itself isn't held up by the pending reboot, I could make sure the reboot happens at the very end of the VM deployment. That would be by using the AzureCLI@2 task and the At the moment, this isn't an option since there are several custom script extensions being executed sequentially directly after the deployment of the VM. This is managed completely by Azure and I cannot mix in an Azure CLI command while these extensions are running. |
This maybe a dumb question. Could you not install .NET 4.8 as part of the VM deployment, then reboot? Then as part of the provisioning (which I assume happens afterwards) install Chocolatey CLI, software, etc.? |
That's not a dumb question. The issue with these custom script extensions is that they're executed as part of the deployment, not as separate actions. In theory we might be able to refactor this process and use a different approach, but given we're using scripts provided by another internal team that would require significant effort and coordination. |
Thanks for that. Just to set expectations, any change to the Chocolatey CLI installation script goes through extensive testing with all products that use it. So this isn't something that is likely to be implemented soon. |
This commit introduces the idea that the dotnet installation needing a reboot should not immediately halt the Chocolatey installation, but instead proceed as far as possible - then prompt for a reboot.
This commit introduces the idea that the dotnet installation needing a reboot should not immediately halt the Chocolatey installation, but instead proceed as far as possible - then prompt for a reboot.
Won't run in environments where DotNet 4.8 has been installed where running in PS<=3, due to the issues found when testing in those environments. Also improves the handling of errors, as previously we were never "reaching" an error due to the way Choco CLI's streams and exit codes work out.
This commit introduces the idea that the dotnet installation needing a reboot should not immediately halt the Chocolatey installation, but instead proceed as far as possible - then prompt for a reboot.
Won't run in environments where DotNet 4.8 has been installed where running in PS<=3, due to the issues found when testing in those environments. Also improves the handling of errors, as previously we were never "reaching" an error due to the way Choco CLI's streams and exit codes work out.
This commit introduces the idea that the dotnet installation needing a reboot should not immediately halt the Chocolatey installation, but instead proceed as far as possible - then prompt for a reboot.
Won't run in environments where DotNet 4.8 has been installed where running in PS<=3, due to the issues found when testing in those environments. Also improves the handling of errors, as previously we were never "reaching" an error due to the way Choco CLI's streams and exit codes work out.
(#3327) Improves UX of Chocolatey Install without 4.8
🎉 This issue has been resolved in version 2.3.0 🎉 The release is available on: Your GitReleaseManager bot 📦 🚀 |
Checklist
Is Your Feature Request Related To A Problem? Please describe.
The user-experience when installing Chocolatey on a system that lacks dotnet 4.8 could be improved, and our most used flow requires:
This is less than ideal, introduces complexity, and could be improved.
Describe The Solution. Why is it needed?
I would suggest, given that the rest of the install seems to work fine without the reboot, that we proceed with the rest of the installation after the dotnet installation.
This would result in a system that, though needing a reboot, will come up from the reboot with a fully functional Chocolatey install - and no further required steps.
Given that Chocolatey itself prevents users from running any command beyond -v/--version when 4.8 is not installed correctly (and has an appropriately explicit error message), this should not introduce a particularly awful level of confusion.
It shouldn't break any automation, either, as the install is fairly idempotent so anyone who already is running the script, rebooting, and running it again should just work.
This is also, to me, far closer to other software installations - and my expectations of running an install script.
Additional Context
Example of a modified install proceeding after dotnet is installed (but no reboot):
Example of the current error message produced when there has not been a reboot:
Related Issues
No response
The text was updated successfully, but these errors were encountered: