Error occurred while restoring NuGet packages: multiple attempts to download the nupkg have failed.
Summary
When uploading a package which is already present on the nuget registry with exact the same version, you will get the following error when attempting to download the package.
Error occurred while restoring NuGet packages: The feed 'iav.gitlab [https://xxxx/api/v4/projects/5050/packages/nuget/index.json]' lists package 'XXX.1.0.3' but multiple attempts to download the nupkg have failed. The feed is either invalid or required packages were removed while the current operation was in progress. Verify the package exists on the feed and try again.
Steps to reproduce
- create a nuget package (it can be just an empty c# project which you 'pack')
- upload the package with 'dotnet nuget push *.nupkg -k '
- upload the package a second time
- create a project which uses the package
- make sure the package is not in the local nuget cache or restored from a different source. (you can clear the cache)
- try building your project which consumes the package
->you should see a error similar to the above
What is the current bug behavior?
- uploading the package multiple times with the exact same version does not fail
- restoring the package fails with an error which give not much of a hint to the error
Error occurred while restoring NuGet packages: The feed 'iav.gitlab [https://xxxx/api/v4/projects/5050/packages/nuget/index.json]' lists package 'XXX.1.0.3' but multiple attempts to download the nupkg have failed. The feed is either invalid or required packages were removed while the current operation was in progress. Verify the package exists on the feed and try again.
What is the expected correct behavior?
- uploading the package should work (or fail with a proper error when the version is exactly the same)
- restoring the package does not fail
From the docs it should be possible to upload the package multiple times without an error behaviour.
If you upload the same package with the same version multiple times, each consecutive upload is saved as a separate file. When installing a package, GitLab will serve the most recent file.
GitLab version
GitLab Enterprise Edition 12.8.7-ee
Edited by Tim Rizzi