paket restore does not properly populate the NuGet cache
Nobody has claimed this yet.
- Dominant language
- F#
- Stars
- 2.1k
- Forks
- 528
- Avg merge
- 1d 12m
- Merged PRs (30d)
- 54
Description
Description
My company has build servers that do not have direct outbound internet access. After deploying new build servers with an updated version of the .NET Core SDK, package restore fails.
We have an internal mirror of the gallery using ProGet that we have instructed Paket to use as it's source.
Paket appears to download the NuGet packages into the user's NuGet cache, but NuGet ignores them and forces a fresh download.
Repro steps (1)
This is the scenario as replicated from my actual issue.
- Set up two PCs (VMs are OK) with a clean installation of Windows 10 v1803
- On PC 1, install the .NET Core SDK v2.1.201
- On PC 1, create a
netcoreapp2.0project with paket.dependencies and paket.lock - Copy the project from PC 1 to PC 2
- On PC 2, install the .NET Core SDK v2.1.400
- On PC 2, run
paket restore - On PC 2, note that
%USERPROFILE%\.nuget\packagesis populated with packages that paket has downloaded - Disconnect PC 2 from the internet
- On PC 2, run
dotnet restore.
Repro steps (2)
This is a simpler repro that I came across when building the first repro above:
- Set up a PC with .NET Core SDK v2.1.201
- Create a
netcoreapp2.0project with paket.dependencies and paket.lock - Run
paket restore - Run
dotnet restore. Observe that it completes successfully. - Clear the cache with
dotnet nuget locals all --clear - Run
paket restore - Disconnect the PC from the internet
- Run
dotnet restore
Expected behavior
dotnet restore uses packages from the local cache that paket has prepopulated.
Actual behavior
dotnet fails to build with a NuGet error:
Unable to load the service index for source https://api.nuget.org/v3/index.json
If PC 2 is reconnected to the internet, then it redownloads many if not all dependent packages in their entirety. This can be observed by using Fiddler with SSL/TLS interception enabled.
Known workarounds
Adding a NuGet.config can force NuGet to connect to the proget server and NuGet to download packages.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the two offline reproduction scenarios: run paket restore, clear the NuGet cache where specified, disconnect the machine, and run dotnet restore. Trace how Paket populates the user's NuGet cache and compare that with what dotnet restore expects. Done means dotnet restore succeeds offline using packages fetched by Paket; no source files or tests are named in the issue.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100