_From @keslerm on March 6, 2017 19:14_
λ dotnet --version
1.0.0-rc4-004771
When using dotnet restore with either a nuget.config with multiple sources, or passing multiple -s options it only tries one source.
This means that when trying to do dotnet restore on a project that has a private repo and a public repo and pulls from both, the restore operation will fail because obviously some package disparity between the two repos will exist.
Results from running:
λ dotnet restore
Restoring packages for C:\Project\example.csproj...
Retrying 'FindPackagesByIdAsyncCore' for source 'https://privaterepo.com/FindPackagesById()?id='YamlDotNet.Signed''.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'https://privaterepo.com/FindPackagesById()?id='WebSocketSharp''.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'https://privaterepo.com/FindPackagesById()?id='EntityFramework.CodeFirstStoreFunctions''. `
_Copied from original issue: Microsoft/dotnet#361_
_From @richlander on March 10, 2017 5:56_
Are you saying that restore fails on the first source and doesn't try the second one?
/cc @blackdwarf
_From @keslerm on March 10, 2017 14:22_
Yes essentially, it tries to restore the private package's dependencies only from the private repo, and never tries to look in the public one even though both are specified in the config file.
I was able to work around it kind of by running dotnet restore
first with only the private repo as a source, then again with the public repo as a source. This got everything installed/cached but it generates at least one error each time.
_From @blackdwarf on March 10, 2017 15:5_
@keslerm can you paste in your nuget.config? Also if you are using -s option can you provide the full invocation?
_From @keslerm on March 11, 2017 17:38_
@blackdwarf I have tried every variation i could. Using the switches or the config file. Ultimately what ends up happening is the first provided source is the only source tried.
The project I am doing dotnet restore
only has the one dependency which is hosted on the private repo. That privately hosted dependency has more dependencies that are available on the public repo.
The same thing happens if i use multiple source flags, the first one is the only repository tried
dotnet restore -s https://private.repo/ -s https://api.nuget.org/v3/index.json
Here is the NuGet.config file
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<packageSources>
<add key=Private Repo" value="https://private-repo.com/" />
<add key=Public Repo" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
_From @richlander on April 21, 2017 5:2_
/cc @rrelyea @livarcocc
_From @thenathanjones on November 3, 2017 3:44_
Hi all. Just wondering what the plan is with this? Our team just realised today they were running into this when trying to diagnose why restore was trying to pull public packages from the internal NuGet repo.
My concern here is that this was first opened in March and there has been radio silence since the last post in April. If this is being tracked somewhere else that's cool, but it'd be good to know if this is on anyones radar or we have to try and wade in and fix it ourselves.
Thanks!
Moving the issue to the NuGet repo.
@keslerm Did you still repro this issue with latest dotnet cli? I restored a project which have one package from private repo and the package have dependency from public repo. but can't repro the issue.
@keslerm - Please answer @zhili1208 's question
I get this same issue if my local feed is not successful restoring package:
msbuild.exe" /t:restore MySolution.sln /p:Configuration=Release /p:RestoreConfigFile="../Nuget.config"
Restoring packages for ...csproj...
GET http://MyLocalFeedService.svc/FindPackagesById()?id='Moq';
GET http://MyLocalFeedService.svc/FindPackagesById()?id='HangFire.Core';
Unauthorized http://MyLocalFeedService.svc/FindPackagesById()?id='Moq'; 26ms
Retrying 'FindPackagesByIdAsyncCore' for source 'http://MyLocalFeedService.svc/FindPackagesById()?id='Moq'
Response status code does not indicate success: 401 (Unauthorized).
And then it is not trying to restore from the second feed.
@erikaspl does this repro for you with VS 15.4?
I'm experiencing this on our build server with visual studio build tools 2017 version 15.4.5 installed.
dotnet --version returns 2.0.
However, I can only reproduce this when running as nt authority\system
. Running the commands through cmd on an administrator account seems to work as expected.
@gps035 that sounds like a configuration problem, the nuget.config in %APPDATA%
is user specific, so if you change users you may not be picking up the feeds you are expecting. Try running nuget.exe sources
to see what feeds are found.
Thanks @emgarten. I've added a couple of lines to my build script to see if I can highlight the problem, but I can't see what is going wrong.
$ whoami
nt authority\system
$ echo "%APPDATA%"
"C:\Windows\system32\config\systemprofile\AppData\Roaming"
$ "%NUGET_PATH%" sources
Registered Sources:
1. nuget.org [Enabled]
https://api.nuget.org/v3/index.json
2. MyCompanyPrivate [Enabled]
http://nuget.company-name.co.uk/nuget
The second source is present as I expected, but the next step, dotnet build -c Release
errors with Unable to find package x. No packages exist with this id in source(s): nuget.org
and the other source is not mentioned.
@gps035 thanks for the extra info, that is helpful! Does the obj\project.assets.json
file contain http://nuget.company-name.co.uk/nuget
in the list of sources?
No, the only source listed is https://api.nuget.org/v3/index.json
Any status on this? I'm running into this problem on a mac right now.
Wait, this might help. My current NuGet is writing to ~/.config/NuGet/NuGet.config
while dotnet restore
uses ~/.nuget/NuGet/NuGet.config
. When copying the info from the .config
folder to the .nuget
folder dotnet restore starts to run trying both sources.
But a new message appears:
Password decryption is not supported on .NET Core for this platform. The following feed uses an encrypted password: 'REDACTED'. You can use a clear text password as a workaround. Encryption is not supported on non-Windows platforms.
That I can work with. So my issue is resolved. Maybe a hint for others running into this.
Environment info:
$ which nuget
/Library/Frameworks/Mono.framework/Versions/Current/Commands/nuget
$ which dotnet
/usr/local/share/dotnet/dotnet
$ nuget
NuGet Version: 4.3.0.4406
$ dotnet --version
2.1.4
Any solution for this topic?
@krakorj I've had success listing the sources explicitly, not an ideal solution, but a workaround until the bug is fixed. dotnet restore -s http://nuget.company-name.co.uk/nuget -s https://api.nuget.org/v3/index.json
@gps035 thank you, unfortunately the solution does not work for me. I use docker cmd as follows:
RUN dotnet restore -s http://my.server.com/SEM.NugetServer/nuget -s https://api.nuget.org/v3/index.json -v d
output listing excerpt:
...
Retrying 'FindPackagesByIdAsyncCore' for source 'http://my.server.com/SEM.NugetServer/nuget/FindPackagesById()?id='SEM.MessageQueue.Client''.
An error occurred while sending the request.
Couldn't resolve host name
...
NuGet.Protocol.Core.Types.FatalProtocolException: Failed to retrieve information about 'SEM.MessageQueue.Client' from remote source 'http://my.server.com/SEM.NugetServer/nuget/FindPackagesById()?id='SEM.MessageQueue.Client''. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.CurlException: Couldn't resolve host name
at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error)
at System.Net.Http.CurlHandler.MultiAgent.FinishRequest(StrongToWeakReference`1 easyWrapper, CURLcode messageResult)
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.Protocol.ServerWarningLogHandler.<SendAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.Protocol.HttpSourceAuthenticationHandler.<SendAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at System.Net.Http.HttpClient.<FinishSendAsyncUnbuffered>d__59.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at NuGet.Protocol.TimeoutUtility.<StartWithTimeout>d__0`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.Protocol.HttpRetryHandler.<SendAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.Protocol.HttpSource.<GetThrottledResponse>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Protocol.HttpSource.<>c__DisplayClass12_0`1.<<GetAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Common.ConcurrencyUtilities.<ExecuteWithFileLockedAsync>d__2`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.Protocol.HttpSource.<GetAsync>d__12`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.Protocol.RemoteV2FindPackageByIdResource.<FindPackagesByIdAsyncCore>d__22.MoveNext()
--- End of inner exception stack trace ---
at NuGet.Protocol.RemoteV2FindPackageByIdResource.<FindPackagesByIdAsyncCore>d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.Protocol.RemoteV2FindPackageByIdResource.<GetAllVersionsAsync>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.Commands.SourceRepositoryDependencyProvider.<GetAllVersionsAsync>d__27.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.Commands.SourceRepositoryDependencyProvider.<FindLibraryCoreAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.Commands.SourceRepositoryDependencyProvider.<>c__DisplayClass18_0.<<FindLibraryAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.Commands.SourceRepositoryDependencyProvider.<FindLibraryAsync>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.DependencyResolver.ResolverUtility.<>c__DisplayClass7_1.<<FindLibraryFromSourcesAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.DependencyResolver.ResolverUtility.<FindLibraryFromSourcesAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.DependencyResolver.ResolverUtility.<FindLibraryByVersionAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.DependencyResolver.ResolverUtility.<FindLibraryMatchAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.DependencyResolver.ResolverUtility.<FindLibraryEntryAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.DependencyResolver.RemoteDependencyWalker.<CreateGraphNode>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.DependencyResolver.RemoteDependencyWalker.<CreateGraphNode>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.Commands.ProjectRestoreCommand.<WalkDependenciesAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.Commands.ProjectRestoreCommand.<TryRestoreAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.Commands.RestoreCommand.<ExecuteRestoreAsync>d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.Commands.RestoreCommand.<ExecuteAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.Commands.RestoreRunner.<ExecuteAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.Commands.RestoreRunner.<ExecuteAndCommitAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.Commands.RestoreRunner.<CompleteTaskAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.Commands.RestoreRunner.<RunAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.Commands.RestoreRunner.<RunAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at NuGet.Build.Tasks.RestoreTask.<ExecuteAsync>d__31.MoveNext()
Done executing task "RestoreTask" -- FAILED.
...
I'm seeing a similar issue. I'm using a nuget.config file to add a private feed from DevExpress. Recently we added Microsoft.AspNetCore.SignalR package and now the build fails as it can't find the package on the private feed.
The task is aware of both feeds...
OutputSources 'https://api.nuget.org/v3/index.json;https://nuget.devexpress.com/***/api'
...but only attempts the private one
C:\Program Files\dotnet\sdk\2.1.301\NuGet.targets(114,5): error : Failed to retrieve information about 'Microsoft.AspNetCore.SignalR' from remote source 'https://nuget.devexpress.com/***/api/FindPackagesById()?id='Microsoft.AspNetCore.SignalR'&semVerLevel=2.0.0'. [C:\VSTS_Agents\aker-dma\***_1\_work\4\s\Api\Api.csproj]
The project in question is net461, would that have a bearing?
Interestingly, Visual Studio 2017 generates the following output when installing the package:
GET https://api.nuget.org/v3/registration3-gz-semver2/microsoft.aspnetcore.signalr/index.json
GET https://nuget.devexpress.com/***/api/Packages(Id='Microsoft.AspNetCore.SignalR',Version='1.0.2')
NotFound https://nuget.devexpress.com/***/api/Packages(Id='Microsoft.AspNetCore.SignalR',Version='1.0.2') 158ms
GET https://nuget.devexpress.com/***/api/FindPackagesById()?id='Microsoft.AspNetCore.SignalR'&semVerLevel=2.0.0
OK https://api.nuget.org/v3/registration3-gz-semver2/microsoft.aspnetcore.signalr/index.json 205ms
Error finding repository for 'https://nuget.devexpress.com/***/api': An error occurred while retrieving package metadata for 'Microsoft.AspNetCore.SignalR.1.0.2' from source 'DevExtreme'.
Failed to fetch results from V2 feed at 'https://nuget.devexpress.com/***/api/FindPackagesById()?id='Microsoft.AspNetCore.SignalR'&semVerLevel=2.0.0' with following message : A task was canceled.
A task was canceled.
Restoring packages for C:\Dev\aker-dma\Coabis\Api\Api.csproj...
Installing NuGet package Microsoft.AspNetCore.SignalR 1.0.2.
Committing restore...
Writing lock file to disk. Path: C:\Dev\aker-dma\Coabis\Api\obj\project.assets.json
Restore completed in 1.21 sec for C:\Dev\aker-dma\Coabis\Api\Api.csproj.
Successfully uninstalled 'Microsoft.AspNetCore.Authentication.Abstractions 2.0.3' from Api
Successfully uninstalled 'Microsoft.AspNetCore.Authorization 2.0.4' from Api
Successfully uninstalled 'Microsoft.AspNetCore.Authorization.Policy 2.0.4' from Api
Successfully uninstalled 'Microsoft.AspNetCore.Hosting.Abstractions 2.1.0' from Api
Successfully uninstalled 'Microsoft.AspNetCore.Hosting.Server.Abstractions 2.1.0' from Api
Successfully uninstalled 'Microsoft.AspNetCore.Http 2.0.3' from Api
Successfully uninstalled 'Microsoft.AspNetCore.Http.Abstractions 2.1.0' from Api
Successfully uninstalled 'Microsoft.AspNetCore.Http.Extensions 2.1.0' from Api
Successfully uninstalled 'Microsoft.AspNetCore.Http.Features 2.1.0' from Api
Successfully uninstalled 'Microsoft.AspNetCore.Routing 2.0.3' from Api
Successfully uninstalled 'Microsoft.AspNetCore.Routing.Abstractions 2.0.3' from Api
Successfully uninstalled 'Microsoft.AspNetCore.WebUtilities 2.0.3' from Api
Successfully uninstalled 'Microsoft.Extensions.Configuration.Abstractions 2.1.0' from Api
Successfully uninstalled 'Microsoft.Extensions.DependencyInjection.Abstractions 2.1.0' from Api
Successfully uninstalled 'Microsoft.Extensions.FileProviders.Abstractions 2.1.0' from Api
Successfully uninstalled 'Microsoft.Extensions.Hosting.Abstractions 2.1.0' from Api
Successfully uninstalled 'Microsoft.Extensions.Logging.Abstractions 2.1.0' from Api
Successfully uninstalled 'Microsoft.Extensions.ObjectPool 2.0.0' from Api
Successfully uninstalled 'Microsoft.Extensions.Options 2.1.0' from Api
Successfully uninstalled 'Microsoft.Extensions.Primitives 2.1.0' from Api
Successfully uninstalled 'Microsoft.Net.Http.Headers 2.1.0' from Api
Successfully uninstalled 'System.Memory 4.5.0' from Api
Successfully uninstalled 'System.Runtime.CompilerServices.Unsafe 4.5.0' from Api
Successfully uninstalled 'System.Threading.Tasks.Extensions 4.4.0' from Api
Successfully installed 'Microsoft.AspNetCore.Authentication.Abstractions 2.1.1' to Api
Successfully installed 'Microsoft.AspNetCore.Authorization 2.1.1' to Api
Successfully installed 'Microsoft.AspNetCore.Authorization.Policy 2.1.1' to Api
Successfully installed 'Microsoft.AspNetCore.Connections.Abstractions 2.1.2' to Api
Successfully installed 'Microsoft.AspNetCore.Hosting.Abstractions 2.1.1' to Api
Successfully installed 'Microsoft.AspNetCore.Hosting.Server.Abstractions 2.1.1' to Api
Successfully installed 'Microsoft.AspNetCore.Http 2.1.1' to Api
Successfully installed 'Microsoft.AspNetCore.Http.Abstractions 2.1.1' to Api
Successfully installed 'Microsoft.AspNetCore.Http.Connections 1.0.2' to Api
Successfully installed 'Microsoft.AspNetCore.Http.Connections.Common 1.0.2' to Api
Successfully installed 'Microsoft.AspNetCore.Http.Extensions 2.1.1' to Api
Successfully installed 'Microsoft.AspNetCore.Http.Features 2.1.1' to Api
Successfully installed 'Microsoft.AspNetCore.Routing 2.1.1' to Api
Successfully installed 'Microsoft.AspNetCore.Routing.Abstractions 2.1.1' to Api
Successfully installed 'Microsoft.AspNetCore.SignalR 1.0.2' to Api
Successfully installed 'Microsoft.AspNetCore.SignalR.Common 1.0.2' to Api
Successfully installed 'Microsoft.AspNetCore.SignalR.Core 1.0.2' to Api
Successfully installed 'Microsoft.AspNetCore.SignalR.Protocols.Json 1.0.2' to Api
Successfully installed 'Microsoft.AspNetCore.WebSockets 2.1.1' to Api
Successfully installed 'Microsoft.AspNetCore.WebUtilities 2.1.1' to Api
Successfully installed 'Microsoft.Extensions.Configuration.Abstractions 2.1.1' to Api
Successfully installed 'Microsoft.Extensions.DependencyInjection.Abstractions 2.1.1' to Api
Successfully installed 'Microsoft.Extensions.FileProviders.Abstractions 2.1.1' to Api
Successfully installed 'Microsoft.Extensions.Hosting.Abstractions 2.1.1' to Api
Successfully installed 'Microsoft.Extensions.Logging.Abstractions 2.1.1' to Api
Successfully installed 'Microsoft.Extensions.ObjectPool 2.1.1' to Api
Successfully installed 'Microsoft.Extensions.Options 2.1.1' to Api
Successfully installed 'Microsoft.Extensions.Primitives 2.1.1' to Api
Successfully installed 'Microsoft.Net.Http.Headers 2.1.1' to Api
Successfully installed 'System.IO.Pipelines 4.5.0' to Api
Successfully installed 'System.Memory 4.5.1' to Api
Successfully installed 'System.Net.WebSockets.WebSocketProtocol 4.5.1' to Api
Successfully installed 'System.Reflection.Emit 4.3.0' to Api
Successfully installed 'System.Runtime.CompilerServices.Unsafe 4.5.1' to Api
Successfully installed 'System.Threading.Channels 4.5.0' to Api
Successfully installed 'System.Threading.Tasks.Extensions 4.5.1' to Api
Executing nuget actions took 2.96 sec
Time Elapsed: 00:00:05.3197297
========== Finished ==========
Time Elapsed: 00:00:00.2112787
========== Finished ==========
@rrelyea Any update on this issue?
Just had the same issue on VSTS online build when restoring packages using Nuget restore task. Looks like there is a task/thread synchronisation bug in nuget when it's performing parallel package processing. Our project uses 2 feeds, nuget.org feed and some private nuget server. From what I can see there in nuget logs, it actually tries both feeds, receives OK from one of them but nevertheless fails with - "Response status code does not indicate success: 404 (Not Found)."
I disabled parallel processing by setting Disable Parallel Processing option in VSTS task and the same task with exactly same feeds and same projects now works fine.
Facing the same issue as @krakorj , trying to run dotnet restore on project having multiple public nuget packages and one private. It's only picking up private nuget.
For what it's worth I'm having the same issue working in a Windows docker container. The Linux container performs this step without issue with the same NuGet.config file. One thing I noticed is that it doesn't try the first one first; it actually tries the one that ends in / first even if it's listed second. I ran into this with DevExpress too, and I wonder if some of the issue is due to the fact that they don't use a JSON payload.
I followed meodep's instructions regarding the Docker NAT here: https://forums.docker.com/t/no-internet-access-from-windows-container/25600/5, and I have better results now. I get a timeout to each of my sources, but it's actually trying both of them on the command line now. I think this likely boils down to a local dev environment issue, so if I get something working I'll post what else I did to get there. I have a feeling it has something to do with my work network though.
Excerpt from linked article:
Open Hyper-V Manager (Windows search : “Hyper-V …”)
Go to Virtual Switch Manager on the right side.
Go to DockerNAT then choose Connection type -> to External network -> #which interface you decide.
*Restart Docker after you do this
I would advise others to try these steps, then if you still have issues, investigate your local network configuration.
Hi @zarochi , I have enabled external network in Docker NAT and restarted Docker service still no luck.
Hi @davidsk , did you manage to resolve this issue? Could you please provide your Nuget.Config?
I am specifying config file to be used as below:
I am running this in docker having ubuntu.
still it's not working.
I am still getting same issue after puting API key as ClearTextPassword. dotnet build/restore picks up only private nuget source.
My Nuget.Config:
<?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="nuget.org" value="https://api.nuget.org/v3/index.json"/> <add key="BPNuget" value="http://myprivatenugetserver/nuget/" /> </packageSources> <packageSourceCredentials> <BPNuget> <add key="Username" value="<<NugetOwner>>" /> <add key="ClearTextPassword" value="<<APIKey>>" /> </BPNuget> </packageSourceCredentials> <packageRestore> <add key="enabled" value="True" /> <add key="automatic" value="True" /> </packageRestore> <bindingRedirects> <add key="skip" value="False" /> </bindingRedirects> <packageManagement> <add key="format" value="1" /> <add key="disabled" value="False" /> </packageManagement> </configuration>
I wish I could say exactly what I did, but there's quite a bit of poking around that I did. This was a local development environment issue for me at least. I followed this thread to re-do my docker networks: https://github.com/docker/for-win/issues/750. After that I still had issues. I ran a few reboots and turned off Windows Firewall. It is working for me now. I am running Docker for Windows, so those of you on Mac or Linux are likely experiencing a different issue. If you're on a corporate network like I am I wouldn't be surprised if it's a network configuration issue like it was for me. I'm hoping this can help point some in the right direction.
@zarochi , if you are in linux/mac, you can do a tcpdump
or other similar command in order to capture the traffic (non https). If it's https, you will most likely need to use some other tools.
I was getting back 401 unauthorized from packages in my private repository on TFS with the dotnet restore
Build Task. I was also getting 401 unauthorized on my local desktop within Powershell using the same NuGet.config as the build server. I never had issues with Visual Studio and the packages restoring. Thanks to @dyadenka I adding the --disable-parallel
flag to my build task on TFS and that resolved the problem.
I never had any issues restoring from Visual Studio, just with DevOps' builds.
dotnet restore doesn't play nicely (authenticate) with DevOps Artifact feeds. I worked around this by providing a nuget file with a placeholder. Then before the build, I replaced the placeholder (PERSONAL_ACCESS_TOKEN) in the nuget file with the token, $(system.AccessToken), that the build is currently running as. Then the dotnet restore and build will go through without issue.
build_nuget.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="Feed1" value="https://myproject.pkgs.visualstudio.com/_packaging/Feed1/nuget/v3/index.json" />
<add key="Feed2" value="https://myproject.pkgs.visualstudio.com/_packaging/Feed2/nuget/v3/index.json" />
</packageSources>
<packageSourceCredentials>
<Feed1>
<add key="Username" value="vsts" />
<add key="ClearTextPassword" value="PERSONAL_ACCESS_TOKEN" />
</Feed1>
<Feed2>
<add key="Username" value="vsts" />
<add key="ClearTextPassword" value="PERSONAL_ACCESS_TOKEN" />
</Feed2>
</packageSourceCredentials>
</configuration>
azure-pipelines.yml
pool:
vmImage: 'Ubuntu 16.04'
variables:
buildConfiguration: 'Release'
projectName: 'MyProjectName'
steps:
- script: |
sed -i 's/PERSONAL_ACCESS_TOKEN/$(system.AccessToken)/g' build_nuget.config
dotnet restore --configfile build_nuget.config
dotnet build --configuration $(buildConfiguration) --runtime ubuntu.16.04-x64
cp -R $(projectName)/bin/Release/netcoreapp2.0/ $(Build.ArtifactStagingDirectory)
displayName: 'Build'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'drop'
I'm having same issue, any update on this?
bump
@JerrySantana92 @nirajvbhatt @davidsk
If you are using private nuget repository:
Can you please specify IP address for private nuget repository host and then try again? I had same issue and it is working with IP address.
It works in both cases nuget config file or specifying both nuget sources as command line parameter.
If you are using private nuget repository:
Can you please specify IP address for private nuget repository host and then try again? I had same issue and it is working with IP address.
It works in both cases nuget config file or specifying both nuget sources as command line parameter.
A solution for this problem, finally. This works perfectly, thanks @balpreet-boden.
Same problem here.
I'm on windows and have my private repo in nuget.config with no credentials because visual studio asks for them interactively. dotnet commands fail to restore public packages from nuget.org.
@oliverjanik You can add your credentials to your nuget config using this command
.\nuget.exe sources update -name "Private Repo" -source https://private.nuget.repo -User yourName -pass yourPass
Other than dotnet restore --ignore-failed-sources, does anybody know what else to do?
you can try --disable-parallel, it helped me when restoring with nuget.exe restore command (via VSTS aka Azure Devops build task).
Any progress on this issue?
I'm also experiencing problems with the nuget restore (from within a Dockerfile) on an Ubuntu 18.04 LTS build machine. It runs the build agent from Azure DevOps Express 2019 Update 1. When I run the agent on a Windows 10 Pro machine all works well with the same Dockerfile. Keep in mind the TFS server and build agents/machines all run on premise.
There is a NuGet.config file, but to be sure I tried supplying the sources directly like:
dotnet restore -s https://private.repo/ -s https://api.nuget.org/v3/index.json
With these -s arguments it finds the private packages and fails on the public ones.
If I swap the two sources, so first the public and then the private repo, it finds the public packages and then crashes on the private packages.
I tried adding the --disable-parallel argument, but that does not change anything.
The private repo does not have any authentication, it's for internal use only.
Anybody got anymore ideas?
can you add -verbosity:normal to see more info, including whether or not those 2 sources are getting used by seeing the details in the logs? via the logs, it appeared to work for me...with 2.2.300 and later.
what version sdk are you using?
can you add -verbosity:normal to see more info, including whether or not those 2 sources are getting used by seeing the details in the logs? via the logs, it appeared to work for me...with 2.2.300 and later.
what version sdk are you using?
Also using 2.2.300.
Below is part of the log that contains the restore command, I've removed some descriptions...
Edit: I tried to wrap the log in code markers, but it somehow messes up the formatting.
Paste of the log: https://pastebin.com/18jH2kne
Also, when I put the URL that it tries to reach (http://private.nuget.repo/nuget/FindPackagesById()?id='[package name]'&semVerLevel=2.0.0) in a browser I get an XML feed with all versions of our package. Does the &semVerLevel argument maybe ruin it? Since the latest version of our package is 1.0.23 ??
2019-06-13T17:21:16.8171161Z Step 19/36 : RUN dotnet restore "LCMCore/LCMCore.csproj" --configfile LCMCore/NuGet.Config --disable-parallel -s https://api.nuget.org/v3/index.json -s http://private.nuget.repo/nuget/ -verbosity:normal
2019-06-13T17:21:16.9084470Z ---> Running in b1d28a3a5d68
2019-06-13T17:21:17.6914023Z Build started 06/13/2019 17:21:17.
2019-06-13T17:21:18.5190572Z 1>Project "/src/LCMCore/LCMCore.csproj" on node 1 (Restore target(s)).
2019-06-13T17:21:18.5190874Z 1>Restore:
2019-06-13T17:21:18.5191109Z Restoring packages for /src/LCMCore/LCMCore.csproj...
2019-06-13T17:21:19.1528144Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='BuildBundlerMinifier'&semVerLevel=2.0.0
2019-06-13T17:21:19.2061361Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='BuildBundlerMinifier'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.2061769Z No such device or address
2019-06-13T17:21:19.2062240Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='CronExpressionDescriptor'&semVerLevel=2.0.0
2019-06-13T17:21:19.2449824Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='CronExpressionDescriptor'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.2450225Z No such device or address
2019-06-13T17:21:19.2450650Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='[package name]'&semVerLevel=2.0.0
2019-06-13T17:21:19.2646096Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='log4net'&semVerLevel=2.0.0
2019-06-13T17:21:19.2646680Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='[package name]'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.2646834Z No such device or address
2019-06-13T17:21:19.2971077Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='log4net'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.2971330Z No such device or address
2019-06-13T17:21:19.2971728Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.EntityFrameworkCore'&semVerLevel=2.0.0
2019-06-13T17:21:19.3215004Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.EntityFrameworkCore'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.3215246Z No such device or address
2019-06-13T17:21:19.3215660Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.EntityFrameworkCore.Sqlite'&semVerLevel=2.0.0
2019-06-13T17:21:19.3426321Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.VisualStudio.Azure.Containers.Tools.Targets'&semVerLevel=2.0.0
2019-06-13T17:21:19.3432395Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.EntityFrameworkCore.Sqlite'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.3444368Z No such device or address
2019-06-13T17:21:19.3810077Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.VisualStudio.Azure.Containers.Tools.Targets'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.3810372Z No such device or address
2019-06-13T17:21:19.3816635Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.VisualStudio.Web.CodeGeneration.Design'&semVerLevel=2.0.0
2019-06-13T17:21:19.4015002Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='Quartz'&semVerLevel=2.0.0
2019-06-13T17:21:19.4015885Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.VisualStudio.Web.CodeGeneration.Design'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.4016024Z No such device or address
2019-06-13T17:21:19.4204152Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='X.PagedList.Mvc.Core'&semVerLevel=2.0.0
2019-06-13T17:21:19.4204907Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='Quartz'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.4205034Z No such device or address
2019-06-13T17:21:19.4400465Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='X.PagedList.Mvc.Core'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.4400638Z No such device or address
2019-06-13T17:21:19.4401027Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.NETCore.App'&semVerLevel=2.0.0
2019-06-13T17:21:19.4599265Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.AspNetCore.App'&semVerLevel=2.0.0
2019-06-13T17:21:19.4599818Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.NETCore.App'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.4599946Z No such device or address
2019-06-13T17:21:19.4847121Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.AspNetCore.App'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.4847342Z No such device or address
2019-06-13T17:21:19.5625289Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='BuildBundlerMinifier'&semVerLevel=2.0.0
2019-06-13T17:21:19.5847811Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='CronExpressionDescriptor'&semVerLevel=2.0.0
2019-06-13T17:21:19.5848512Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='BuildBundlerMinifier'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.5848694Z No such device or address
2019-06-13T17:21:19.6046808Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='CronExpressionDescriptor'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.6047219Z No such device or address
2019-06-13T17:21:19.6047806Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='[package name]'&semVerLevel=2.0.0
2019-06-13T17:21:19.6287251Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='[package name]'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.6287503Z No such device or address
2019-06-13T17:21:19.6287865Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='log4net'&semVerLevel=2.0.0
2019-06-13T17:21:19.6550282Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.EntityFrameworkCore'&semVerLevel=2.0.0
2019-06-13T17:21:19.6573769Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='log4net'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.6574026Z No such device or address
2019-06-13T17:21:19.6744550Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.EntityFrameworkCore'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.6745243Z No such device or address
2019-06-13T17:21:19.6749600Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.EntityFrameworkCore.Sqlite'&semVerLevel=2.0.0
2019-06-13T17:21:19.6951425Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.VisualStudio.Azure.Containers.Tools.Targets'&semVerLevel=2.0.0
2019-06-13T17:21:19.6952022Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.EntityFrameworkCore.Sqlite'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.6952433Z No such device or address
2019-06-13T17:21:19.7146765Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.VisualStudio.Web.CodeGeneration.Design'&semVerLevel=2.0.0
2019-06-13T17:21:19.7151762Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.VisualStudio.Azure.Containers.Tools.Targets'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.7152206Z No such device or address
2019-06-13T17:21:19.7348326Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='Quartz'&semVerLevel=2.0.0
2019-06-13T17:21:19.7355475Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.VisualStudio.Web.CodeGeneration.Design'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.7355710Z No such device or address
2019-06-13T17:21:19.7542584Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='Quartz'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.7542783Z No such device or address
2019-06-13T17:21:19.7547010Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='X.PagedList.Mvc.Core'&semVerLevel=2.0.0
2019-06-13T17:21:19.7739095Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.NETCore.App'&semVerLevel=2.0.0
2019-06-13T17:21:19.7746873Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='X.PagedList.Mvc.Core'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.7747101Z No such device or address
2019-06-13T17:21:19.7947057Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.NETCore.App'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.7947352Z No such device or address
2019-06-13T17:21:19.7947773Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.AspNetCore.App'&semVerLevel=2.0.0
2019-06-13T17:21:19.8142243Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.AspNetCore.App'&semVerLevel=2.0.0'.
2019-06-13T17:21:19.8142532Z No such device or address
2019-06-13T17:21:19.8142895Z GET https://api.nuget.org/v3-flatcontainer/log4net/index.json
2019-06-13T17:21:20.2358301Z OK https://api.nuget.org/v3-flatcontainer/log4net/index.json 421ms
2019-06-13T17:21:20.2394409Z GET https://api.nuget.org/v3-flatcontainer/cronexpressiondescriptor/index.json
2019-06-13T17:21:20.3694184Z OK https://api.nuget.org/v3-flatcontainer/cronexpressiondescriptor/index.json 129ms
2019-06-13T17:21:20.3703188Z GET https://api.nuget.org/v3-flatcontainer/microsoft.visualstudio.azure.containers.tools.targets/index.json
2019-06-13T17:21:20.5035041Z OK https://api.nuget.org/v3-flatcontainer/microsoft.visualstudio.azure.containers.tools.targets/index.json 133ms
2019-06-13T17:21:20.5043113Z GET https://api.nuget.org/v3-flatcontainer/x.pagedlist.mvc.core/index.json
2019-06-13T17:21:20.9493536Z OK https://api.nuget.org/v3-flatcontainer/x.pagedlist.mvc.core/index.json 443ms
2019-06-13T17:21:20.9494119Z GET https://api.nuget.org/v3-flatcontainer/microsoft.entityframeworkcore/index.json
2019-06-13T17:21:21.0607290Z OK https://api.nuget.org/v3-flatcontainer/microsoft.entityframeworkcore/index.json 110ms
2019-06-13T17:21:21.0607791Z GET https://api.nuget.org/v3-flatcontainer/quartz/index.json
2019-06-13T17:21:21.1720638Z OK https://api.nuget.org/v3-flatcontainer/quartz/index.json 111ms
2019-06-13T17:21:21.1732288Z GET https://api.nuget.org/v3-flatcontainer/buildbundlerminifier/index.json
2019-06-13T17:21:21.2975651Z OK https://api.nuget.org/v3-flatcontainer/buildbundlerminifier/index.json 122ms
2019-06-13T17:21:21.2976410Z GET https://api.nuget.org/v3-flatcontainer/microsoft.visualstudio.web.codegeneration.design/index.json
2019-06-13T17:21:21.4145411Z OK https://api.nuget.org/v3-flatcontainer/microsoft.visualstudio.web.codegeneration.design/index.json 116ms
2019-06-13T17:21:21.4145891Z GET https://api.nuget.org/v3-flatcontainer/microsoft.entityframeworkcore.sqlite/index.json
2019-06-13T17:21:21.8444370Z OK https://api.nuget.org/v3-flatcontainer/microsoft.entityframeworkcore.sqlite/index.json 428ms
2019-06-13T17:21:21.8445388Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='BuildBundlerMinifier'&semVerLevel=2.0.0
2019-06-13T17:21:21.8708702Z GET https://api.nuget.org/v3-flatcontainer/microsoft.netcore.app/index.json
2019-06-13T17:21:22.2999232Z OK https://api.nuget.org/v3-flatcontainer/microsoft.netcore.app/index.json 425ms
2019-06-13T17:21:22.3016114Z GET https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.app/index.json
2019-06-13T17:21:22.7211737Z OK https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.app/index.json 419ms
2019-06-13T17:21:22.7223653Z GET https://api.nuget.org/v3-flatcontainer/[package name]/index.json
2019-06-13T17:21:22.8506372Z NotFound https://api.nuget.org/v3-flatcontainer/[package name]/index.json 128ms
2019-06-13T17:21:22.8534040Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='CronExpressionDescriptor'&semVerLevel=2.0.0
2019-06-13T17:21:22.8908165Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='[package name]'&semVerLevel=2.0.0
2019-06-13T17:21:22.9105113Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='log4net'&semVerLevel=2.0.0
2019-06-13T17:21:22.9292847Z 1>/usr/share/dotnet/sdk/2.2.300/NuGet.targets(121,5): error : Failed to retrieve information about '[package name]' from remote source 'http://private.nuget.repo/nuget/FindPackagesById()?id='[package name]'&semVerLevel=2.0.0'. [/src/LCMCore/LCMCore.csproj]
2019-06-13T17:21:22.9302712Z /usr/share/dotnet/sdk/2.2.300/NuGet.targets(121,5): error : No such device or address [/src/LCMCore/LCMCore.csproj]
2019-06-13T17:21:22.9374029Z GET http://private.nuget.repo/nuget/FindPackagesById()?id='Microsoft.EntityFrameworkCore'&semVerLevel=2.0.0
2019-06-13T17:21:22.9527873Z 1>Done Building Project "/src/LCMCore/LCMCore.csproj" (Restore target(s)) -- FAILED.
2019-06-13T17:21:22.9583372Z
2019-06-13T17:21:22.9583792Z Build FAILED.
2019-06-13T17:21:22.9596536Z
2019-06-13T17:21:22.9597547Z "/src/LCMCore/LCMCore.csproj" (Restore target) (1) ->
2019-06-13T17:21:22.9598033Z (Restore target) ->
2019-06-13T17:21:22.9598747Z /usr/share/dotnet/sdk/2.2.300/NuGet.targets(121,5): error : Failed to retrieve information about '[package name]' from remote source 'http://private.nuget.repo/nuget/FindPackagesById()?id='[package name]'&semVerLevel=2.0.0'. [/src/LCMCore/LCMCore.csproj]
2019-06-13T17:21:22.9599113Z /usr/share/dotnet/sdk/2.2.300/NuGet.targets(121,5): error : No such device or address [/src/LCMCore/LCMCore.csproj]
2019-06-13T17:21:22.9599331Z
2019-06-13T17:21:22.9599511Z 0 Warning(s)
2019-06-13T17:21:22.9599712Z 1 Error(s)
2019-06-13T17:21:22.9599864Z
2019-06-13T17:21:22.9600063Z Time Elapsed 00:00:05.26
2019-06-13T17:21:23.2370821Z The command '/bin/sh -c dotnet restore "LCMCore/LCMCore.csproj" --configfile LCMCore/NuGet.Config --disable-parallel -s https://api.nuget.org/v3/index.json -s http://private.nuget.repo/nuget/ -verbosity:normal' returned a non-zero code: 1
2019-06-13T17:21:23.2419588Z ##[debug]rc:1
2019-06-13T17:21:23.2421080Z ##[debug]success:false
2019-06-13T17:21:23.2515787Z ##[error]The command '/bin/sh -c dotnet restore "LCMCore/LCMCore.csproj" --configfile LCMCore/NuGet.Config --disable-parallel -s https://api.nuget.org/v3/index.json -s http://private.nuget.repo/nuget/ -verbosity:normal' returned a non-zero code: 1
2019-06-13T17:21:23.2526224Z ##[debug]Processed: ##vso[task.issue type=error;]The command '/bin/sh -c dotnet restore "LCMCore/LCMCore.csproj" --configfile LCMCore/NuGet.Config --disable-parallel -s https://api.nuget.org/v3/index.json -s http://private.nuget.repo/nuget/ -verbosity:normal' returned a non-zero code: 1
2019-06-13T17:21:23.2544886Z ##[debug]task result: Failed
2019-06-13T17:21:23.2545850Z ##[error]/usr/bin/docker failed with return code: 1
2019-06-13T17:21:23.2546253Z ##[debug]Processed: ##vso[task.issue type=error;]/usr/bin/docker failed with return code: 1
2019-06-13T17:21:23.2569983Z ##[debug]Processed: ##vso[task.complete result=Failed;]/usr/bin/docker failed with return code: 1
2019-06-13T17:21:23.2595205Z ##[section]Finishing: Build an image
For me the solution was to pass arg
--no-dependencies
into the task: DotNetCoreCLI@2 input arguments
Is there any progress on this...? This issue has been open for so long already.
Same issue here, exactly as described a year and a half ago by @dyadenka. However, that's only on the first run. Then running again it runs with no issues. Which is a fine enough work around but every CI script anywhere that does a .NET build has to have this extra hack that dotnet restores, swallowing the error so the script doesn't fail, and then dotnet restoring again.
Repro steps:
1) setup a private nuget repo in nuget.config
2) dotnet restore to an as yet empty --packages folder
3) FAIL
4) run the exact same dotnet restore again
5) PROFIT
In terms of the verbose logs, it's exactly as @dyadenka described. It tries to download from both the official nuget source and the private source, even the private packages.
...
NotFound https://api.nuget.org/v3-flatcontainer/<private package>/index.json 635ms
...
OK http://<private repo>/nuget/FindPackagesById()?id='<private package>'&semVerLevel=2.0.0 1687ms
...
xxx.csproj : error NU1101: Unable to find package <package name>. No packages exist with this id in source(s): nuget.org [xxxx.sln]
Then the restore fails and aborts.
When I run the second time, it doesn't even TRY to request the packages because it already got them the first time even though it failed with a false error. So it works perfectly without failing.
This happens with or without --ignore-failed-sources
I'm getting the same issue. All the reports make me think there may be multiple underlying issues. In our case we have the following setup:
We have an internal nuget package on a private feed. All our projects hard-pin a specific version of the package.
We were upgrading the project for the first time, and (naturally) we only changed the PackageReference Versions in one Solution. When we attempt to do the nuget restore for that solution, it gives this error. Downgrade the package, it's fine on the same hardware with the same config. (We have self-hosted build agents.)
Perplexed, we poke around. We decide to update a single .NET core project. Suddenly it works fine.
So it seems there's something very funky about the difference between the .NET Core CLI and the Nuget CLI with .NET Standard. For some reason, grabbing different versions of the package between one and the other causes this nonsense failure.
I made a sample project in Azure Devops that illustrates the problem we're having (and the workaround.) Basically, nuget restore doesn't understand our Nuget.config, dotnet restore does.
Failed build - netcore and netframework projects are using different versions of the package.
Successful build - netcore and netframework are using the same versions of the package
I was observing one of our build agents as it was working and it seems like it might be deleting the Nuget.config file when it is created. Here is the part where it creates a closure which is later used to clean up the file. My Javascript/Typescript is not very good, is that closure doing what it's supposed to do?
Either way for Azure Pipelines it would be better to use the Agent.TempDirectory environment variable so the task itself doesn't have to be trusted to clean up the file.
Okay, I think it deletes the config at the right time but it still feels like something goes wrong in there. Even when the restore succeeds, it still does this sequence:
Preparing to set credentials in NuGet.config
C:\azure-agent\_work\_tool\NuGet\4.3.0\x64\nuget.exe sources Remove -NonInteractive -Name NuGetOrg -ConfigFile C:\azure-agent\_work\1\Nuget\tempNuGet_26655.config
Unable to find any package source(s) matching name: NuGetOrg.
Setting credentials in NuGet.config
C:\azure-agent\_work\_tool\NuGet\4.3.0\x64\nuget.exe sources Add -NonInteractive -Name NuGetOrg -Source https://api.nuget.org/v3/index.json -ConfigFile C:\azure-agent\_work\1\Nuget\tempNuGet_26655.config
Package Source with Name: NuGetOrg added successfully.
In our Nuget.config we have:
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3"/>
So I'm a little confused, if NugetOrg is supposed to get mapped to nuget.org or not, something definitely seems funky there, though possibly it's not a problem.
I ran into this issue when trying to run donet restore.
dotnet restore
Retrying '{removed}' for source '{privateRepoUrl}?id='{removed}'&semVerLevel=2.0.0'.
I had to remove my private repo from my users nuget config file located at AppData\Roaming\NuGet
whenever I'm offline from my vpn.
I have the same problem
Started to receive this problem when I changed my nuget packages to use star version numbering:
0.0.*
In DevOps all the steps are trying to now resolve packages and fails:
All works if I change the package versions into fixed number.
I had this problem, after thinking a lot I realized that it was my internet that was rubbish, I connected to another network and it was quiet. this when I built a docker image.
Has there been any resolution to the issue, I have been facing the same issue as pointed by @whvanderpost when I try to restore using multiple package sources(one private and one public ) inside a docker.
RUN dotnet restore -s "http://myprivaterepo/nuget/.NET/" -s "https://api.nuget.org/v3/index.json"
Similar issue inside a docker container. Weirdly, it builds fin when I run my Dockerfile on my local machine, but throws the error when running the same Dockerfile on a linux build machine.
RUN dotnet restore --configfile ./NuGet.config
NuGet.config contains both the standard nuget, and our private nuget.
Hi, I'm encoutering kinda same issue, not during a nuget restore, but during :
dotnet new -i Whatever.Template.ITry.To.Install
--- output :
```_user@workstation_ MINGW64 /c/dev-r-and-d/bolero-test-1
$ dotnet nuget list source
Sources inscritesâ–’:
user@workstation MINGW64 /c/dev-r-and-d/bolero-test-1
$ dotnet new -i Bolero.Templates
Nouvelle tentative de 'FindPackagesByIdAsyncCore' pour la source 'http://nuget.CompanyName.com/feeds/CompanyName.Framework.Standard/FindPackagesById()?id='Bolero.Templates'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
Nouvelle tentative de 'FindPackagesByIdAsyncCore' pour la source 'http://nuget.CompanyName.com/feeds/CompanyName.Framework.Standard/FindPackagesById()?id='Bolero.Templates'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
C:Program Filesdotnetsdk3.1.201NuGet.targets(124,5): error : Echec de la récupération des informations sur 'Bolero.Templates' à partir de la source distante 'http://nuget.CompanyName.com/feeds/CompanyName.Framework.Standard/FindPackagesById()?id='Bolero.Templates'&semVerLevel=2.0.0'. [C:Usersuser.templateenginedotnetcliv3.1.201scratchrestore.csproj]
C:Program Filesdotnetsdk3.1.201NuGet.targets(124,5): error : Response status code does not indicate success: 404 (Not Found). [C:Usersuser.templateenginedotnetcliv3.1.201scratchrestore.csproj]
**--- SYSTEM INFO**
$ dotnet --version
3.1.201
$ dotnet --list-runtimes
Microsoft.AspNetCore.All 2.1.5 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.11 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.12 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.17 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.5 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.8 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.5 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.11 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.12 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.17 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.5 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.8 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.3 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.5 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 2.1.11 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 2.1.12 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 2.1.17 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 2.2.5 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 2.2.8 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 3.0.0 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 3.1.3 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.3 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
$ dotnet --list-sdks
2.1.403 [C:Program Filesdotnetsdk]
2.1.604 [C:Program Filesdotnetsdk]
2.1.700 [C:Program Filesdotnetsdk]
2.1.801 [C:Program Filesdotnetsdk]
2.2.204 [C:Program Filesdotnetsdk]
2.2.300 [C:Program Filesdotnetsdk]
3.0.100 [C:Program Filesdotnetsdk]
3.1.201 [C:Program Filesdotnetsdk]
```
I still have this issue running both from local Linux and docker.
Both hosts resolve (local and remote) so this seems to be a bug in dotnet restore / Nuget.
Any workarounds ar solutions?
Is it because of Windows based slashed in file paths even when this is the header of the proj file:
?
Similar issue inside a docker container. Weirdly, it builds fin when I run my Dockerfile on my local machine, but throws the error when running the same Dockerfile on a linux build machine.
RUN dotnet restore --configfile ./NuGet.config
NuGet.config contains both the standard nuget, and our private nuget.
I had the same issue, renamed the file to NuGet.Config and it worked.
nuget.config also works.
Hi,
I am using the same approach for docker like nuget.config to restore telerik reporting package but its not working trying to pass username and password from nuget.config file. but its not working. Did anyone face the same issue or any resolution for it?
I seem to be fighting the same bloody issue, NETSDK1004
whatever it is, and retrying findpackagesbyidasyncore for source
, failure. I do not recall this being the issue that it is with previous versions of NuGet. Seemed like it could handle multiple sources just fine. In fact, it is to be expected one might be drawing from multiple sources, the canonnical nuget package source, an MS internal packages source, an organizational or private source, and so on. And I should add, I have several such NuGet.Config
, all by convention, right... One at a system level, in my user profile, and then in the solution itself. All very standard way of configuring NuGet
these days.
Happy 3rd birthday, Issue #6140
@opejanovic Sounds like a win to me; 'casm.
I think I may have found the key to the problem, when I upgrade my private nuget server from old version(2.10) to latest version(3.4), everything is done.
Wow I was just today searching for a solution to this problem, didn't know it has existed for so long.
Most helpful comment
Happy 3rd birthday, Issue #6140