-
Notifications
You must be signed in to change notification settings - Fork 190
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
Install-PackageProvider -Name NuGet not working after upgrade from WMF 4.0 to 5.0 #195
Comments
Did you solve it? |
No solution yet. Some followup over here in comments: |
Try running it with the |
Here's what I posted in the thread I linked to. Still no resolution. I installed .NET 4.6.1, then I installed WMF 5.0. PS T:> dir ‘HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\’ Hive: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full Name Property Here is the requested output of the commands. PS T:> Get-Module PackageManagement,PowerShellGet -ListAvailable Directory: C:\Program Files\WindowsPowerShell\Modules ModuleType Version Name ExportedCommands PS T:> Get-PackageProvider -debug -verbose Confirm |
@favorini, thanks for reporting it. I tried to repro it but no luck. I need your help to get some more data for the investigation. Can you do the following assuming your system dir is c:? dir C:\Program Files\WindowsPowerShell\Modules\PackgeManagement
dir C:\Program Files\WindowsPowerShell\Modules\PackgeManagement\1.0.0.1
dir C:\Windows\System32\WindowsPowerShell\v1.0\Modules\PackgeManagement
get-hotfix KB3134760
Import-Module "C:\Program Files\WindowsPowerShell\Modules\PackageManagement\Microsoft.PackageManagement.CoreProviders.dll" -verbose
get-module
$a=[Microsoft.PackageManagement.Providers.Internal.Bootstrap.BootstrapProvider]::new()
$a.PackageProviderName Clean up providers, see here for the instructions |
|
BTW, the ProviderAssemblies directories are empty.
|
Hmmm. Your settings look fine to me. Let's see if FindAssembly is functioning properly on your machine. $a=[System.IO.Path]::GetFullPath("C:\Program Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageManagement.ArchiverProviders.dll")
[System.IO.File]::Exists($a) |
|
The issue was that I had FIPS enabled on the machine in question. Disabling FIPS solved it. MD5 hash implementation is not FIPS-Compliant. You can verify the FIPS issue as follows:
|
With FIPS disabled it works. (Don't forget to reboot after disabling FIPS.)
|
Thanks for coming back with a work around. Is there any chance we're going to see this work with FIPS turned on however? The organization I work wants to leverage this, but they requires FIPS to be enabled. |
For this particular issue, we made the fix by changing MD5 to SHA1 which works on FIPS enabled machines. OneGet uses it to uniquely identify processed providers, not security related, so SHA1 is fine. |
Is there a fix or workaround for this short of disabling FIPS? I work in an environment were FIPS is required, and would really like to get this working. Disabling FIPS isn't an option. |
@bbasselgia , the PackageManagement module we just published last week on the PowerShellGallery contains the fix. You may follow our blog to try it out. thx |
This is getting a bit frustrating. for something that is suppose to make life easier, this shouldn't be that hard. If this actually worked it would be great. But, there are a lot of us who work in disconnected environments, not having a stand alone installer for this stuff is leaving us high and dry. I'm still not able to get any of the package managment commands to work. Platform ServicePack Version VersionString Win32NT Service Pack 1 6.1.7601.65536 Microsoft Windows NT 6.1.7601 Service Pack 1 PS U:> $PSVersionTable Name Value PSVersion 5.0.10586.117 FIPS is enabled and cannot be disabled, even temporarily. When I try to install any module with the install-module command, it tells me in needs NuGet. I tell it yes to install NeGet and it fails with: Unable to find repository with SourceLocation ''. get-packageprovider -listavailable returns nothing. get-psrepository fails with: Unable to find module providers (powershellget). I have no doubt that the security settings on my system (such as the FIPS requirement) are causing the problems. Any help getting this working would be greatly appreciated. |
I am currently tied up with other work. I look into it after a week or so. Sorry for the inconvenience. |
@jianyunt , you are correct, disabling FIPS allows this to function. However, the PackageManagement module you mention above does not resolve the issue when FIPS is enabled. The updated module throws the following error when fips is enabled: `PackageManagement\Install-Package : Package 'xWebAdministration' failed to be installed because: Exception has been
That being said, I am able to use local repositories. The workaround I am using is to temporarily disable fips (adjust the registry key), save the module to my local repository, and re-enable fips. It works, but it would be fantastic if this were fips-compliant. |
@bbasselgia, @mtrog thanks for you info. I tried on my Win10 box, I was not able to repro it. On FIPS enable machine, I saw the exception as you mentioned above. See details below. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. --->
System.InvalidOperationException: This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.
at System.Security.Cryptography.SHA512Managed..ctor()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Security.Cryptography.CryptoConfig.CreateFromName(String name, Object[] args)
at System.Security.Cryptography.SHA512.Create()
at Microsoft.PackageManagement.NuGetProvider.NuGetClient.InstallPackage(String packageName, String version, NuGetRequest request, PackageSource source,
String queryUrl, String packageHash, String packageHashAlgorithm, ProgressTracker progressTracker) |
Yes. My workaround is to use set-itemproperty to change the value of On Wed, Oct 19, 2016, 12:18 PM Jianyun notifications@github.com wrote:
|
@mtrog, @bbasselgia, may I ask you favor? I made code change for fixing this issue and the build is out, see here. You need to download the zip, unzip it, and copy the entire folder to your target machine under "$env:ProgramFiles\WindowsPowerShell\Modules\PackageManagement\1.1.0.0" Because the binaries are not signed. You need to run ignore strong name verification. See how our test does it. After that, relaunch PowerShell console. Please let me know it it works for you. Thanks again! |
I've hit the same issue with FIPS compliance enabled. I'll test this tomorrow too.... |
@pburkholder thank you. Please make sure the NuGetProvider is loaded from the package. You can delete the Nuget provider from $env:ProgramFiles\PackageManagement\ProviderAssemblies\nuget first before launching the PowerShell Console. Get-PackageProvider -name NuGet | fl to check if it is loaded from the OneGet folder. |
Hi - This looks good. I unzipped your package as directed, and ran the registry updates per https://gist.github.com/pburkholder/2ff8afd73043e836ddcbfa9d158ae21c. Then started a new Admin powershell:
|
I unzipped the package, moved the files, and disabled strong name validation per your instructions. I am now unable to import the packagemanagement module. See below: `Windows PowerShell PS C:\WINDOWS\system32> import-module PackageManagement
I did not reboot the server to test this, but I did relaunch powershell as an administrator. |
Thank you @pburkholder for the validation. |
@mtrog, is it possible your machine is somehow blocking the files from getting dll loaded. Can you please try: If you see "This file came from another computer and might be blocked to help protect this computer" under Security, click on unblock check box. |
My apologies, an oversight on my part. You were correct, the files were blocked. That being said...
The behavior with FIPS disabled:
|
@mtrog, can you please make sure you remove the existing nuget provider first and then launch the PowerShell console. thx again for trying it. |
it works now, thanks!
|
Great. Thank you! The change will be published to PowerShellGallery.com soon. |
I had the same issue with I could NOT remove the nuget provider from within powershell |
@jianyunt Look forward to the upcoming release. Can you update this issue when that happens? Thanks, Peter |
Just published the PackageManagement module to PowerShellGallery.com. |
Problem:
Solution:
Open a new powershell and test with
|
Hi, I'm having a problem very similar to the OP, except that I don't have FIPS policies enabled. I've already double-checked connectivity, and I can watch PowerShell attempting to reach 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' via packet capture. I don't have a MitM proxy enabled, so I can't be certain what's going on in the session, but I can see the TLS handshake with the server. I used the example in your last post to update both PackageManagement and PowerShellGet to their latest versions (1.1.4.0 and 1.1.3.1, respectively) installed in the local user account's PowerShell modules directory, and verified the working versions with Get-Module.
Every time I try anything similar to 'Install-Module -Scope CurrentUser PSScriptAnalyzer', I get kicked back to the requirement for the NuGet provider, which always fails to install. I've also performed all the above tests, which function correctly. The only other difference from the above is that I believe I went directly from PowerShell 4.x to 5.1. I have no proxy, and I disabled all forms of adblocking (DNS included) while testing. There is nothing installed that should be interrupting or mangling outside connectivity. Obviously, I can download the URI PowerShell is trying for by using a browser--any browser. Again, I have no proxy. (I control all aspects of the local network.)
|
Does PackageManagement 1.1.3.0 work for you? We are seeing #289 issue on download level WS2012 R2 machine. What's your os? |
@jianyunt I provided that information. My situation is nearly identical to the OP, who is running 7 SP1 x64. I'm also running 7 SP1 x64. The only significant difference is that I do not have FIPS policies enabled. My ProviderAssemblies folders are empty, like the OP's and so forth. I cannot install or upgrade any packages, as I explained in my comment. |
re-launch powershell now find-module xjea for example |
|
go ahead rename or delete 1.1.4.0 folder under PackageManagement . |
I don't think you understand. I can't install any packages at all that require any kind of download from microsoft.com. See again:
|
I suspect it's caused by the new version of PackageManagement, 1.1.4.0. That's why I am asking you to delete 1.1.4.0 and try find-module or package again. |
Yes, I understand. I tested with the version shipped with PowerShell (WMF 5.1 for 7 SP1 x64) and with 1.1.3.0 before I realized that 1.1.4.0 was available. The results are the same in all three cases: I can't download anything, and I can't install a package unless I go to the trouble of downloading every component by hand. Whichever package manager is in control, it always demands that NuGet be installed, then fails to install it. I've seen this exact problem (7 SP1, WMF 5.1, NuGet download failure even though Internet connectivity without a proxy is present) reported on several Microsoft forums, but with no resolution. Is there any way to get more logging from whatever components are providing the actual download capability? The fact that OneGet can contact Microsoft (Akamai) servers, but refuses to download and install packages, makes me wonder if it's a different problem in SChannel, or somewhere else in the stack. |
@rmenessec Did you manually copy 1.1.4.0 version on your machine considering you cannot download any modules? |
@rmenessec - if you would be willing to work with us directly on this, please send email to keithb at microsoft dot com (trying to avoid gh trolls), and we can set up a time where we can work with you directly. |
@rmenessec Some questions:
webClient.DownloadFileCompleted += (sender, args) => {
if (args.Cancelled || args.Error != null) {
localFilename = null;
}
done.Set();
} ...since the message has an empty |
1: Sure! 2: Sure! Can you provide the full command line you'd like to see invoked? Just 'Update-Module -Debug', or are there other options or conditions that you're looking for? I see that it produces a huge amount of output; what's the easiest way to log this? And can I log it without having to run it interactively? 3: When you say 'capture', do you mean console output, packets, or both? I can't do the packet capture side immediately, but otherwise yes. Or—if you're looking for the contents of a TLS session, probably not; not unless you have a way to downgrade the connection to HTTP. Otherwise, I'd have to set up something like mitmproxy, which isn't entirely trivial. Side note: I'm getting ready to upgrade the victim machine from 7SP1 to 10 with a clean reinstall; hopefully in the next two weeks. Since I'm 99.9% sure this isn't related to my network environment or anything hiding in the related infrastructure (DNS and so forth), chances are pretty good this will wipe out... whatever's causing PowerShell's network operations to fail selectively. Since I plan to reinstall my handful of PowerShell modules, though, it seems possible that there's something in there that kicked off this whole mess... |
It seems like the original issue w.r.t WMF 4 to WMF5 is resolved. Hence closing this one. |
I am still not able to install modules when in FIPS mode. Is there any intent on correcting this? |
i was able to solve this by forcing TLS 1.2: PS C:\Windows\system32> [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 PS C:\Windows\system32> Install-PackageProvider nuget Name Version Source Summary nuget 2.8.5.208 https://onege... NuGet provider for the OneGet meta-package manager |
Got the same type of issue, check the below link, if this solution helps !!! Thanks. https://azurelessons.com/unable-to-find-package-providers-nuget/ |
Upgraded from WMF 4.0 to WMF 5.0 on Windows 7 SP1 x64 with .NET 4.6.1 and can't get NuGet/OneGet etc. to work at all. Already tried uninstall of WMF 5.0 and reinstall to no avail. Also tried Set-ExecutionPolicy Bypass--same error.
The text was updated successfully, but these errors were encountered: