Cannot add Atom package to Julia

When I try Pkg.add(“Atom”) in Julia’s terminal METHADATA.jl clone is starting, but this operation is failed - connection to server not establish. While I can download this repo from GitHub via git command line or by TortoiseGIt (yes, I setup proxy tunneling, because I’m use corporative proxy), but Julia still can not do it. Any ways to installing packages? May be I can offline?

Hello Vadim,

Just to clarify, is the problem that you cannot clone METADATA.jl (during Pkg.init(), presumably)?

If you run Pkg.init() by itself, what happens?

I try Pkg.init() and its also falls too. I’m no longer in the workplace at this moment, so I can not demonstrate the error log. Just tomorrow.

So the problem is not with Atom :slight_smile: . I suspect Julia’s not picking up your git config properly (and therefore not handling the proxy stuff you mentioned). Are your proxy settings part of your global Git config?

2 Likes

Please include full error messages in order to diagnose the problem.

Yes. I can clone git repo, for example througth tortoiseGIT (I set proxy settings in .gitconfig file) and I can download and install packages for Atom (also with proxy tunelling settings in config file). But Julia cannot do this.

For Init():

julia> Pkg.init()
INFO: Initializing package repository C:\Users.….julia\v0.6
INFO: Cloning METADATA from GitHub - JuliaLang/METADATA.jl: Metadata for registered Julia packages up to Julia v0.6. No longer maintained. Please see https://github.com/JuliaRegistries/General instead.
ERROR: GitError(Code:ERROR, Class:OS, failed to send request: A connection with
the server could not be established
)
Stacktrace:
[1] macro expansion at .\libgit2\error.jl:99 [inlined]
[2] clone(::String, ::String, ::Base.LibGit2.CloneOptions) at .\libgit2\reposit
ory.jl:276
[3] #clone#100(::String, ::Bool, ::Ptr{Void}, ::Nullable{Base.LibGit2.AbstractC
redentials}, ::Function, ::String, ::String) at .\libgit2\libgit2.jl:562
[4] (::Base.LibGit2.#kw##clone)(::Array{Any,1}, ::Base.LibGit2.#clone, ::String
, ::String) at .<missing>:0
[5] (::Base.Pkg.Dir.##8#10{String,String})() at .\pkg\dir.jl:55
[6] cd(::Base.Pkg.Dir.##8#10{String,String}, ::String) at .\file.jl:59
[7] init(::String, ::String) at .\pkg\dir.jl:53
[8] init() at .\pkg\pkg.jl:85

For Update():

julia> Pkg.update()
INFO: Initializing package repository C:\Users.….julia\v0.6
INFO: Cloning METADATA from GitHub - JuliaLang/METADATA.jl: Metadata for registered Julia packages up to Julia v0.6. No longer maintained. Please see https://github.com/JuliaRegistries/General instead.
ERROR: GitError(Code:ERROR, Class:OS, failed to send request: A connection with
the server could not be established
)
Stacktrace:
[1] macro expansion at .\libgit2\error.jl:99 [inlined]
[2] clone(::String, ::String, ::Base.LibGit2.CloneOptions) at .\libgit2\reposit
ory.jl:276
[3] #clone#100(::String, ::Bool, ::Ptr{Void}, ::Nullable{Base.LibGit2.AbstractC
redentials}, ::Function, ::String, ::String) at .\libgit2\libgit2.jl:562
[4] (::Base.LibGit2.#kw##clone)(::Array{Any,1}, ::Base.LibGit2.#clone, ::String
, ::String) at .<missing>:0
[5] (::Base.Pkg.Dir.##8#10{String,String})() at .\pkg\dir.jl:55
[6] cd(::Base.Pkg.Dir.##8#10{String,String}, ::String) at .\file.jl:59
[7] init(::String, ::String) at .\pkg\dir.jl:53
[8] #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{Any,N} whe
re N) at .\pkg\dir.jl:28
[9] update() at .\pkg\pkg.jl:228

For Add()

julia> Pkg.add(“Atom”)
INFO: Initializing package repository C:\Users.….julia\v0.6
INFO: Cloning METADATA from GitHub - JuliaLang/METADATA.jl: Metadata for registered Julia packages up to Julia v0.6. No longer maintained. Please see https://github.com/JuliaRegistries/General instead.
ERROR: GitError(Code:ERROR, Class:OS, failed to send request: A connection with
the server could not be established
)
Stacktrace:
[1] macro expansion at .\libgit2\error.jl:99 [inlined]
[2] clone(::String, ::String, ::Base.LibGit2.CloneOptions) at .\libgit2\reposit
ory.jl:276
[3] #clone#100(::String, ::Bool, ::Ptr{Void}, ::Nullable{Base.LibGit2.AbstractC
redentials}, ::Function, ::String, ::String) at .\libgit2\libgit2.jl:562
[4] (::Base.LibGit2.#kw##clone)(::Array{Any,1}, ::Base.LibGit2.#clone, ::String
, ::String) at .<missing>:0
[5] (::Base.Pkg.Dir.##8#10{String,String})() at .\pkg\dir.jl:55
[6] cd(::Base.Pkg.Dir.##8#10{String,String}, ::String) at .\file.jl:59
[7] init(::String, ::String) at .\pkg\dir.jl:53
[8] #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{Any,N} whe
re N) at .\pkg\dir.jl:28
[9] add(::String) at .\pkg\pkg.jl:117

I’m use foolow settings for .gitconfig:

[http]
sslVerify = false
proxy = http://username:pasword@proxy.company.com:8080
[https]
proxy = http://username:pasword@proxy.company.com:8080
[url “https://github.com/”]
insteadOf = git://github.com/

Thanks so much for posting the detailed logs. This must be super frustrating, so thanks as well for your patience.

This .gitconfig is your global one, right? (Or is it in the Julia .git directory?) Could you try something like

julia> LibGit2.GitConfig(path_to_the_config)

julia> Pkg.init()

And see if that helps? @omus might be more use than I am, here.

1 Like

I’m facing the same issue here with Windows 7. On a fresh install of Julia 0.6.2, I tried to add the first package:

Main> Pkg.add("Plots")
INFO: Initializing package repository C:\Users\tkwong\.julia\v0.6
INFO: Cloning METADATA from https://github.com/JuliaLang/METADATA.jl
ERROR: GitError(Code:ERROR, Class:OS, failed to send request: A connection with the server could not be established
)
Stacktrace:
 [1] macro expansion at .\libgit2\error.jl:99 [inlined]
 [2] clone(::String, ::String, ::Base.LibGit2.CloneOptions) at .\libgit2\repository.jl:276
 [3] #clone#100(::String, ::Bool, ::Ptr{Void}, ::Nullable{Base.LibGit2.AbstractCredentials}, ::Function, ::String, ::String) at .\libgit2\libgit2.jl:562
 [4] (::Base.LibGit2.#kw##clone)(::Array{Any,1}, ::Base.LibGit2.#clone, ::String, ::String) at .\<missing>:0
 [5] (::Base.Pkg.Dir.##8#10{String,String})() at .\pkg\dir.jl:55
 [6] cd(::Base.Pkg.Dir.##8#10{String,String}, ::String) at .\file.jl:59
 [7] init(::String, ::String) at .\pkg\dir.jl:53
 [8] #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{String,N} where N) at .\pkg\dir.jl:28
 [9] add(::String) at .\pkg\pkg.jl:117
 [10] eval(::Module, ::Any) at .\boot.jl:235

Interestingly, if I clone the repo from command prompt, it works just fine:

C:\Users\tkwong\.julia\v0.6>git clone https://github.com/JuliaLang/METADATA.jl.git METADATA
Cloning into 'METADATA'...
remote: Counting objects: 131740, done.
remote: Compressing objects: 100% (39/39), done.
remote: Total 131740 (delta 14), reused 55 (delta 13), pack-reused 131681
Receiving objects: 100% (131740/131740), 23.02 MiB | 7.21 MiB/s, done.
Resolving deltas: 100% (27909/27909), done.
Checking out files: 100% (31833/31833), done.

I was going to blame the firewall but since it works in command prompt I’m quite confused at the moment… What could be the problem?