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

Pkg Fails to clone git repository on Arch related distros (Solved) #1013

Closed
xtalax opened this issue Jan 24, 2019 · 19 comments
Closed

Pkg Fails to clone git repository on Arch related distros (Solved) #1013

xtalax opened this issue Jan 24, 2019 · 19 comments

Comments

@xtalax
Copy link

xtalax commented Jan 24, 2019

I have just installed a new version of linux (Manjaro) and am trying to get julia up and running again.
When using Pkg to install, I am hit with the following error:

Cloning default registries into /home/tharsis/.julia/registries
Cloning registry General from "https://github.com/JuliaRegistries/General.git"
ERROR: LoadError: failed to clone from https://github.com/JuliaRegistries/General.git, error: GitError(Code:ERROR, Class:SSL, SSL error: 0xffff8880 - SSL - A fatal alert message was received from our peer)
Stacktrace:
 [1] pkgerror(::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Types.jl:120
 [2] #clone#2(::String, ::Base.Iterators.Pairs{Symbol,LibGit2.CachedCredentials,Tuple{Symbol},NamedTuple{(:credentials,),Tuple{LibGit2.CachedCredentials}}}, ::Function, ::String, ::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/GitTools.jl:107
 [3] #clone at ./none:0 [inlined]
 [4] (::getfield(Pkg.Types, Symbol("##51#55")))(::LibGit2.CachedCredentials) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Types.jl:937
 [5] shred!(::getfield(Pkg.Types, Symbol("##51#55")), ::LibGit2.CachedCredentials) at ./secretbuffer.jl:184
 [6] #registries#50(::Bool, ::Function) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Types.jl:933
 [7] registries at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Types.jl:917 [inlined]
 [8] #find_registered!#59(::Bool, ::Function, ::Pkg.Types.EnvCache, ::Array{String,1}, ::Array{Base.UUID,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Types.jl:999
 [9] find_registered! at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Types.jl:968 [inlined]
 [10] registry_resolve!(::Pkg.Types.EnvCache, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Types.jl:839
 [11] #add_or_develop#13(::Symbol, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:57
 [12] #add_or_develop at ./none:0 [inlined]
 [13] #add_or_develop#12 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:29 [inlined]
 [14] #add_or_develop at ./none:0 [inlined]
 [15] #add_or_develop#11 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:28 [inlined]
 [16] #add_or_develop at ./none:0 [inlined]
 [17] #add_or_develop#10 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:27 [inlined]
 [18] #add_or_develop at ./none:0 [inlined]
 [19] #add#18 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:69 [inlined]
 [20] add(::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:69
 [21] top-level scope at /home/tharsis/.atom/packages/julia-client/script/boot_repl.jl:22
 [22] include at ./boot.jl:317 [inlined]
 [23] include_relative(::Module, ::String) at ./loading.jl:1044
 [24] include(::Module, ::String) at ./sysimg.jl:29
 [25] exec_options(::Base.JLOptions) at ./client.jl:266
 [26] _start() at ./client.jl:425
in expression starting at /home/tharsis/.atom/packages/julia-client/script/boot_repl.jl:1

Julia has exited. Press Enter to start a new session.

`
Any help would be greatly appreciated, I have very much enjoyed learning and programming Julia, and am excited to get back to it :)

EDIT: I had suspected that this was an issue with registries, but I now believe it to be a problem with julia setting up the default environment on arch related distros

@xtalax xtalax changed the title Pkg Fails to clone git repository Pkg Fails to clone git repository - problem with LibGit2 and credentials Jan 24, 2019
@xtalax xtalax changed the title Pkg Fails to clone git repository - problem with LibGit2 and credentials Pkg Fails to clone git repository - problem with LibGit2 and credentials (Solved) Jan 25, 2019
@xtalax
Copy link
Author

xtalax commented Jan 25, 2019

I was able to fix the problem by creating the ~/.julia/environments/v1.0/ directory, and touching Project.toml and Manifest.toml within, and creating ~/.julia/registries/.

Does anyone know where in the source code julia attempts to create these directories?

@xtalax xtalax changed the title Pkg Fails to clone git repository - problem with LibGit2 and credentials (Solved) Pkg Fails to clone git repository on Arch related distros (Solved) Jan 25, 2019
@fredrikekre
Copy link
Member

That issue should have been fixed by JuliaLang/julia#30224 which is included in Julia 1.0.3. What Julia version are you on?

@xtalax
Copy link
Author

xtalax commented Jan 26, 2019

I was attempting to use Julia 1.1.0

@xtalax
Copy link
Author

xtalax commented Jan 31, 2019

I have since recieved the exact same error when trying to clone from a github url.

Pkg.clone("https://github.com/JuliaQuantum/QuBase.jl.git")
┌ Warning: Pkg.clone is only kept for legacy CI script reasons, please use add
└ @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:386
   Cloning git-repo https://github.com/JuliaQuantum/QuBase.jl.git
ERROR: failed to clone from https://github.com/JuliaQuantum/QuBase.jl.git, error: GitError(Code:ERROR, Class:SSL, SSL error: 0xffff8880 - SSL - A fatal alert message was received from our peer)
Stacktrace:
 [1] pkgerror(::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:120
 [2] #clone#3(::Nothing, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::String, ::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/GitTools.jl:111
 [3] clone at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/GitTools.jl:91 [inlined]
 [4] #ensure_clone#2 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/GitTools.jl:87 [inlined]
 [5] ensure_clone at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/GitTools.jl:87 [inlined]
 [6] fresh_clone(::Pkg.Types.PackageSpec) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:664
 [7] remote_dev_path!(::Pkg.Types.Context, ::Pkg.Types.PackageSpec, ::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:684
 [8] handle_repos_develop!(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}, ::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:706
 [9] #add_or_develop#15(::Symbol, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:42
 [10] #add_or_develop at ./none:0 [inlined]
 [11] #develop#21 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:60 [inlined]
 [12] develop at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:60 [inlined]
 [13] clone(::String, ::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:391
 [14] clone(::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:386
 [15] top-level scope at none:0

@00vareladavid
Copy link
Contributor

Are you using the official binaries?

@xtalax
Copy link
Author

xtalax commented Feb 3, 2019

Yes, I am using the v1.1.0 binaries downloaded from https://julialang.org/downloads/.

@StefanKarpinski
Copy link
Sponsor Member

Are you behind a firewall by any chance?

@ayush-1506
Copy link

I'm facing the same error every time I try to ]dev packagename. I'm on Julia 1.1.0. Is there an update on this?

@ElegantCreationism
Copy link

ElegantCreationism commented Aug 12, 2019

try removing the s from "https://" and use (v1.1) pkg> add http://github.com/BenLauwens/ThinkJulia.jl.git

worked for me
Screenshot 2019-08-12 at 10 30 19

@valeriupredoi
Copy link

hey guys, just had this issue and, since I am behind an odd firewall that allows me to git clone I just shoved the registry in where it's supposed to begit clone https://github.com/JuliaRegistries/General.git ~/.julia/registries/General and then voila, it updated it correctly and installed my packages 🍺

@KristofferC
Copy link
Sponsor Member

Im gonna close this since the title says solved. Feel free to open new issues.

@hsteinhaus
Copy link

hsteinhaus commented Dec 18, 2019

I am not behind an odd firewall - just an ordinary squid proxy between my network and the Internet.I run into exactly the same troubles. Manually cloning JuliaRegistries/General.git does the trick for me - all following git operations succeed using the proxy from HTTPS_PROXY env variable.

In my perception, there is clearly a bug in the code that tries to clone the General repo - please fix.

@longqian95
Copy link

I have the same issue. It seems just because of the proxy. If I use proxy, then this error will appear. Because I behind firewall, I have to close proxy first to pass the step for cloning JuliaRegistries/General.git then enable proxy again to pass other steps. Therefore I also think this is a bug and this issue is not solved.

@StefanKarpinski
Copy link
Sponsor Member

There's a known bug in libgit2 where it is sensitive to a trailing slash in the proxy prefix. What are your proxy values set to?

@longqian95
Copy link

There's a known bug in libgit2 where it is sensitive to a trailing slash in the proxy prefix. What are your proxy values set to?

Thank you so much for your kind help. This issue has annoy me many times. It is wired to append a trailing slash. But anyway it works fine now. Hope libgit2 will fix it in the next version.

@StefanKarpinski
Copy link
Sponsor Member

StefanKarpinski commented Jan 17, 2020

I believe they had a bugfix in the works. Agree that it's a very annoying bug.

@mvarela
Copy link

mvarela commented Apr 8, 2020

This seems to still be present in 1.4 (under Manjaro), I'm getting the same error. The workaround suggested does work.

@Oseenix
Copy link

Oseenix commented Jul 27, 2020

@KristofferC It has a problem when git behind a proxy. After I cancel the proxy setting in .gitconfig, it can update then. My version is 1.4.2.
When I clone through the proxy manually, I can download the resource, so the proxy works properly.

[http]
    #proxy = socks5://127.0.0.1:1086  
[https]
    #proxy = socks5://127.0.0.1:1086

@xtalax
Copy link
Author

xtalax commented Oct 19, 2021

Getting the same error when using ] dev SomePackage in julia 1.6, the environment and ~/.julia/registries already exist

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

No branches or pull requests