Pkg.jl: Pkg Fails to clone git repository on Arch related distros (Solved)

Created on 24 Jan 2019  Â·  18Comments  Â·  Source: JuliaLang/Pkg.jl

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

Most helpful comment

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

All 18 comments

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?

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

I was attempting to use Julia 1.1.0

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

Are you using the official binaries?

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

Are you behind a firewall by any chance?

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?

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

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 :beer:

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

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.

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.

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?

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.

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

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

@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
Was this page helpful?
0 / 5 - 0 ratings

Related issues

jebej picture jebej  Â·  3Comments

oxinabox picture oxinabox  Â·  3Comments

KristofferC picture KristofferC  Â·  4Comments

GregPlowman picture GregPlowman  Â·  3Comments

jlperla picture jlperla  Â·  3Comments