# Pkg.update error, Base.LibGit2 test fails

**URL:** <https://discourse.julialang.org/t/pkg-update-error-base-libgit2-test-fails/9272>\
**Category:** General Usage\
**Tags:** question\
**Created:** [February 23, 2018, 2:12am UTC](https://discourse.julialang.org/t/pkg-update-error-base-libgit2-test-fails/9272 "2018-02-23T02:12:26Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhangliye](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zhangliye/32/3208_2.png) [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Post date:** [February 23, 2018, 2:12am UTC](https://discourse.julialang.org/t/pkg-update-error-base-libgit2-test-fails/9272/1 "2018-02-23T02:12:26Z")

</div>

I got the following error when I tried to update the packages. I use Pkg.checkout(“CSV”) to get the latest version of CSV.jl. Today, I called Pkg.free(“CSV”). After doing this, I cannot update the packages. (Window 7, pro, 64bit, Julia0.6.2)

```julia
Pkg.update()

```

 ![%E6%8D%95%E8%8E%B7](https://global.discourse-cdn.com/julialang/original/3X/c/0/c04c25d9f175f932333d5f06156dd1004fe69daf.png)

---

<div class="post-metadata">

**Author:** ![zhangliye](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zhangliye/32/3208_2.png) [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Post date:** [February 23, 2018, 4:37am UTC](https://discourse.julialang.org/t/pkg-update-error-base-libgit2-test-fails/9272/2 "2018-02-23T04:37:15Z")

</div>

The test of Base “libgit2” fails as follows. This error cannot be solved by reinstall Julia.

```julia
Base.runtests("libgit2")

```

The error is as following.

```julia
Test (Worker) | Time (s) | GC (s) | GC % | Alloc (MB) | RSS (MB)
files: Test Failed
  Expression: readstring(joinpath(test_repo, test_file)) == readstring(joinpath(
cache_repo, test_file))
   Evaluated: "SDO3sgZVZl\r\nqTmceWjX8C\r\nxVBnedPiS4\r\nzzzz\r\n" == "SDO3sgZVZ
l\nqTmceWjX8C\nxVBnedPiS4\nzzzz\n"
Stacktrace:
 [1] macro expansion at E:\Julia-0.6.2\share\julia\test\libgit2.jl:942 [inlined]

 [2] macro expansion at .\test.jl:860 [inlined]
 [3] macro expansion at E:\Julia-0.6.2\share\julia\test\libgit2.jl:941 [inlined]

 [4] macro expansion at .\test.jl:860 [inlined]
 [5] (::Test67Main_libgit2.##7#56)(::String) at E:\Julia-0.6.2\share\julia\test\
libgit2.jl:940
Worker 1 failed running test libgit2:
Some tests did not pass: 372 passed, 1 failed, 0 errored, 0 broken.libgit2: Test
 Failed
  Expression: readstring(joinpath(test_repo, test_file)) == readstring(joinpath(
cache_repo, test_file))
   Evaluated: "SDO3sgZVZl\r\nqTmceWjX8C\r\nxVBnedPiS4\r\nzzzz\r\n" == "SDO3sgZVZ
l\nqTmceWjX8C\nxVBnedPiS4\nzzzz\n"
Stacktrace:
 [1] record(::Base.Test.DefaultTestSet, ::Base.Test.Fail) at .\test.jl:568
 [2] (::##40#46)() at E:\Julia-0.6.2\share\julia\test\runtests.jl:160
 [3] cd(::##40#46, ::String) at .\file.jl:59
 [4] include_from_node1(::String) at .\loading.jl:576
 [5] include(::String) at .\sysimg.jl:14
 [6] process_options(::Base.JLOptions) at .\client.jl:305
 [7] _start() at .\client.jl:371

Test Summary: | Pass Fail Total
  Overall | 372 1 373
    libgit2 | 372 1 373
    FAILURE
Error in testset libgit2:
Test Failed
  Expression: readstring(joinpath(test_repo, test_file)) == readstring(joinpath(
cache_repo, test_file))
   Evaluated: "SDO3sgZVZl\r\nqTmceWjX8C\r\nxVBnedPiS4\r\nzzzz\r\n" == "SDO3sgZVZ
l\nqTmceWjX8C\nxVBnedPiS4\nzzzz\n"
ERROR: LoadError: Test run finished with errors
while loading E:\Julia-0.6.2\share\julia\test\runtests.jl, in expression startin
g on line 29
ERROR: A test has failed. Please submit a bug report (https://github.com/JuliaLa
ng/julia/issues)
including error messages above and the output of versioninfo():
Julia Version 0.6.2
Commit d386e40c17* (2017-12-13 18:08 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, ivybridge)

Stacktrace:
 [1] runtests(::String, ::Int64) at .\interactiveutil.jl:691
 [2] runtests(::String) at .\interactiveutil.jl:680

```

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [February 23, 2018, 7:35am UTC](https://discourse.julialang.org/t/pkg-update-error-base-libgit2-test-fails/9272/3 "2018-02-23T07:35:32Z")

</div>

Please don’t use screenshots, they are difficult to read and copy. Use [backticks](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530).

This may be related to [this issue](https://github.com/JuliaLang/julia/issues/13399). I would first try git from the command line and approve if it prompts for certificate validity.

---

<div class="post-metadata">

**Author:** ![zhangliye](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zhangliye/32/3208_2.png) [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Post date:** [February 23, 2018, 7:42am UTC](https://discourse.julialang.org/t/pkg-update-error-base-libgit2-test-fails/9272/4 "2018-02-23T07:42:51Z")

</div>

Thank you for advice. I have tried to find the answer on the website, but still cannot solve it.

---

<div class="post-metadata">

**Author:** ![zhangliye](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zhangliye/32/3208_2.png) [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Post date:** [February 23, 2018, 7:53am UTC](https://discourse.julialang.org/t/pkg-update-error-base-libgit2-test-fails/9272/5 "2018-02-23T07:53:02Z")

</div>

Thanks, @Tamas_Papp, It should be a new error. Other people also report this issue ([Issue: 26167](https://github.com/JuliaLang/julia/issues/26167)). Pkg works yesterday, just have the problem today. Maybe, It is related to the setting of the server holding the packages.

---

<div class="post-metadata">

**Author:** ![zhangliye](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zhangliye/32/3208_2.png) [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Post date:** [February 23, 2018, 8:07am UTC](https://discourse.julialang.org/t/pkg-update-error-base-libgit2-test-fails/9272/6 "2018-02-23T08:07:10Z")

</div>

I reinstalled Julia0.6.2. When I run `Pkg.init()` in the new installed Julia, I got the similar error as follows.

```julia
julia> Pkg.init()
INFO: Initializing package repository E:\package\v0.6
INFO: Cloning METADATA from https://github.com/JuliaLang/METADATA.jl
ERROR: GitError(Code:ECERTIFICATE, Class:OS, user cancelled certificate check: )

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

```

---

<div class="post-metadata">

**Author:** ![avik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/avik/32/17_2.png) [@avik](https://discourse.julialang.org/u/avik)\
**Post date:** [February 23, 2018, 9:17am UTC](https://discourse.julialang.org/t/pkg-update-error-base-libgit2-test-fails/9272/7 "2018-02-23T09:17:31Z")

</div>

Github dropped support for old cipher suits last night. Apparently our windows MbedTLS builds ask for old versions. Julia on Linux works for 0.6, but fails on 0.5.

> **[Weak cryptographic standards removal notice](https://githubengineering.com/crypto-removal-notice/)**
>
> Last year we announced the deprecation of several weak cryptographic standards. Then we provided a status update toward the end of last year outlining some changes we’d made to make the transition easier for clients. We quickly approached the...

This does look like a critical issue (at least on windows – 0.5 is really really unsupported at this time for linux), and hopefully we’ll come up with a workaround as the day goes by.

---

<div class="post-metadata">

**Author:** ![zhangliye](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zhangliye/32/3208_2.png) [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Post date:** [February 23, 2018, 10:04am UTC](https://discourse.julialang.org/t/pkg-update-error-base-libgit2-test-fails/9272/8 "2018-02-23T10:04:14Z")

</div>

@avik Thanks for your explanation! Are there other ways to install the package of Julia? After I reinstalled Julia, I cannot install any package. I changed most of my data processing for the work to Julia now. Currently, I cannot do the work.

---

<div class="post-metadata">

**Author:** ![avik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/avik/32/17_2.png) [@avik](https://discourse.julialang.org/u/avik)\
**Post date:** [February 23, 2018, 10:39am UTC](https://discourse.julialang.org/t/pkg-update-error-base-libgit2-test-fails/9272/9 "2018-02-23T10:39:47Z")

</div>

Sorry, only thing I can say right now is use Linux or Mac :(. Rest assured many people are looking at this now, as they wake up. Hopefully will have an update soon.

---

<div class="post-metadata">

**Author:** ![zhangliye](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zhangliye/32/3208_2.png) [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Post date:** [February 23, 2018, 10:44am UTC](https://discourse.julialang.org/t/pkg-update-error-base-libgit2-test-fails/9272/10 "2018-02-23T10:44:23Z")

</div>

@avik Really thanks for your help! I can change to Linux for the work. I spent the whole afternoon on this 😅.

---

<div class="post-metadata">

**Author:** ![avik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/avik/32/17_2.png) [@avik](https://discourse.julialang.org/u/avik)\
**Post date:** [February 23, 2018, 11:21am UTC](https://discourse.julialang.org/t/pkg-update-error-base-libgit2-test-fails/9272/11 "2018-02-23T11:21:45Z")

</div>

So @staticfloat found this Windows registry setting that enables TLSv1.1, since on Windows LibGit2 uses WinHTTP as the default provider. We’ve verified that this does seem to work.

> **[Update to enable TLS 1.1 and TLS 1.2 as default secure protocols in WinHTTP...](https://support.microsoft.com/en-us/topic/update-to-enable-tls-1-1-and-tls-1-2-as-default-secure-protocols-in-winhttp-in-windows-c4bd73d2-31d7-761e-0178-11268bb10392)**
>
> Describes an update that adds TLS 1.1 and TLS 1.2 to default security protocols in Windows Server 2012, Windows 7 SP1, and Windows Server 2008 R2 SP1.

Run the easy-fix tool that is available on that page (or make the registry entries manually)

Thanks to Elliot.

Regards

Avik

---

<div class="post-metadata">

**Author:** ![zhangliye](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zhangliye/32/3208_2.png) [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Post date:** [February 23, 2018, 2:07pm UTC](https://discourse.julialang.org/t/pkg-update-error-base-libgit2-test-fails/9272/12 "2018-02-23T14:07:47Z")

</div>

@avik Thank you so much! It works well.

---

<div class="post-metadata">

**Author:** ![NaOH](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/naoh/32/5632_2.png) [@NaOH](https://discourse.julialang.org/u/NaOH)\
**Post date:** [February 23, 2018, 3:29pm UTC](https://discourse.julialang.org/t/pkg-update-error-base-libgit2-test-fails/9272/13 "2018-02-23T15:29:09Z")

</div>

Related:

- [Julia git error - Stack Overflow](https://stackoverflow.com/questions/48950748/julia-git-error/48951179#48951179)
