-
Notifications
You must be signed in to change notification settings - Fork 258
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
MSB4181: The "Restore Task" task returned false but did not log an error. #13460
Comments
First call comes to:
When we talk to the server first, it tells us that the package exists (we determine that byt looking up flat container, which these public upstreams have), so FindLibraryAsync returns at https://github.com/NuGet/NuGet.Client/blob/a7131d98a28b0be1d21a125b5660fc8782c27ace/src/NuGet.Core/NuGet.Commands/RestoreCommand/SourceRepositoryDependencyProvider.cs#L239-L271. Then later, the stack trace above linked by @donnie-msft occurs. and since the exception is PackageNotFoundProtocolException which extends from InvalidCacheProtocolException, https://github.com/NuGet/NuGet.Client/blob/a7131d98a28b0be1d21a125b5660fc8782c27ace/src/NuGet.Core/NuGet.Commands/RestoreCommand/SourceRepositoryDependencyProvider.cs#L376-L387, it rethrown and not logged to the logger, and thus not failing the restore appropriately. Not sure why InvalidCacheProtocolException in particular gets ignored. The fix could be as simple as stop ignoring that, but it could have some unintended side-effects. I think the real root cause is a package is reported as available, but it isn't really. I'm not sure it's against the protocol to the letter, but it is inconsistent. I think we need to get a fix here, and approach it holistically. |
Changes that introduced the PackageNotFound exception. There's context in the PR description + commit message: NuGet/NuGet.Client@527488e and NuGet/NuGet.Client#1319. It's supposed to handle "deleted" packages and refresh the cache. |
We recently bumped to a 9.0 preview 6 SDK build and started seeing this error quite frequently during the dotnet VMR build. I uploaded a binlog that shows no obvious signs of any restore issues in dotnet/sdk#41477 (comment) |
NuGet Product Used
dotnet.exe, MSBuild.exe, NuGet.exe, Visual Studio Package Management UI
Product Version
Repro'd at least back to 17.9
Worked before?
Yes, not sure
Impact
It's more difficult to complete my work
Repro Steps & Context
Particular restore errors are no longer being logged, so it's very difficult for customers to know why restore is failing.
In my case, I can repro this by adding a package reference for a package which exists on a feed, but I'm not authorized to download.
msbuild src\NuGet.Clients\NuGet.PackageManagement.PowerShellCmdlets\NuGet.PackageManagement.PowerShellCmdlets.csproj /t:restore /clp:v=n
The actual error I found while debugging, which I expect to be logged, is:
Verbose Logs
No response
The text was updated successfully, but these errors were encountered: