Open livarcocc opened 7 years ago
@emgarten
@Xarkam is this reproing consistently for you?
Both dotnet restore and msbuild /t:restore run the same code. It is interesting that you see different results between them when making network calls.
@emgarten for the project in logs, yes every time. I don't have any problems with visual studio 2017 on nuget restore packages.
But, I have not time for testing with another project before 5 days.
@emgarten hello, I have test with this repository: https://github.com/aspnet/MusicStore and the problem is same
PS F:\Developpements\temp\MusicStore> dotnet restore
Restoring packages for F:\Developpements\temp\MusicStore\test\MusicStore.Test\MusicStore.Test.csproj...
Restoring packages for F:\Developpements\temp\MusicStore\test\MusicStore.E2ETests\MusicStore.E2ETests.csproj...
Restoring packages for F:\Developpements\temp\MusicStore\samples\MusicStore\MusicStore.csproj...
Restoring packages for F:\Developpements\temp\MusicStore\test\MusicStore.E2ETests\MusicStore.E2ETests.csproj...
C:\Program Files\dotnet\sdk\1.0.4\NuGet.targets(97,5): error : Unable to load the service index for source https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json.\r [F:\Developpements\temp\MusicStore\MusicStore.sln]
C:\Program Files\dotnet\sdk\1.0.4\NuGet.targets(97,5): error : An error occurred while sending the request.\r [F:\Developpements\temp\MusicStore\MusicStore.sln]
C:\Program Files\dotnet\sdk\1.0.4\NuGet.targets(97,5): error : Failed to connect to server [F:\Developpements\temp\MusicStore\MusicStore.sln]
By nuget cli, everything happens correctly
@Xarkam would you be able to get a network trace of what is happening? Fiddler is a tool that can help with this.
Are you using any proxies?
Hello, I don't use any proxy.
I have installed fiddler and I test in next few days.
I have the unable to load the service
issue as well.
C:\Program Files\dotnet\sdk\1.0.4\NuGet.targets(97,5): error : Unable to load the service index for source https://dotnet.myget.org/F/dotnet-core/api/v3/index.json.\r [C:\Users\Someusername\Source\Repos\Projectname\project.sln]
C:\Program Files\dotnet\sdk\1.0.4\NuGet.targets(97,5): error : Invalid length for a Base-64 char array or string. [C:\Users\Someusername\Source\Repos\Projectname\project.sln]
I guess the root cause is similar. But unlike Xarkam i am behind a corporate proxy, will try to test the connection via fiddler in a few days as well.
Hello, I don't understand. Today, on my first pc, no problems found. But, I will test to another pc with same problem.
@ununseptium @Xarkam Any updates on this?
Hello, Since the update of nuget 1.0.3 to 1.0.4 it seems that the problem is no longer present.
I've tested on 2 pc.
same issue on mac and sdk 1.04
Hi Guys, Followed the instruction provided by microsoft and it is all looks cool!! :)
Closing since most folks are unblocked.
@AliMd if you are still facing this issue then please give us a fiddler trace for investigation.
I do still see this error on two of our machine. Any help ?
Severity Code Description Project File Line Suppression State Error NuGet Package restore failed for project XXXXX Unable to find version '6.0.4' of package 'Newtonsoft.Json'. https://api.nuget.org/v3/index.json: Unable to load the service index for source https://api.nuget.org/v3/index.json. Could not load type 'Newtonsoft.Json.Linq.JsonLoadSettings' from assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. . Please see Error List window for detailed warnings and errors.
I have the same issue reported by vikas6681. I am using Windows 10 (OS Build 15036.966) with VS.Net 2017 (15.6.6) "[nuget.org] Unable to load the service index for source https://api.nuget.org/v3/index.json. Could not load type 'Newtonsoft.Json.Linq.JsonLoadSettings' from assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'."
Any update team ? This is kinda blocking me from last 4 days.
Hey Kegor,
Thanks for inputs but we are trying to hit this API from India.
I am hitting the url from US. I can get the url from the browser but not from VS.Net. It does not work in my laptop or the desktop.
Removing https://api.nuget.org/v3/index.json from packages\microsoft.dotnet.buildtools\2.1.0-preview3-02711-02\lib\init-tools.cmd, build, adding https://api.nuget.org/v3/index.json back, build, somehow seems to have fixed it for me.
I don't see this folder/file in my system as well as code
Same here guys
I can connect to Nuget from VS.Net 2015 but not VS.Net 2017 I tried to uninstall VS.Net 2017 and reinstall it, but it did not work.
I am having the same issue. I suspect it's something to do with being behind a proxy. My Dockerfile is:
FROM microsoft/aspnetcore-build:2.0 AS build-env
WORKDIR /app
# Copy csproj and restore as distinct layers
COPY *.sln ./
RUN dotnet restore
# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out
# Build runtime image
FROM microsoft/aspnetcore:2.0
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "salesorder.qry.webapiapp.dll"]
and I am getting an error on the step that publishes with dotnet:
$ docker build -t salesorder.qry.webapiapp .
Sending build context to Docker daemon 126.1MB
Step 1/10 : FROM microsoft/aspnetcore-build:2.0 AS build-env
---> 07590dec9c1e
Step 2/10 : WORKDIR /app
---> Using cache
---> 26007abaa8b5
Step 3/10 : COPY *.sln ./
---> Using cache
---> 69dc09df88f0
Step 4/10 : RUN dotnet restore
---> Using cache
---> 7c10e448f636
Step 5/10 : COPY . ./
---> Using cache
---> c588d98eb49b
Step 6/10 : RUN dotnet publish -c Release -o out
---> Running in 9492a4f61e38
Microsoft (R) Build Engine version 15.7.177.53362 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restoring packages for /app/SalesOrder.Cmd.Application.Model.Events/SalesOrder.Cmd.Application.Model.Events.csproj...
Restoring packages for /app/SalesOrder.Cmd.Application.Model/SalesOrder.Cmd.Application.Model.csproj...
/usr/share/dotnet/sdk/2.1.200/NuGet.targets(114,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/app/SalesOrder.Qry.sln]
/usr/share/dotnet/sdk/2.1.200/NuGet.targets(114,5): error : An error occurred while sending the request. [/app/SalesOrder.Qry.sln]
/usr/share/dotnet/sdk/2.1.200/NuGet.targets(114,5): error : SSL connect error [/app/SalesOrder.Qry.sln]
The command '/bin/sh -c dotnet publish -c Release -o out' returned a non-zero code: 1
However if I run the very same instruction directly I don't get that error:
$ dotnet publish -c Release -o out
Microsoft (R) Build Engine version 15.6.84.34536 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 43,43 ms for C:\src\SalesOrder.QueryService\SalesOrder.Cmd.Application.Model\SalesOrder.Cmd.Application.Model.csproj.
Restore completed in 43,43 ms for C:\src\SalesOrder.QueryService\SalesOrder.Cmd.Application.Model.Events\SalesOrder.Cmd.Application.Model.Events.csproj.
Restore completed in 4,67 ms for C:\src\SalesOrder.QueryService\SalesOrder.Qry.Infra.InMemoryRepository\SalesOrder.Qry.Infra.InMemoryRepository.csproj.
Restore completed in 46,18 ms for C:\src\SalesOrder.QueryService\SalesOrder.Qry.Application.UnitTests\SalesOrder.Qry.Application.UnitTests.csproj.
Restore completed in 51,08 ms for C:\src\SalesOrder.QueryService\SalesOrder.Qry.WebApi.UnitTests\SalesOrder.Qry.WebApi.UnitTests.csproj.
Restore completed in 32,46 ms for C:\src\SalesOrder.QueryService\SalesOrder.Qry.WebApiApp\SalesOrder.Qry.WebApiApp.csproj.
Restore completed in 12,53 ms for C:\src\SalesOrder.QueryService\ToolBelt.Hateoas\ToolBelt.Hateoas.csproj.
Restore completed in 13,54 ms for C:\src\SalesOrder.QueryService\SalesOrder.Qry.WebApi\SalesOrder.Qry.WebApi.csproj.
Restore completed in 2,16 ms for C:\src\SalesOrder.QueryService\ToolBelt.Mapping.Contracts\ToolBelt.Mapping.Contracts.csproj.
Restore completed in 1,97 ms for C:\src\SalesOrder.QueryService\ToolBelt.Tests.Extensions\ToolBelt.Tests.Extensions.csproj.
Restore completed in 55,52 ms for C:\src\SalesOrder.QueryService\SalesOrder.Qry.WebApiApp\SalesOrder.Qry.WebApiApp.csproj.
Restore completed in 64,69 ms for C:\src\SalesOrder.QueryService\SalesOrder.Qry.Application.UnitTests\SalesOrder.Qry.Application.UnitTests.csproj.
Restore completed in 2,36 ms for C:\src\SalesOrder.QueryService\SalesOrder.Qry.Domain.EventContracts\SalesOrder.Qry.Domain.EventContracts.csproj.
Restore completed in 2,87 ms for C:\src\SalesOrder.QueryService\SalesOrder.Qry.Application\SalesOrder.Qry.Application.csproj.
SalesOrder.Cmd.Application.Model -> C:\src\SalesOrder.QueryService\SalesOrder.Cmd.Application.Model\bin\Release\netstandard2.0\SalesOrder.Cmd.Application.Model.dll
ToolBelt.Tests.Extensions -> C:\src\SalesOrder.QueryService\ToolBelt.Tests.Extensions\bin\Release\netstandard2.0\ToolBelt.Tests.Extensions.dll
ToolBelt.Mapping.Contracts -> C:\src\SalesOrder.QueryService\ToolBelt.Mapping.Contracts\bin\Release\netstandard2.0\ToolBelt.Mapping.Contracts.dll
ToolBelt.Tests.Extensions -> C:\src\SalesOrder.QueryService\ToolBelt.Tests.Extensions\out\
ToolBelt.Mapping.Contracts -> C:\src\SalesOrder.QueryService\ToolBelt.Mapping.Contracts\out\
SalesOrder.Cmd.Application.Model -> C:\src\SalesOrder.QueryService\SalesOrder.Cmd.Application.Model\out\
ToolBelt.Hateoas -> C:\src\SalesOrder.QueryService\ToolBelt.Hateoas\bin\Release\netstandard2.0\ToolBelt.Hateoas.dll
SalesOrder.Cmd.Application.Model.Events -> C:\src\SalesOrder.QueryService\SalesOrder.Cmd.Application.Model.Events\bin\Release\netstandard2.0\SalesOrder.Cmd.Application.Model.Events.dll
SalesOrder.Cmd.Application.Model.Events -> C:\src\SalesOrder.QueryService\SalesOrder.Cmd.Application.Model.Events\out\
ToolBelt.Hateoas -> C:\src\SalesOrder.QueryService\ToolBelt.Hateoas\out\
SalesOrder.Qry.Application -> C:\src\SalesOrder.QueryService\SalesOrder.Qry.Application\bin\Release\netstandard2.0\SalesOrder.Qry.Application.dll
SalesOrder.Qry.Domain.EventContracts -> C:\src\SalesOrder.QueryService\SalesOrder.Qry.Domain.EventContracts\bin\Release\netcoreapp2.0\SalesOrder.Qry.Domain.EventContracts.dll
SalesOrder.Qry.Domain.EventContracts -> C:\src\SalesOrder.QueryService\SalesOrder.Qry.Domain.EventContracts\out\
SalesOrder.Qry.Infra.InMemoryRepository -> C:\src\SalesOrder.QueryService\SalesOrder.Qry.Infra.InMemoryRepository\bin\Release\netcoreapp2.0\SalesOrder.Qry.Infra.InMemoryRepository.dll
SalesOrder.Qry.WebApi -> C:\src\SalesOrder.QueryService\SalesOrder.Qry.WebApi\bin\Release\netstandard2.0\SalesOrder.Qry.WebApi.dll
SalesOrder.Qry.Application -> C:\src\SalesOrder.QueryService\SalesOrder.Qry.Application\out\
SalesOrder.Qry.Application.UnitTests -> C:\src\SalesOrder.QueryService\SalesOrder.Qry.Application.UnitTests\bin\Release\netcoreapp2.0\SalesOrder.Qry.Application.UnitTests.dll
SalesOrder.Qry.Application.UnitTests -> C:\src\SalesOrder.QueryService\SalesOrder.Qry.Application.UnitTests\out\
SalesOrder.Qry.Infra.InMemoryRepository -> C:\src\SalesOrder.QueryService\SalesOrder.Qry.Infra.InMemoryRepository\out\
SalesOrder.Qry.WebApi -> C:\src\SalesOrder.QueryService\SalesOrder.Qry.WebApi\out\
SalesOrder.Qry.WebApiApp -> C:\src\SalesOrder.QueryService\SalesOrder.Qry.WebApiApp\bin\Release\netcoreapp2.0\SalesOrder.Qry.WebApiApp.dll
SalesOrder.Qry.WebApiApp -> C:\src\SalesOrder.QueryService\SalesOrder.Qry.WebApiApp\out\
SalesOrder.Qry.WebApi.UnitTests -> C:\src\SalesOrder.QueryService\SalesOrder.Qry.WebApi.UnitTests\bin\Release\netcoreapp2.0\SalesOrder.Qry.WebApi.UnitTests.dll
SalesOrder.Qry.WebApi.UnitTests -> C:\src\SalesOrder.QueryService\SalesOrder.Qry.WebApi.UnitTests\out\
How's that possible?
I've tried to add the following proxy settings in NuGet.Config C:\Users\iberodev\AppData\Roaming\NuGet\NuGet.Config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!-- other things here -->
<config>
<add key="https_proxy" value="https://username@mypass@sampleproxy.com:8080" />
</config>
</configuration>
No luck. Same result. I'm really stuck with this and I cannot find good answers anywhere. Any advice would be much appreciated
The same problem. When i use "RUN dotnet restore --disable-parallel" in dockerfile all works fine, but without "--disable-parallel" it doesnt work.
**Docker version** 18.03.1-ce, build 9ee9f40
**dotnet --info**
Product Information:
Version: 2.1.200
Commit SHA-1 hash: 2edba8d7f1
Runtime Environment:
OS Name: Windows
OS Version: 10.0.16299
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.200\
Microsoft .NET Core Shared Framework Host
Version : 2.0.7
Build : 2d61d0b043915bc948ebf98836fefe9ba942be11
having same problem within docker container
C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets(114,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json.
--disable-parallel
didn't help
Had same problem with my Teamcity agent working with Docker-in-Docker option, and exposing port 80 on agent container did the trick (not sure why though).
Facing same issue within docker container.
try to run docker build
with --network=host
<?xml version="1.0" encoding="utf-8"?>
I'm getting the same issues unless I run dotnet restore as root on my linux server. I recently installed the 2.1 SDK and currently have SDKs 2.0 and 2.1 installed.
I did not use to have this problem when only SDK 2.0 was installed. I'm wondering if there's some permissions issue now with the new SDK installation?
Hmmm interesting is that after setting http_proxy
directly into c:\Users\<user>\AppData\Roaming\NuGet\NuGet.Config
it started working, but setting http_proxy
to local Nuget.Config
which is in project it was not working.
Problem occured only after installing .net core SDK 2.1, before this i was able to work without http_proxy
tagging @rrelyea for visibility.
sudo chmod +r /etc/pki/tls/certs/*
solved the problem for me.
Make sure the docker container has internet access during build. You can check /etc/resolv.conf in the container if the correct proxy is present.
In order to set the default DNS nameservers in this resolv.conf file use one of the options below:
Make sure to provide the proxy / nameservers in a (new) file /etc/docker/daemon.json on the host running the docker daemon like this: {"dns": ["10.10.10.10", "10.10.10.20"] }
Add a line to the following file on the docker host: /etc/default/docker >> DOCKER_OPTS="--dns 10.10.10.10 --dns 10.10.10.20"
NetCore team believes this is bug in NetCore 2.1 runtime. (new networking code in 2.1)
Finally found a solution to it. By default VS.Net uses Newtonsoft.Json version 7 and it does not have Newtonsoft.Json.Linq.JsonLoadSettings class Close all instances of Vs.net 2017 Download the latest version of Newtonsoft.Json (currently its 11) from http://nuget.org and rename it to .zip, extract the files, gacutil the Newtonsoft.Json.dll from net45 folder. Edit machine.configs 32-bit - C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config 64-bit - C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config - this is optional but for consistency.
change version in these tags
<qualifyAssembly partialName="Newtonsoft.Json" fullName="Newtonsoft.Json, Version=**11.0.0.0**, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" /> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <bindingRedirect oldVersion="1.0.0.0-100.0.0.0" newVersion="11.0.0.0" /> </dependentAssembly>
Open vs.net 2017 and it should now will be able connect to Nuget.org
Finally, after spending my entire Saturday, I was able to fix the same. You may see my answer in StackOverflow (https://stackoverflow.com/questions/41185443/nuget-connection-attempt-failed-unable-to-load-the-service-index-for-source/51456498#51456498) to know further. I am still analyzing the issue though.
Dotnet restore command failed when i tried to build the dotnetcore app using below docker file. Can someone provide your thoughts on this?
-> I am using Ubuntu image 16.04 running in my VM. -> My sample docker image: FROM microsoft/dotnet:2.0-sdk COPY . /app WORKDIR /app RUN mkdir /app/logs RUN chmod -R a+rwx /app/logs
RUN dotnet restore RUN ["dotnet", "build"]
EXPOSE 5000/tcp ENV ASPNETCORE_URLS http://*:5000
ENTRYPOINT ["dotnet", "run"]
-> My runtime env details below:
Hi Team,
Found the error - Unable to load the service index for source https://api.nuget.org/v3/index.json. [/app/mvcapp.csproj]
I am using the below dockerfile to build the sample dotnetcore application which uses dotnetcore ver 2.1.403 as runtime version. Can someone help me on how to resolve this error wothout usng thenetwork proxy in my Ubuntu VM 18.04 lts.
-> My Docker file below: FROM microsoft/dotnet:2.1-sdk COPY . /app WORKDIR /app
RUN dotnet restore RUN dotnet build
ENV CORECLR_PROFILER="{57e1aa68-2229-41aa-9931-a6e93bbc64d8}" ENV CORECLR_ENABLE_PROFLING=1 ENV CORECLR_PROFILER_PATH="/root/.nuget/packages/appdynamics.agentsdk/4.5.2/runtimes/linux-x64/native/libappdprofiler.so"
EXPOSE 5000/tcp ENV ASPNETCORE_URLS https://*:5000
ENTRYPOINT ["dotnet","run"]
-> Error log details: Sending build context to Docker daemon 10.78MB Step 1/11 : FROM microsoft/dotnet:2.1-sdk ---> 6baac5bd0ea2 Step 2/11 : COPY . /app ---> 3eeae5a07ee9 Step 3/11 : WORKDIR /app Removing intermediate container 930a3bdf049d ---> 22a34040bb36 Step 4/11 : RUN dotnet restore ---> Running in 0dc7c6cf45b7 Restoring packages for /app/mvcapp.csproj... /usr/share/dotnet/sdk/2.1.403/NuGet.targets(114,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/app/mvcapp.csproj] /usr/share/dotnet/sdk/2.1.403/NuGet.targets(114,5): error : Resource temporarily unavailable [/app/mvcapp.csproj] The command '/bin/sh -c dotnet restore' returned a non-zero code: 1
My mvcapp.csproj file details attached in screenshot below:
@praveenvarmaN , I have the same problem. Did you resolve it?
I have the same problem. Did anyone resolve it? It seems dotnet restore from docker build is not using the proxy settings for docker daemon.
Restarting docker on my windows system resolved it for me.
@praveenvarmaN , I have the same problem. Did you resolve it?
No. I need to understand why the proxy setup is required when you run the dotnet restore via dockerfile for building the docker image for aspdotnetcore apps. Anywayz, you will be using the wired connection in ubuntu server vm. have my docker engine installed and running.
Any thoughts on this?
I am having same issue now. It worked on Sunday (2 days ago) but suddenly throwing error now.
Anyone can help me?
[Details] I have .net core 2.0 based application that is deployed on AWS ECS through Visual Studio AWS Toolkit. Everything worked without any issues in the past, but today when I tried to deploy updates to AWS, it is failing at docker build (dotnet restore step) throwing the above error message.
Restarting docker on my windows system resolved it for me.
It didn't work for me ...
It didn't work for me ...on Linux
Upgrading dot net package from 2.08 to 2.09 resolved this issue.
From @Xarkam on June 7, 2017 7:25
Steps to reproduce
Clone https://github.com/ExtCore/ExtCore-Sample-Modular-Ui-Adv
Expected behavior
Restore package
Actual behavior
Environment data
dotnet --info
output:If I use nuget cli for restore, I don't have any problem.
Copied from original issue: dotnet/cli#6783