0

I"m following the guide on this page below. But I keep getting error below. I'm using Win 10 Enterprise 1809

"Invoke-WebRequest : The remote name could not be resolved: 'dist.nuget.org'"

https://doc.sitecore.com/developers/100/developer-tools/en/walkthrough--using-the-getting-started-template.html

enter image description here

I tried the solution on this page below but didn't work:

https://containers.doc.sitecore.com/docs/troubleshooting#windows-containers-cant-access-the-internet

3
3

That might be related to your firewall settings.

One of the things you can try is to add custom DNS to Docker engine config file. You can use the Google one - 8.8.8.8

The format is as following:

"dns":["8.8.8.8"]

It should look like this: enter image description here

2

I had this similar error and none of the above solutions worked.

As a workaround, I tried the below steps:

  1. Downloaded nuget.exe, manually using this https://dist.nuget.org/win-x86-commandline/v5.6.0/nuget.exe
  2. Create an empty folder as "Nuget" under "C:\Program Files". -- C:\Program Files\Nuget
  3. Copy the nuget.exe to C:\Program Files\Nuget\
  4. Comment this line in Dockerfile, available in ROOT_PROJECT\docker\build\dotnetsdk\Dockerfile
  5. ## RUN Invoke-WebRequest "https://dist.nuget.org/win-x86-commandline/v5.6.0/nuget.exe" -UseBasicParsing -OutFile "$env:ProgramFiles\NuGet\nuget.exe"
  6. Afterwards run .\up.ps1 again

Hope this could help you.

2

I had the same error.

You can list enabled security protocols with the following command:

RUN [Net.ServicePointManager]::SecurityProtocol

If you don't see Tls 1.2 (at the moment this is the lowest version nuget allows), you need to enabled it.

You need to enable the security protocol in the same RUN command, since it is not persisted.

RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; `
Invoke-WebRequest "https://dist.nuget.org/win-x86-commandline/v$env:NUGET_VERSION/nuget.exe" -UseBasicParsing -OutFile "$env:ProgramFiles\NuGet\nuget.exe"
1

It seems that request is blocked by network policies/firewall/proxy.

You can run docker image with powershell ping command to check if dist.nuget.org is accessible in docker scope:

docker run --rm mcr.microsoft.com/windows/servercore:1903 powershell ping dist.nuget.org

Pinging cs2.wpc.gammacdn.net [152.199.23.209] with 32 bytes of data:
Reply from 152.199.23.209: bytes=32 time=16ms TTL=55
Reply from 152.199.23.209: bytes=32 time=10ms TTL=55
Reply from 152.199.23.209: bytes=32 time=9ms TTL=55
Reply from 152.199.23.209: bytes=32 time=9ms TTL=55

Ping statistics for 152.199.23.209:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 9ms, Maximum = 16ms, Average = 11ms

If ping failed - check your network policies/firewall/proxy.

If ping is succesfull - it can be old TLS version enabled as a default (by default PowerShell will use TLS 1.0 when using Invoke-WebRequest).

Try to add:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

in the beginning of the up.ps1.

2
  • I tried above command it doesn't work and also tried adding TLS fix. Still doesn't work. I can run the same web invoke command on PS with no issue. Is the script trying to get nuget.exe from within container?
    – Nil Pun
    Aug 15 '20 at 5:48
  • Adding SecurityProtocolType with TLS12 and TLS11 and then running the Invoke-WebRequest were successful. Sep 10 at 19:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.