-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
LibGit2 can not clone or fetch on Julia 1.3/master #33111
Comments
Works for me on a mac. |
Ok, I'm on Linux. Reverting #32806 fixes this issue for me. |
Reproducer without any Pkg code:
|
Possibly unrelated: I saw the same error on Julia 1.0.4 today on macOS. I fixed it by going to the registry in my terminal and running |
That did not fix it for me. Also, I tried from a different machine but could not reproduce. Any ideas on how to debug? |
Cloning from scratch also fails, with the same error message about |
This also happens with the generic binaries btw. |
Possible future way to debug this is to reduce it to just ccalls and then look into libgit2 where the error is generated. |
import LibGit2
const repo_url = "https://github.com/JuliaRegistries/General.git"
const repo_path = "/tmp/General"
const credentials = nothing
const callbacks = LibGit2.Callbacks()
const cred_payload = LibGit2.reset!(LibGit2.CredentialPayload(credentials))
callbacks[:credentials] = (LibGit2.credentials_cb(), cred_payload)
const lbranch = Base.cconvert(Cstring, "")
const remote_callbacks = LibGit2.RemoteCallbacks(callbacks)
const fetch_opts = LibGit2.FetchOptions(callbacks=remote_callbacks)
const clone_opts = LibGit2.CloneOptions(
bare = Cint(false),
checkout_branch = Cstring(C_NULL),
fetch_opts = fetch_opts,
remote_cb = C_NULL
)
LibGit2.ensure_initialized()
const clone_opts_ref = Ref(clone_opts)
const repo_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL)
ccall((:git_clone, :libgit2), Cint,
(Ptr{Ptr{Cvoid}}, Cstring, Cstring, Ref{LibGit2.CloneOptions}),
repo_ptr_ptr, repo_url, repo_path, clone_opts_ref) returns |
FWIW both examples work here on latest master. Can anybody else reproduce? |
@fredrikekre can you post your git config? |
Interesting, I reduced the
I am not sure why it is there, I don't think I have added it myself. Seems like [email protected] fails for this, while [email protected] handles it (as does regular git) |
Maybe related to this point from libgit2 0.28 release notes:
|
Maybe file an issue against libgit2? You can also tried reverting the changes I made to gitcredential.jl in #32806, just in case (they are required for some specific tests, but not for most operations). |
See libgit2/libgit2#5220. |
Removing from milestone since it is kinda weird to have an empty |
I can reproduce something similar, but the snippet you sent above returns |
This issue also appeared for me with |
Thanks for the suggestion @tkluck - unfortunately unsetting http_proxy and http_proxy doesn't make a difference more me - still getting |
I had this issue just now and would like to report the test results with three fresh-built Julia binaries in release-1.0, release-1.3, and master branches. (I was not able to test release-1.2 due to build errors.) All three tests were conducted with empty release-1.0 (no error):
release-1.3 (error):
master (error):
Hope this issue to be resolved soon! |
Is your |
Please report to the libgit2 repo instead (unless it is a duplicate of libgit2/libgit2#5220, in which you can maybe bump that issue.) |
This workaround doesn't work unfortunately, I am using julia 1.4. |
@getzze How are you invoking julia? Maybe you forgot to The workaround works on Arch Linux using Julia 1.4.0: [tamer@zinc ~]$ pacman -Q libgit2 julia
libgit2 1:0.99.0-2
julia 2:1.4.0-1
[tamer@zinc ~]$ rm -r ~/.julia/registries/General/ [tamer@zinc ~]$ julia -e 'using Pkg; Pkg.update()'
Cloning default registries into `~/.julia`
Cloning registry from "https://github.com/JuliaRegistries/General.git"
ERROR: failed to clone from https://github.com/JuliaRegistries/General.git, error: GitError(Code:ERROR, Class:Invalid, invalid version 0 on git_proxy_options)
Stacktrace:
[1] up(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}; level::Pkg.Types.UpgradeLevel, mode::Pkg.Types.PackageMode, update_registry::Bool, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:206
[2] up at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:201 [inlined]
[3] #up#47 at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:196 [inlined]
[4] up at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:196 [inlined]
[5] #up#44 at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:193 [inlined]
[6] up() at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:193
[7] top-level scope at none:1
caused by [exception 1]
GitError(Code:ERROR, Class:Invalid, invalid version 0 on git_proxy_options)
Stacktrace:
[1] up(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}; level::Pkg.Types.UpgradeLevel, mode::Pkg.Types.PackageMode, update_registry::Bool, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:206
[2] up at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:201 [inlined]
[3] #up#47 at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:196 [inlined]
[4] up at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:196 [inlined]
[5] #up#44 at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:193 [inlined]
[6] up() at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:193
[7] top-level scope at none:1 [tamer@zinc ~]$ JULIA_PKG_SERVER=pkg.julialang.org julia -e 'using Pkg; Pkg.update()'
Cloning default registries into `~/.julia`
######################################################################## 100.0%
Added registry `General` to `~/.julia/registries/General`
Updating registry at `~/.julia/registries/General`
Updating `~/.julia/environments/v1.4/Project.toml`
[no changes]
Updating `~/.julia/environments/v1.4/Manifest.toml`
[no changes] |
If you already have the registry as a git clone it will keep using it as a git clone instead of using the Pkg server, thats why you have to delete it. |
Thanks, I didn't get that you have to remove the registries before. |
Running Julia 1.4.0. Not using any proxy. Windows 10 @tuhtah solution works though |
Hi, I am on manjaro Linux. In my case, this helped
Then in julia
|
There is no need to delete any folder. With...
I get
I originally applied @gwatcha workaround, however using
Does the same job. When I went back to julia and tried to upgrade the packages... they did upgrade:
All this because I couldn't get Plots 1.0 from Edit: apparently it is now in |
git issue same here
env: Arch, julia1.4.0, libgit2 1.0.0 |
If you're on Julia 1.4, you can do |
That issue should be reported to Arch, they need a patch like #35233 if they use libgit2 1.0. |
For the record, I got hit by this again trying Julia 1.5 for the first time at work again, trailing slash needed on the proxy in |
Someone who cares about this is going to have to harass the libgit2 project and make sure they actually make a release that includes a bug fix for this. Clearly waiting for them to fix it on their own isn't working out. |
For me, this error happend because I'm using a socks5 proxy(.gitconfig, and git clone mannully works with socks5 proxy). Change to http proxy fixed it. |
Jan 21
Aug 21
So go with the former? (patch libgit2) You might even be able to contribute the patch to them. Asking users to file issues/deal with upstream libraries is a little unfair, IMO (its the users who will care in the end, after all) |
Fair or not, I don't encounter this issue and I don't feel like mucking about in libgit2 to fix this. If you want to pay for someone to work on this, contact [email protected] and we can figure out a consulting contract. You can also purchase JuliaTeam and then you won't have this issue because you can connect to a package server that's inside of your firewall, so you don't need to go through a proxy at all (there are lots of other nice benefits too). At the very least, you could make some noise on libgit2/libgit2#5220 instead of here. @fredrikekre is literally the only person who has posted there. Instead everyone bugs us and I guess expects us to harass the the libgit2 developers for them? If everyone who has posted here also posted a complaint on the libgit2 repo they might have fixed it by now. |
I have now pinged everyone who has posted here and in related issues where this libgit2 bug was the underlying cause of their problem on the relevant libgit2 issue. Please chime in there with your bug reports regarding this. |
Maybe #35233 would help? I haven't looked into the patch notes. |
Can this change in Julia 1.7 be used as a workaround?
https://github.com/JuliaLang/julia/blob/v1.7.0-rc2/NEWS.md#package-manager |
I discovered that the |
Opening this issue here since I am pretty sure Pkg has not changed anything, maybe this is related to the libgit2 upgrade (#32806)?
The text was updated successfully, but these errors were encountered: