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

v1.6 Windows permissions problems with *tmpdir* created dirs #38433

Closed
joa-quim opened this issue Nov 13, 2020 · 27 comments · Fixed by #39038
Closed

v1.6 Windows permissions problems with *tmpdir* created dirs #38433

joa-quim opened this issue Nov 13, 2020 · 27 comments · Fixed by #39038

Comments

@joa-quim
Copy link

I can reproduce this with more packages but this one should be enough to show the problem,

] test FFTW

Discrete cosine transform (DCT) tests |  337    337
Test Summary:  | Pass  Total
UNALIGNED flag |   74     74
Test Summary:           | Pass  Total
Base Julia issue #19892 |    3      3
     Testing FFTW tests passed
┌ Error: mktempdir cleanup
│   exception =
│    SystemError (with C:\TMP\jl_Q9AXIp): rmdir: Permission denied
│    Stacktrace:
│      [1] systemerror(p::Symbol, errno::Int32; extrainfo::String)

The problem seems to arise from the lack of Modify permission. When I try to manually remove the C:\TMP\jl_Q9AXIp I get a windows popup asking me to confirm that I have administrator permissions (which I have so it shouldn't ask, but it does). If I manually change the Modify permission to check then I can delete that directory without further questions.
Quite likely that explains why mktempdir cleanup can't do its job silently.

image

@KristofferC
Copy link
Sponsor Member

KristofferC commented Nov 13, 2020

Probably the same cause as #38411

@bkamins
Copy link
Member

bkamins commented Nov 13, 2020

Yes - it seems to be related to "Modify" permissions. Yet on my system I have "Modify" set to yes in these folder for "Authenticated Users" and only "Users" it is set to "Read & execute"+"List"+"Read" onyl (without "Modify" and without "Write"). The same set of permissions is for all .julia subfolders.

@musm
Copy link
Contributor

musm commented Nov 13, 2020

@bkamins what does winver say? And do you have admin permission on the machine?
image

@bkamins
Copy link
Member

bkamins commented Nov 13, 2020

image
(but in general my system is up to date, just 2020 update is not available for my machine yet)

regarding rights - yes I have them (and that is why I personally do not have a problem - I just run Julia process as an administrator and all works, but many people do not have it)

@musm
Copy link
Contributor

musm commented Nov 13, 2020

Strangely enough, on my copy (fresh 1.5 install) and running Julia without Admin privileges I cannot reproduce this error.

@joa-quim
Copy link
Author

image

But I get this also in another computer with an older Windows version. On Julia 1.5.0 it runs fine.

@joa-quim
Copy link
Author

Probably the same cause as #38411

Maybe but that PR was merged 16 days ago and I still see this problem with the (today's) nightly build.

@bkamins
Copy link
Member

bkamins commented Nov 13, 2020

I am not sure it is related, but recently I started to get in DataFrames.jl errors in CI on nightly on Win and OSx of this kind: https://travis-ci.com/github/JuliaData/DataFrames.jl/jobs/439295303 and https://travis-ci.com/github/JuliaData/DataFrames.jl/jobs/439295302 (such things do not happen on Linux; the error message does not tell me what is the reason of failure but one of them might be permissions).

@fredrikekre
Copy link
Member

I am not sure it is related, but recently I started to get in DataFrames.jl errors in CI on nightly on Win and OSx of this kind: https://travis-ci.com/github/JuliaData/DataFrames.jl/jobs/439295303 and https://travis-ci.com/github/JuliaData/DataFrames.jl/jobs/439295302 (such things do not happen on Linux; the error message does not tell me what is the reason of failure but one of them might be permissions).

That is #38429

@musm
Copy link
Contributor

musm commented Nov 13, 2020

I tested a couple of configurations:

  1. Locally installed a fresh copy of 1.5.3 in the default installation location, nuked the compile cache folder, attempted test FFTW and using Tables, no errors in both instances.
  2. Fresh VM in Hyper-V with the build information below. Followed the same steps as in 1, and obtained a similar outcome, no errors.
    image

I guess the good news is that the error isn't as widespread as initially thought, but the bad news is I can't reproduce the bug.

@musm
Copy link
Contributor

musm commented Nov 13, 2020

How are you all installing Julia here? Is it directly form the website and then running the installer normally (without admin privileges)?

@bkamins
Copy link
Member

bkamins commented Nov 13, 2020

Yes.

Also I have just checked that if I remove .julia folder then I get again:

julia> using DataFrames
[ Info: Precompiling DataFrames [a93c6f00-e57d-5684-b7b6-d8193f3e46c0]
ERROR: LoadError: IOError: unlink: permission denied (EACCES)

if I not run julia with admin privileges.

@joa-quim
Copy link
Author

Sorry to cast more confusion but in a Win VM on the same machine were it errors I installed Julia both in the standard location (which I hate because it's a hidden directory) and under c:/programs/julia-DEV and in both cases I had no problems!!

Winver of the VM
image

@musm
Copy link
Contributor

musm commented Dec 18, 2020

@joa-quim please reopen a new issue if you encounter this problem again. I suspect this is a dupe of #38411

@musm musm closed this as completed Dec 18, 2020
@joa-quim
Copy link
Author

I still see the problem

julia> mktempdir() do dir
       end
┌ Error: mktempdir cleanup
│   exception =
│    SystemError (with C:\TMP\jl_BrJXnk): rmdir: Permission denied

with

julia> versioninfo()
Julia Version 1.7.0-DEV.54
Commit 6ddc7f1ecc (2020-12-13 23:16 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.0 (ORCJIT, skylake)

@musm musm reopened this Dec 18, 2020
@musm
Copy link
Contributor

musm commented Dec 21, 2020

@joa-quim do you have a custom JULIA_DEPOT_PATH set? Or any other env variables? I do not get that issue in a plain install of Julia in VM.

@joa-quim
Copy link
Author

No. I know that's strange but the problem only occurs with v1.6 (and started about 2-3 months ago. Before it was ok). v1.5 in the exact same machine/config has no problems.

@vtjnash
Copy link
Sponsor Member

vtjnash commented Dec 21, 2020

Might be libuv/libuv@509214d (which added the capability of supporting mode): but perhaps _mkdir had undocumented functionality affecting this?

EDIT: should not be different though (https://bugs.python.org/issue9752#msg115862)

@musm
Copy link
Contributor

musm commented Dec 21, 2020

That's probably what I think. MSFT's docs for _mkdir don't specify how or if they set permissions for _mkdir.

CreateDirectoryW permissions with the NULL argument set them to a sensible value, but probably not what we want:

If lpSecurityAttributes is NULL, the directory gets a default security descriptor. The ACLs in the default security descriptor for a directory are inherited from its parent directory.

@musm
Copy link
Contributor

musm commented Dec 30, 2020

Actually, this is fixed by #39038

I noticed that my TMP variable was set to a folder in my user path which is why I couldn't reproduce it initially.
Thus, to reproduce:

ENV["TMP"] = "C:\\TMP"
julia>  mktempdir() do dir
                     end

@joa-quim
Copy link
Author

I'm sorry but too quick in closing

   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.7.0-DEV.194 (2020-12-30)
 _/ |\__'_|_|_|\__'_|  |  Commit aeb933c10e (0 days old master)
|__/                   |

julia> mktempdir() do dir end
┌ Error: mktempdir cleanup
│   exception =
│    SystemError (with C:\TMP\jl_T6S6rK): rmdir: Permission denied
│    Stacktrace:

But if that may help, I do not have the TMP in the Windows standard place

C:\v
set | grep TMP
TEMP=C:\TMP
TMP=C:\TMP

@musm
Copy link
Contributor

musm commented Dec 30, 2020

Your nightly is a commit behind the one with the fix. Try downloading again.

@joa-quim
Copy link
Author

OK, I'll try again tomorrow. I just did download the installer 1/4 hour ago.

@musm
Copy link
Contributor

musm commented Dec 30, 2020

Sounds good, yes please confirm it works for you.

@musm
Copy link
Contributor

musm commented Dec 30, 2020

I just did download the installer 1/4 hour ago.

Yeah, I think they take day or so to get updated.

@joa-quim
Copy link
Author

Confirmed. Problem solved. Thanks
But on the other hand this new version crashes the VSC language server and broke Revise

@musm
Copy link
Contributor

musm commented Dec 31, 2020

That's not surprising, it's a moving target. We will backport the fix for this issue to a stable release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants