Cannot add packages (maybe due to corporate firewall?)

I have successfully built Julia 1.2 on my work computer (macOS 10.14.2 Mojave), but cannot add packages. These are the messages I get:

julia> VERSION
v"1.2.0-DEV.93"

(v1.2) pkg> add BenchmarkTools
   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:OS, failed to connect to github.com: Operation timed out)

I thought this might be due to the corporate firewall, so I tried the trick described in https://github.com/JuliaLang/julia/issues/20948#issuecomment-287306113 to add the proxy settings to ~/.gitconfig. I also tried to let Git to use https instead of git by following https://github.com/JuliaLang/julia#source-download-and-compilation. Still unsuccessful.

Any suggestions?

1 Like

I use win 10 and have a workaround to install packages.
For this you should to be able to reset IE settings in internet options- Advanced tab. If this is possible, reset the setting and after that you can connect to the any wifi network and install packages.

To come back to corporate network, restart you computer or just log off and log in and it should work.

My corporate admin blocked this. R can install flawless from behind firewalls most of the time so maybe also need to look at their approach. Unfortunate, I have 0 knowledge of networking so have gave up installing Julia at work…

More information about the problem. According to my original posting, it seemed that cloning the registry from GitHub - JuliaRegistries/General: The official registry of general Julia packages was taking forever. So, I tried to add BenchmarkTools by directly specifying its repository address. Then I get the following message:

(v1.2) pkg> add https://github.com/JuliaCI/BenchmarkTools.jl.git
   Cloning git-repo `https://github.com/JuliaCI/BenchmarkTools.jl.git`
ERROR: failed to clone from https://github.com/JuliaCI/BenchmarkTools.jl.git, error: GitError(Code:ERROR, Class:OS, failed to connect to github.com: Operation timed out)

Again, cloning the Git repository for BenchmarkTools takes forever. This is strange, though, because in the terminal I can git clone https://github.com/JuliaCI/BenchmarkTools.jl with no problem:

$ git clone https://github.com/JuliaCI/BenchmarkTools.jl
Cloning into 'BenchmarkTools.jl'...
remote: Enumerating objects: 1230, done.
remote: Total 1230 (delta 0), reused 0 (delta 0), pack-reused 1230
Receiving objects: 100% (1230/1230), 310.90 KiB | 1.16 MiB/s, done.
Resolving deltas: 100% (815/815), done.

So, it seems that the proxy settings are actually working for Git; it is just that Julia does not recognize these settings for some reason. This is weird, because ENV["http_proxy"]and ENV["https_proxy"] in the Julia REPL show the correct proxy information specified in my .bashrc.

To further verify my theory that the proxy settings for Git are correct but Julia does not recognize them properly, I tried to remove the proxy information in .bashrc by commenting the export http_proxy=... and export https_proxy=... lines. Then, I was no longer able to git clone in the terminal. Here is the result of the same command as above:

$ git clone https://github.com/JuliaCI/BenchmarkTools.jl
Cloning into 'BenchmarkTools.jl'...
fatal: unable to access 'https://github.com/JuliaCI/BenchmarkTools.jl/': Failed to connect to github.com port 443: Operation timed out

As you can see, the error message is nearly the same as the one I got from pkg> add https://github.com/JuliaCI/BenchmarkTools.jl.git in the Julia REPL. This means Julia was indeed complaining that it could not see the proxy settings (even though they were set in .bashrc).

Any suggestions?

1 Like

Thanks for the investigation. This is awesome. I also tried to capitalise to HTTP(S)_PROXY but it also didn’t work. And I can confirm that I can clone using Git as well.

I just reported this issue at Update problems with corporate proxy with user and pass · Issue #20948 · JuliaLang/julia · GitHub.

Separate issue filed: https://github.com/JuliaLang/julia/issues/30635.

1 Like