Open evanfields opened 1 year ago
Is it possible that the user that owns the Registry folder C:\Users\ejfie\.julia\registries\General
is different from the user that you are using Julia under?
That git tries to access the safe.directory
config suggests to me that it thinks that you are trying to access a Git repo that is not "yours", which is a relatively new behaviour fixing a security problem: https://git-scm.com/docs/git-config/2.35.2#Documentation/git-config.txt-safedirectory
You can test for this (maybe) by running git status
in C:\Users\ejfie\.julia\registries\General
(outside Julia and/or maybe from inside if you know how) and see what happens.
Thanks for the response!
Is it possible that the user that owns the Registry folder C:\Users\ejfie.julia\registries\General is different from the user that you are using Julia under?
I guess possible, but unlikely: the machine in question is a personal computer at home, no other users. Windows shows that for the C:\Users\ejfie\.julia\registries\General
folder, user ejfie has the same permissions as the administrator and system usergroups.
Running git status from git bash:
ejfie@DESKTOP-12KR94V MINGW64 /
$ cd ~/.julia/registries/General/
ejfie@DESKTOP-12KR94V MINGW64 ~/.julia/registries/General (master)
$ git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
In Julia though:
julia> using LibGit2
julia> repo = GitRepo("C:\\Users\\ejfie\\.julia\\registries\\General\\")
ERROR: GitError(Code:ENOTFOUND, Class:Config, config value 'safe.directory' was not found)
Stacktrace:
[1] macro expansion
@ C:\Users\ejfie\AppData\Local\Programs\Julia-1.9.0-rc2\share\julia\stdlib\v1.9\LibGit2\src\error.jl:111 [inlined]
[2] GitRepo(path::String)
@ LibGit2 C:\Users\ejfie\AppData\Local\Programs\Julia-1.9.0-rc2\share\julia\stdlib\v1.9\LibGit2\src\repository.jl:11
[3] top-level scope
@ REPL[2]:1
I am also having this issue sometimes when using 1.9 rc2. I think it's only happened when adding packages on my local drive, using admin privileges didn't fix it for me. The registries folder only contains a General.toml and General.tar.gz, there is no General folder. I have no issues on 1.8.5.
I fixed the problem by running git config --global --add safe.directory [PATH TO YOUR REPO]
Have the same problem with 1.9.0 release. git config
did not fix the issue, unless I specified the wrong path (pointed it to the julia-1.9.0 folder). Works if I use admin cmd.
I also see this when I start my terminal without admin rights, weirdly enough I've been running 1.9 since the first beta and did not see this before. In contrast to the OP above I also can update non-default environments, and only see this error when in the default environment.
Have the same problem with 1.9.0 release.
git config
did not fix the issue, unless I specified the wrong path (pointed it to the julia-1.9.0 folder). Works if I use admin cmd.
I assume you indeed specified the wrong path: the problem was fixed after running git config --global --add safe.directory C:\Users\<my username>\.julia\registries\General
(that's the location of the problematic git repo).
git config --global --add safe.directory "*"
should work on the next release of julia if https://github.com/JuliaLang/julia/commit/6905c8ebf1f1d20f281cb9a434f4d4996adf4236 is in that branch, not sure why it wasn't included in 1.9.
As a hacky fix, I copied libgit2.dll
in julia installation/bin
from master into my 1.9 installation, it seems to work fine.
Summary
On Windows with Julia 1.9.0-rc2, adding a package to an environment (and maybe other operations that trigger git operations?) fails with the error ERROR: GitError(Code:ENOTFOUND, Class:Config, config value 'safe.directory' was not found). Running Julia with administrator privileges allows package operations to complete as expected. Prior Julia versions didn't have this problem.
Example
versioninfo
Possible duplicate
I reported this a little while ago in Pkg, but wasn't sure if there or this repo was the correct place to open an issue. Since the release is coming up and this could be breaking for some Windows users I'm reporting here too, but of course no worries if this is closed as duplicate. Thanks!