Skip to content
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

Concurrent nuget install failures #7380

Closed
plaurin opened this issue Oct 9, 2018 · 5 comments
Closed

Concurrent nuget install failures #7380

plaurin opened this issue Oct 9, 2018 · 5 comments

Comments

@plaurin
Copy link

plaurin commented Oct 9, 2018

We are using TeamCity with multiple agents on the same physical machine. We want to have all the agents share the same global packages folder to save disk space. Even then, it is not enough and we clear the packages from time to time. The result is that we have only one shared global packages folder, but install and restore operations fail regularly after we clear the locals caches.

We get errors like these

  • Access to the path 'bqipdjvv.1mg' is denied.
  • The directory is not empty.

Unfortunately, the NuGetScratch folder is located under the %temp% folder which TeamCity override per agent. What we understand is that the scratch folder is used to lock the downloads and installs of packages in the global cache. If we try to install the same package for the first time from different nuget install at the same time, the second will wait for the first one to finish without problem.
However, if I repeat the experiment with different %temp% at least one of the nuget install will fail.

Is there any reason that the NuGetScratch folder is located in %temp% while other NuGet folders are in %localappdata% or the user folder?

Do you think there is a way to make this work anyway? I mean using nuget from different TeamCity agents sharing the same global packages folder but not the same %temp% folder?

@cortex93
Copy link

This is related to #7060

@plaurin
Copy link
Author

plaurin commented Oct 11, 2018

@cortex93 Yes it looks like you have a similar problem. I made a lot of tests running nuget in parallel and as long as it is running under the same user and same %temp% everything is fine.

Have you tried to run each TFS agent under different user? If it is the same user make sure the %temp% is not separated per agent or you will have the same problem like us.

@cortex93
Copy link

@plaurin Thanks for sharing your experience. Very valuable.

@nkolev92
Copy link
Member

nkolev92 commented Mar 29, 2019

Sorry for the delayed response @plaurin

Unfortunately you cannot make it work without sharing the temp + global packages folder location.
This is not something we've seen people do often so it's not super well documented.

You can however override the NuGet temp location to be different from the usual temp location that teamcity redirects.
Of course this location would still have to be the same across agents.

https://docs.microsoft.com/en-us/nuget/consume-packages/managing-the-global-packages-and-cache-folders

Does this answer your question?

@nkolev92 nkolev92 added Functionality:Restore WaitingForCustomer Applied when a NuGet triage person needs more info from the OP labels Mar 29, 2019
@nkolev92
Copy link
Member

Closing this as a by design resolution.

Doc issue in https://github.com/NuGet/docs.microsoft.com-nuget/issues/1779.

@nkolev92 nkolev92 added Product:NuGet.exe NuGet.exe Product:dotnet.exe Resolution:ByDesign This issue appears to be ByDesign Style:PackageReference and removed WaitingForCustomer Applied when a NuGet triage person needs more info from the OP labels Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants