-
Notifications
You must be signed in to change notification settings - Fork 907
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
Handle PowerShell's InitializeDefaultDrives
Error (that should just be a warning)
#349
Comments
@adamsea I wonder if this is an issue with NuGet itself. I've actually never heard of that error before. Perhaps we can try to figure out where it is occurring a little better? Try using |
@ferventcoder I re-ran the install with
Note that the "Attempting to perform the InitializeDefaultDrives operation on the 'FileSystem' provider failed." error came directly after the powershell command. Thanks for taking a look! |
The system specific information (the configuration) is not known to contain anything sensitive, and is sometimes very helpful in determining what may be wrong in your environment. However we want folks to look over that information and remove anything that may be sensitive if it appears. In this case, I'm not sure we need it. Looks like a powershell issue. Something you can resolve on your own:
It looks like we need to handle this with chocolatey and not treat it as an error. |
Forgot to add all of the references. You will see those on the repo - I will update that. |
InitializeDefaultDrives
Error (that should just be a warning)
Ok thanks @ferventcoder in the meantime I'll try fixing it on my side and verify that fixes the install error! |
@adamsea did it work? |
@adamsea ping |
If you have a network drive that is not available or has been disconnected, PowerShell will happily throw an error about it with the following message: "Attempting to perform the InitializeDefaultDrives operation on the 'FileSystem' provider failed." Since it is not really an error, we should log the message accordingly and move on, but not fail the choco install due to some crazy warning that for some reason is an error message.
Hi @ferventcoder - apologies for the delayed response - yes fixing the disconnected network drive resolved the issue. Thank you for looking into this! |
👍 |
When running PowerShell operations, use a built-in PowerShell host by default, allowing fallback to the older method of running Posh by calling an external process. By building against the oldest version of System.Management.Automation that aligns with the oldest Windows Operating Systems supported, we can guarantee this will work on every version of Windows where Chocolatey is supported. In case we do run into issues, attempt to resolve the PowerShell assemblies starting from the newest version and falling down to the older versions until one is resolved or no version is resolved. There is a known assembly that will go through this process every time - System.Management.Automation.resources, en-US. To see those assemblies go through, one must ask for both debug and verbose output. This reverts the changes for chocolateyGH-249 in 9936876 and the changes from chocolateyGH-349 in 344268b so that both paths (system powershell and choco's built-in PowerShell) run with similar output and because by default in d523e7b (chocolateyGH-445) choco no longer fails on the presence of stderr output.
Hello,
I began having an issue today with all install/upgrade operations in chocolatey. A sample of the error is attached:
The related debug info is here:
Whatever program I install with
choco install
will still install, it just won't appear on subsequentchoco list --local-only
commands, and all related files are in lib-bad.The "Attempting to perform the InitializeDefaultDrives operation on the 'FileSystem' provider failed." issue is from a disconnected network drive, but that shouldn't be mapping anything from the default install directory. Could that error still be the root of this issue, or is this a known issue?
Thanks,
-Eric
The text was updated successfully, but these errors were encountered: