Errors for Git / Pkg


#1

There have been various reports of issues running package operations recently. The are manifest as one of the following messages on running any package operations, such as Pkg.init or Pkg.add:

ERROR: GitError(Code:ERROR, Class:Net, SSL error: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version)

or

ERROR: GitError(Code:ECERTIFICATE, Class:OS, user cancelled certificate check: ) 

This is happening because GitHub stopped supporting TLS 1.0 in February:

The error occurs in Julia v0.5 on Linux and Julia v0.5 and v0.6 on Windows 7 and Windows Server 2012. MacOS systems are unaffected.

For Windows, the fix is to apply all reccomneded OS updates, and then apply the easy_fix executable from this URL:

https://support.microsoft.com/en-us/help/3140245/update-to-enable-tls-1-1-and-tls-1-2-as-a-default-secure-protocols-in

For Linux 0.5, we announced dropping support some time ago, and thus there is no workaround. The only solution would have been to rebuild Julia with a newer OpenSSL. We recommend stopping support for 0.5 in your packages – Travis tests will no longer run on v0.5. Julia v0.6 is unaffected on Linux.


Cannot install any package on JuliaPro 0.6.2.2
Pkg.update() throws an error
Pkg.update fails on windows 7 with private repository
I cannot install NLopt
Pkg instantiate fails
Uses of packages: JuliaDB, ExcelReaders, ExcelFiles and SymPy
Pkg.update() fails
#2

#3

Im getting this with OSX

julia> Pkg.update()
INFO: Updating METADATA...
ERROR: METADATA cannot be updated. Resolve problems manually in /Users/amrods/.julia/v0.6/METADATA.
GitError(Code:ERROR, Class:OS, Failed to create locked file '/Users/amrods/.julia/v0.6/METADATA/.git/objects/pack/pack_git2_Jkidx.lock': Too many open files)
macro expansion at ./libgit2/error.jl:99 [inlined]
#fetch#41(::Base.LibGit2.FetchOptions, ::String, ::Function, ::Base.LibGit2.GitRemote, ::Array{AbstractString,1}) at ./libgit2/remote.jl:226
(::Base.LibGit2.#kw##fetch)(::Array{Any,1}, ::Base.LibGit2.#fetch, ::Base.LibGit2.GitRemote, ::Array{AbstractString,1}) at ./<missing>:0
#fetch#84(::String, ::String, ::Array{AbstractString,1}, ::Nullable{Base.LibGit2.AbstractCredentials}, ::Function, ::Base.LibGit2.GitRepo) at ./libgit2/libgit2.jl:312
(::Base.Pkg.Entry.##33#39)(::Base.LibGit2.GitRepo) at ./pkg/entry.jl:371
with(::Base.Pkg.Entry.##33#39, ::Base.LibGit2.GitRepo) at ./libgit2/types.jl:608
update(::String, ::Set{String}) at ./pkg/entry.jl:354
(::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}})() at ./pkg/dir.jl:36
cd(::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}}, ::String) at ./file.jl:70
#cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{Any,N} where N) at ./pkg/dir.jl:36
update() at ./pkg/pkg.jl:228
eval(::Module, ::Any) at /Applications/Julia-0.6.app/Contents/Resources/julia/lib/julia/sys.dylib:?
eval_user_input(::Any, ::Base.REPL.REPLBackend) at /Applications/Julia-0.6.app/Contents/Resources/julia/lib/julia/sys.dylib:?
macro expansion at ./REPL.jl:97 [inlined]
(::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:73
Stacktrace:
 [1] (::Base.Pkg.Entry.##33#39)(::Base.LibGit2.GitRepo) at ./pkg/entry.jl:378
 [2] with(::Base.Pkg.Entry.##33#39, ::Base.LibGit2.GitRepo) at ./libgit2/types.jl:608
 [3] update(::String, ::Set{String}) at ./pkg/entry.jl:354
 [4] (::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}})() at ./pkg/dir.jl:36
 [5] cd(::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}}, ::String) at ./file.jl:70
 [6] #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{Any,N} where N) at ./pkg/dir.jl:36
 [7] update() at ./pkg/pkg.jl:228

Is it related?


#4

This looks to me like a different issue. The clue is Too many open files, a quick search gets this https://stackoverflow.com/questions/10095796/os-x-terminal-ssh-and-too-many-open-files.


#5

I started getting this error around the same time
in master branch
running in Cygwin under Windows 7 in Parallels on macOS

Any suggestions how to resolve?

JOSEFSACHS7548$ usr/bin/julia.exe
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.7.0-DEV.4399 (2018-02-27 04:42 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit 00c82f034d (0 days old master)
|__/                   |  x86_64-w64-mingw32

julia> Pkg.status()
WARNING: Base.Pkg is deprecated, run `using Pkg` instead
 in module Main
[ Info: Initializing package repository C:\Users\sachs\.julia\v0.7
[ Info: Cloning METADATA from https://github.com/JuliaLang/METADATA.jl
ERROR: GitError(Code:ECERTIFICATE, Class:Net, unknown certificate check failure)
Stacktrace:
 [1] macro expansion at C:\cygwin64\home\sachs\src\julia-master\usr\share\julia\site\v0.7\LibGit2\src\error.jl:98 [inlined]
 [2] clone(::String, ::String, ::LibGit2.CloneOptions) at C:\cygwin64\home\sachs\src\julia-master\usr\share\julia\site\v0.7\LibGit2\src\repository.jl:423
 [3] macro expansion at C:\cygwin64\home\sachs\src\julia-master\usr\share\julia\site\v0.7\LibGit2\src\LibGit2.jl:541 [inlined]
 [4] macro expansion at .\gcutils.jl:82 [inlined]
 [5] #clone#136(::String, ::Bool, ::Ptr{Nothing}, ::LibGit2.CredentialPayload, ::Function, ::String, ::String) at C:\cygwin64\home\sachs\src\julia-master\usr\share\julia\site\v0.7\LibGit2\src\LibGit2.jl:531
 [6] (::getfield(LibGit2, Symbol("#kw##clone")))(::NamedTuple{(:branch,),Tuple{String}}, ::typeof(LibGit2.clone), ::String, ::String) at .\<missing>:0
 [7] (::getfield(Pkg.Dir, Symbol("##8#10")){String,String})() at C:\cygwin64\home\sachs\src\julia-master\usr\share\julia\site\v0.7\Pkg\src\dir.jl:55
 [8] cd(::getfield(Pkg.Dir, Symbol("##8#10")){String,String}, ::String) at .\file.jl:61
 [9] init(::String, ::String) at C:\cygwin64\home\sachs\src\julia-master\usr\share\julia\site\v0.7\Pkg\src\dir.jl:53
 [10] init at C:\cygwin64\home\sachs\src\julia-master\usr\share\julia\site\v0.7\Pkg\src\dir.jl:41 [inlined]
 [11] #cd#1(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Function, ::Base.TTY, ::Vararg{Base.TTY,N} where N) at C:\cygwin64\home\sachs\src\julia-master\usr\share\julia\site\v0.7\Pkg\src\dir.jl:28
 [12] cd at C:\cygwin64\home\sachs\src\julia-master\usr\share\julia\site\v0.7\Pkg\src\dir.jl:25 [inlined]
 [13] status(::Base.TTY) at C:\cygwin64\home\sachs\src\julia-master\usr\share\julia\site\v0.7\Pkg\src\Pkg.jl:154 (repeats 2 times)
 [14] top-level scope

#6

Does the “quick-fix” linked in the first post not work?


#7

On a Windows 7 machine with update KB3140245 easy_fix and after rebooting, I still see

julia> Pkg.update()
INFO: Updating METADATA...
ERROR: METADATA cannot be updated. Resolve problems manually in C:\Users\michele.zaffalon\.julia\v0.6\M
GitError(Code:ECERTIFICATE, Class:OS, user cancelled certificate check: )
macro expansion at .\libgit2\error.jl:99 [inlined]

on Julia 0.6.2.


#8

I haven’t tried running the “quick-fix”, since the registry settings that its documentation says it will set are already present in the Windows Registry. Would it be expected that those setting would affect running under Cygwin?


#9

In Microsoft’s notes on KB3140245, they state that if you have installed any language packs afterwards, you will have to reinstall the fix. There may well be other conditions that break it. In my case I had the Microsoft patch installed but was still hitting the certificate error. I ran the quick fix and everything is working again.


#10

In my case, this was the last update and it did not work.


#11

Same here: Installed that ‘fix’ but still, no package: ‘add’, ‘update’ … .
I’ve tried even to manually alter the 4 registry values as described in the Microsoft-Docs for that TLS Issue, nothing.
Current Setting that don’t work:
1.) HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings
-> SecureProtocols: 0x00000a80
2.) HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
-> SecureProtocols: 0x00000a80
3.) HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp
-> DefaultSecureProtocols: 0x00000a00
4.) HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp --> DefaultSecureProtocols: 0x00000a00
So i did this in JULIA:

julia> Pkg.update("Primes")
_INFO: Updating METADATA..._
_ERROR: METADATA cannot be updated. Resolve problems manually in C:\Users\ulti\.julia\v0.6\_
_METADATA._
_GitError(Code:ECERTIFICATE, Class:OS, user cancelled certificate check: )_
**My System:** Win 7 Pro, SP1, + manually Installed SP2 (KB3125574)

#12

I don’t know what I did exactly the first time, but when I tried the second time and clicked on the “Easy fix” link under Registry information, it worked.


#13

I’ve used the ‘Easy Fix’ 4 or 5 times in the last couple of Days. Reboot, check, still get this Error.
The strange thing is: the different threads about this certificate-error seems to be not effecting Win 8 & Win 10 Systems, only Win 7 64Bit.
Related Stackoverflow: https://stackoverflow.com/questions/48950748/julia-git-error
Github: https://github.com/JuliaLang/julia/issues/26167
I have even tried the other hexa codes for a mixed TLS-Standard:
1.: 0x00000200
2.: 0x00000800
3: 0x00000A00
Not matter what i set for this Key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings
it resets to 0x00000a80 after a Reboot, while the other 3 Keys stay the way i set them.


#14

Finally got a fix.
The Easy fix on this page didn’t cut it. https://support.microsoft.com/en-us/help/3140245/update-to-enable-tls-1-1-and-tls-1-2-as-a-default-secure-protocols-in
The quick-fix didn’t patch the Webio.dll and the Winhttp.dll in the Windows-folders. So I went to the update-catalog and downloaded the proper file for my system: https://www.catalog.update.microsoft.com/search.aspx?q=kb3140245
Patched,restarted, works.


ERROR: GitError(Code:ERROR, Class:OS, failed to send request: A connection with the server could not be established )
#15

Is there a way to use the package manager on Windows 7 without applying the easy fix? It needs admin priviledges.


#16

Indeed I’m wondering how the people without admin rights are solving this issue


#17

Indeed, this is a very unfortunate issue for beginners, many will get this issue and stop using Julia. It is painful to install Julia and the first thing you get is an issue. Also, many of them don’t have admin rights and take time for the support to install this update. So the easy-fix is just a temporary fix, this should be fixed in new versions of Julia.