dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.83k stars 4.62k forks source link

CI builds failing with restore error #33837

Closed jaredpar closed 4 years ago

jaredpar commented 4 years ago

Looks like all our official builds are failing with the following restore exception:

installer.tasks -> F:\workspace\_work\1\s\artifacts\bin\installer.tasks\Debug\net46\installer.tasks.dll
installer.tasks -> F:\workspace\_work\1\s\artifacts\bin\installer.tasks\Debug\netstandard2.0\installer.tasks.dll
Determining projects to restore...
Microsoft.DotNet.ToolPackage.ResolverCacheInconsistentException: more than one row for coverlet.console-1.7.0-net5.0-any-coverlet
   at Microsoft.DotNet.ToolPackage.LocalToolsResolverCache.TryGetMatchingRestoredCommand(RestoredCommandIdentifier restoredCommandIdentifier, CacheRow[] cacheTable, RestoredCommand& restoredCommandList)
   at Microsoft.DotNet.ToolPackage.LocalToolsResolverCache.TryLoad(RestoredCommandIdentifier restoredCommandIdentifier, RestoredCommand& restoredCommand)
   at Microsoft.DotNet.Tools.Tool.Restore.ToolRestoreCommand.PackageHasBeenRestored(ToolManifestPackage package, String targetFramework)
   at Microsoft.DotNet.Tools.Tool.Restore.ToolRestoreCommand.InstallPackages(ToolManifestPackage package, Nullable`1 configFile)
   at Microsoft.DotNet.Tools.Tool.Restore.ToolRestoreCommand.<>c__DisplayClass11_0.<Execute>b__0(ToolManifestPackage package)
   at System.Linq.Enumerable.SelectArrayIterator`2.MoveNext()
   at System.Linq.ParallelEnumerable.ToList[TSource](ParallelQuery`1 source)
   at System.Linq.ParallelEnumerable.ToArray[TSource](ParallelQuery`1 source)
   at Microsoft.DotNet.Tools.Tool.Restore.ToolRestoreCommand.Execute()
   at Microsoft.DotNet.Cli.DotNetTopLevelCommandBase.RunCommand(String[] args)
   at Microsoft.DotNet.Tools.Tool.ToolCommand.Run(String[] args)
   at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient)
   at Microsoft.DotNet.Cli.Program.Main(String[] args)
Dotnet-GitSync-Bot commented 4 years ago

I couldn't add an area label to this Issue.

Checkout this page to find out which area owner to ping, or please add exactly one area label to help train me in the future.

safern commented 4 years ago

cc: @ViktorHofer

wli3 commented 4 years ago

Try override DOTNET_CLI_HOME to a temp location everytime.

https://github.com/dotnet/sdk/blob/b1223209644d900702287faea8e9b71f95ec49f8/src/Layout/redist/targets/OverlaySdkOnLKG.targets#L39

wli3 commented 4 years ago

could mitigate it for now

ViktorHofer commented 4 years ago

A mitigation is already in process: https://github.com/dotnet/runtime/pull/33871. Let's discuss the right fix in the sdk issue.

janvorli commented 4 years ago

@ViktorHofer, @wli3, @safern I keep hitting this issue locally on my Linux box with Ubuntu 16.04. Latest master cleaned with git clean -xdf. DOTNET_CLI_HOME workaround works, but is someone working on a real fix?

jaredpar commented 4 years ago

@janvorli

Have you tried nuking your NuGet package cache? Essentially run the following:

dotnet nuget locals all --clear

It's possible an old package is cached that is impacting this restore. If that doesn't fix it though we should probably open a new issue to track this as it's unlikely to be related to this specific instance.

janvorli commented 4 years ago

@jaredpar that didn't help, the issue persists.

jaredpar commented 4 years ago

@janvorli can you open a new issue with the error that you're seeing locally? The error in this issue is specific to our official build so my assumption would be that there is a subtle difference here in what you're seeing.

Also could you attach / share out the binary log for restore (add -binaryLog to the build.cmd/sh invocation). That should help narrow down what is going on.