-
Notifications
You must be signed in to change notification settings - Fork 54
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
SHA256 not matching while installing docker #15
Comments
@jaydeepjc, |
@jayshah-msft |
@nampdn Start-BitsTransfer -Source https://dockermsft.blob.core.windows.net/dockercontainer/docker-1-12-2-cs2-ws-beta.zip -Destination /docker.zip Get-FileHash -Path /docker.zip -Algorithm SHA256 Please provide the output. Thanks! |
I see that your SHA256 is as expected and I am glad to see that your install works fine. I would still like to know why your first attempt said SHA did not match. Cheers, |
@jaydeepjc, $destinationFolder = "Path to the destination folder" Thanks for your help. |
I can Download and SHA is exactly the same which is in JSON file
However when tried to install, issue still persists
|
I've had exactly the same problem at first and I've identified the reason: I had a file Get-FileHash.ps1 in my path, and it was called by powershell instead of built-in command. |
@DmitryKakurin, Cheers, |
I don't have Get-FileHash.ps1 file in my path. |
@jaydeepjc, I recommend you change Get-FileHash to Microsoft.PowerShell.Utility\Get-FileHash in DockerMsftProvider.psm1. Relaunch PowerShell to see how it goes. |
I did the changes you suggested, still problem persists. Is there any way to stop verifying SHA256? |
You can, but not recommended. Write-Verbose "$hash $Destination $fileHash $fileSha256" |
I did added above lines on mentioned line numbers. Output is as below,
|
Please try adding these and run again. Thanks! |
Code looks like below, is it correct one which I have written?
OUTPUT is as below
|
fileHash is null, meaning Get-FileHash returns null. That;s the reason hash does not match. can you please add the following?
|
Below is output
|
It looks like Get-FileHash returns null on your machine. |
|
hmm... need to debug it.
|
I debug hash , filehash, destination, filehashsha256 however doesnt get any error message
|
|
My OS IS Windows 2016 Server
Details are in attached file |
I can see two potential issues. Let’s try to isolate problems whether it is related to download zip file issue or Get-FileHash issue. PS C:\> get-module
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 3.1.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Object...}
Script 1.2 PSReadline {Get-PSReadlineKeyHandler, Get-PSReadlineOption, Remove-PSReadlineKeyHandler, ...
PS C:\> Microsoft.PowerShell.Utility\Get-FileHash $pshome\powershell.exe
Algorithm Hash Path
--------- ---- ----
SHA256 BA4038FD20E474C047BE8AAD5BFACDB1BFC1DDBE12F803F473B7918D8D819436 C:\Windows\System32\WindowsPowerShell\v1.0\powers...
Step1: Step 2:
Step 3:
If $a is null, it is the get-filehash issue on your machine. If $a is not null, It may be the downloading Docker-1-12-2-cs2-ws-beta.zip' issue. let’s continue. Step 5. Remove the code added in Step 2. Add the following code right after line 1647, i.e. “Write-Verbose "Verifying Hash of the downloaded file."
Step6:
Step 7:
} |
get-module and Microsoft.PowerShell.Utility\Get-FileHash $pshome\powershell.exe working properly as you mention above. I got below error
|
Rename C:\Program Files\WindowsPowerShell\Modules\MicrosoftDockerProvider to C:\Program Files\WindowsPowerShell\Modules\MicrosoftDockerProvider .org |
There no folder MicroSoftDockerProvider, I renamed DockerMsftProvider to DockerMsftProvider.org then below Output
|
install-module DockerMsftProvider -force -verbose |
My Code is
And below is output
It look likes get-filehash issue is there |
Folks, I've faced the same issue and it turned out that if you execute |
I too encounter the same error. Any solution? The package(s) come(s) from a package source that is not marked as trusted.
|
The solution, in my case at least, was to modify the Beginning at line 1133, change this:
to this:
When the request sends the On the other hand, when we send the HTH |
any updates? still got Docker-17-06-2-ee-13.zip does not exist on windows server 1709 |
Got same issue on Windows server 1803, still trying to find a workaround. |
What I have confirmed is that the hash is not verified because the file is not at destination, but couldn't find the line that downloads the docker...zip file as it looks like it's not the same as the function that downloads the .json file. Doing:
It will work only without -Force, because -Force flag also removes the file before downloading and then it doesn't downloads there. File that I have been checking for debugging:
I have never seen the package in the temp folder |
First of all I would like to say thank you for all you guys for the info provided in this Issue. Cheers!!! |
Fix the script:
The script tested on WindowsServer2016core-hyper 14393.0.161119-1705.RS1 work script: https://gist.github.com/MagicJohnJang/46655c4b3228ca2f636e38fc7c84eb11 |
i have the same problem. pull the 18.03 is ok |
to fix it just start BITS service |
Similar issue with https://github.com/MicrosoftDocs/Virtualization-Documentation/issues/1158 |
So, the general fix seems to update the package provider to the latest version available. Find-PackageProvider DockerMsftProvider | Install-PackageProvider Then try to install a new Docker package. |
Same issue here - none of the solutions provided above had worked for me. Windows Server 2019. |
@hades200082 did you try the suggestion from @AdamWyzgol too? That just fixed this error for me on a fresh Server 2019 install. |
I faced the same issue and this is how I got it fixed.
Here the main point to look at DockerDefault_DockerSearchIndex.json file in the above mentioned directory. In there you can see SHA256 for docker distrubutions. Check that against the file you get (you can check the SHA by Get-FileHash -Path docker-18-09-0.zip -Algorithm SHA256). Then you can download the correct file and proceed. |
I did manage to get around this issue eventually using the details above but I've given up with Docker on Windows for the time being because it just doesn't seem reliable and stable enough. Too many things just don't work (try running a container as a DNS server - can't bind port 53 at all on windows) I've spun up a Linux VM to run all things docker for now. Everything just works there. |
These fixes work every now and then. I am on a new installation of Server 2019 e I can't them to work. |
I haven't been able to repro this bug. An install on a fresh Windows Server 2019 and Windows Server, version 1903 just worked, so it's made it hard to track down what exactly is going wrong. Reading through the thread, it appears the SHA errors all come back to the issue that Invoke-WebRequest is not completing it's download of the file. So, for folks poor network connectivity, the timeout occurs and the SHA fails. Thus. the suggestions by some folks to use BITStransfer as a work-around because I don't think this has a built-in timeout. That's the theory, anyways. What would be most helpful to me is: for folks who are hitting this issue:
I am wondering if increasing |
@cwilhit Yes to both questions. |
Are you able to test on a deliberately-slowed network? Here's one way to create such an environment: https://www.codeproject.com/Articles/18243/Bandwidth-throttling You might consider using |
Thanks for the hint @InteXX |
FYI here's the detail again for the fix: |
I commented out the
So, This was my changed code in function VerifyHashCheck
{
param
(
[parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.String]
$Destination,
[parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.String]
$hash
)
if (!(Test-Path $Destination)) {
Write-Verbose "File $Destination does not exist."
}
Write-Verbose "Verifying Hash of the downloaded file."
Write-Verbose "downloaded file: $(dir $Destination)"
$fileHash = Get-FileHash -Path $Destination `
-Algorithm SHA256
if($fileHash.Psobject.properties.name -Contains "Hash")
{
$fileSha256 = $fileHash.Hash
}
else
{
Write-Verbose "Hash for the original file not available."
return $false
}
Write-Verbose ("SHA256 should be $hash")
Write-Verbose ("SHA256 actually is $fileSha256")
return ($hash -ieq $fileSha256)
} ping @cwilhit I don't know if we can fix this using I tried
|
This is awesome! When should we expect to have it released? |
The update is out now |
I just had to do an install again, and it worked perfectly. It failed, then I updated the provider, tried again, and it worked. Tks! |
I am able to find package
Find-Package -providerName DockerMsftProvider -AllVersions
Name Version Source Summary
Docker 1.12.2-cs2-ws... DockerDefault Contains the CS Docker Engine for use with Windows ...
But when I tried to install I am getting SHA256 mismatch error
PS C:> Install-Package -Name docker -ProviderName DockerMsftProvider -Verbose
VERBOSE: Using the provider 'DockerMsftProvider' for searching packages.
VERBOSE: Download size: 0MB
VERBOSE: Free space on the drive: 40384.86MB
VERBOSE: Downloading https://dockermsft.blob.core.windows.net/dockercontainer/DockerMsftIndex.json to
C:\Users\ADMINI~1\AppData\Local\Temp\2\DockerMsftProvider\DockerDefault_DockerSearchIndex.json
VERBOSE: About to download
VERBOSE: Finished downloading
VERBOSE: Downloaded in 0 hours, 0 minutes, 2 seconds.
VERBOSE: Performing the operation "Install Package" on target "Package 'Docker' version '1.12.2-cs2-ws-beta' from
'DockerDefault'.".
The package(s) come(s) from a package source that is not marked as trusted.
Are you sure you want to install software from 'DockerDefault'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): A
VERBOSE: Containers feature is already installed. Skipping the install.
VERBOSE: Verifying Hash of the downloaded file.
WARNING: Cannot verify the file SHA256. Deleting the file.
VERBOSE: Hash verified!
WARNING: C:\Users\ADMINI
1\AppData\Local\Temp\2\DockerMsftProvider\Docker-1-12-2-cs2-ws-beta.zip does not exist1\AppData\Local\Temp\2\DockerMsftProvider\Docker-1-12-2-cs2-ws-beta.zip' because it does not exist.Install-Package : Cannot find path
'C:\Users\ADMINI
At line:1 char:1
What to Do?
The text was updated successfully, but these errors were encountered: