Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upDotnet restore uses global temporary directory #2793
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rrelyea
May 17, 2016
Contributor
Not sure what is best temp to use on Linux: http://stackoverflow.com/questions/31068/how-do-i-find-the-temp-directory-in-linux
|
Not sure what is best temp to use on Linux: http://stackoverflow.com/questions/31068/how-do-i-find-the-temp-directory-in-linux |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Inumedia
May 17, 2016
@rrelyea Not sure, but on Ubuntu 14.04 only mktemp out of those commands are available built in.
Inumedia
commented
May 17, 2016
|
@rrelyea Not sure, but on Ubuntu 14.04 only |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
IntelOrca
Jun 16, 2016
As a work around, you can either set your environment variable TMPDIR beforehand to something the user will have permissions to... or you can set the permissions of /tmp/NuGetScratch/ and /tmp/NuGetScratch/lock to o+rwx.
IntelOrca
commented
Jun 16, 2016
|
As a work around, you can either set your environment variable |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
dcby
Jun 28, 2016
Same issue on centos. I believe all *nix systems are affected. Did not check on windows yet. Any reason to not use user specific directory (i.e. inside ~/.nuget)?
dcby
commented
Jun 28, 2016
|
Same issue on centos. I believe all *nix systems are affected. Did not check on windows yet. Any reason to not use user specific directory (i.e. inside |
kalahari
referenced this issue
Jun 29, 2016
Closed
dotnet restore fails for non-root user on 1.0.0-preview2-sdk #78
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jjqq2013
Jul 5, 2016
+1 i ran into same problem in an non-root docker container. @IntelOrca thank you.
It seems the first one who create ${TMPDIR}/NuGetScratch/lock should set correct permission because this lock directory will be used all other users, and the same for ${TMPDIR}/NuGetScratch.
I think this is a bug.
jjqq2013
commented
Jul 5, 2016
|
+1 i ran into same problem in an non-root docker container. @IntelOrca thank you. I think this is a bug. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
naamunds
Jul 7, 2016
Another possible workaround is to simply delete /tmp/NuGetScratch. That worked for me in the limited testing I've done.
naamunds
commented
Jul 7, 2016
|
Another possible workaround is to simply delete |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jjqq2013
Jul 8, 2016
Yes remove the /tmp/NuGetScratch will work fine. Besides, I have created a docker image to resolve some problem about this and other anti-root tools like yeomon . https://hub.docker.com/r/osexp2000/dnetcore_docker_image/
jjqq2013
commented
Jul 8, 2016
|
Yes remove the /tmp/NuGetScratch will work fine. Besides, I have created a docker image to resolve some problem about this and other anti-root tools like yeomon . https://hub.docker.com/r/osexp2000/dnetcore_docker_image/ |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
IntelOrca
Jul 8, 2016
Deleting the folder will not solve the issue of two users doing a package restore at the same time.
IntelOrca
commented
Jul 8, 2016
|
Deleting the folder will not solve the issue of two users doing a package restore at the same time. |
naamunds
referenced this issue
Jul 12, 2016
Closed
Reevalute workaround for non-root user issue with NuGetScratch #84
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tmds
Nov 16, 2016
On linux, Path.GetTempPath returns "/tmp" while on Windows it returns a user specific folder "C:\Users\tmds\AppData\Local\Temp".
From the corefx code it seems like the value returned by Path.GetTempPath can be controlled by setting the TMPDIR environment variable. Setting this variable to a user specific folder can serve as a workaround.
According to the documentation Path.GetTempPath should return the current user's temporary folder.
I'll create a matching issue in the corefx repo to see of Path.GetTempPath needs to be updated so it returns a user specific folder or whether the NuGet.Client needs to take into account it may not be the sole owner of the directory returned by Path.GetTempPath.
tmds
commented
Nov 16, 2016
|
On linux, Path.GetTempPath returns "/tmp" while on Windows it returns a user specific folder "C:\Users\tmds\AppData\Local\Temp". From the corefx code it seems like the value returned by Path.GetTempPath can be controlled by setting the TMPDIR environment variable. Setting this variable to a user specific folder can serve as a workaround. According to the documentation Path.GetTempPath should return the current user's temporary folder. I'll create a matching issue in the corefx repo to see of Path.GetTempPath needs to be updated so it returns a user specific folder or whether the NuGet.Client needs to take into account it may not be the sole owner of the directory returned by Path.GetTempPath. |
tmds
referenced this issue
Nov 16, 2016
Closed
Path.GetTempPath does not return a user specific folder on Unix systems #13710
omajid
referenced this issue
Nov 16, 2016
Closed
dotnet restore: temporary directory is expected to be user specific #3229
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
IntelOrca
Nov 16, 2016
Would it be possible to enhance NuGet to work with any number of concurrent package restores even for the same user?
IntelOrca
commented
Nov 16, 2016
•
|
Would it be possible to enhance NuGet to work with any number of concurrent package restores even for the same user? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tmds
Nov 18, 2016
@IntelOrca NuGet allows concurrent restores for the same and different users. "lock" is a folder and in it are files which represent a lock on a file in the filesystem.
tmds
commented
Nov 18, 2016
|
@IntelOrca NuGet allows concurrent restores for the same and different users. "lock" is a folder and in it are files which represent a lock on a file in the filesystem. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Fixed with NuGet/NuGet.Client#1035. Thanks @tmds! |
joelverhagen
closed this
Jan 6, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Inumedia
commented
Jan 6, 2017
|
Woohoo! Thanks |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
DylanFPS
Mar 12, 2017
Deleting %AppData%\..\Local\Temp\NuGetScratch and %UserProfile%\.nuget seems to fix this issue on windows environments.
DylanFPS
commented
Mar 12, 2017
|
Deleting |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
meidianto
commented
May 30, 2017
•
|
Fixed the issue by deleting |
Inumedia commentedMay 16, 2016
This is a forwarded issue from the Dotnet CLI repository, I was informed that this issue stems from the NuGet side of things.
The original issue can be seen here: dotnet/cli#2806
Steps to reproduce
dotnet restoredotnet restoreExpected behavior
dotnet restoreshould work as expected and my project's dependencies should be restored.Actual behavior
dotnet restoreattempts to re-use the /tmp/NuGetScratch/lock causing a permissions error and failing out.Environment data
dotnet --infooutput:(Attempting to run
dotnet --infoyields no helpful information, I randotnet --version)dotnet --version:.NET Command Line Tools (1.0.0-beta-001598)
Product Information:
Version: 1.0.0-beta-001598
Commit Sha: N/A
Runtime Environment:
OS Name: ubuntu
OS Version: 14.04
OS Platform: Linux
Runtime Id: ubuntu.14.04-x64