# Strange Error at Installing Packages \`git\` failed to clone

**URL:** <https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578>\
**Category:** New to Julia\
**Tags:** packages, git, installation\
**Created:** [June 25, 2021, 8:52pm UTC](https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578 "2021-06-25T20:52:18Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmcastro2109](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jmcastro2109/32/38427_2.png) [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Post date:** [June 25, 2021, 8:52pm UTC](https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578/1 "2021-06-25T20:52:19Z")

</div>

Hello,

I am trying to install some packages in Julia. In some cases I get an error and in others I do not. For examples, let’s take the packages Distributions. When I install it, I get the following error message:

```julia
(@v1.6) pkg> add Distributions
    Updating registry at `C:\Users\alfaroua\.julia\registries\General`
    Updating git-repo `https://github.com/JuliaRegistries/General.git`
   Resolving package versions...
     Cloning [4c63d2b9-4356-54db-8cca-17b64c39e42c] StatsFuns from https://github.com/JuliaStats/StatsFuns.jl.git
   Installed StatsFuns ─────────── v0.9.8
     Cloning [34da2185-b29b-5c13-b0c7-acf172513d20] Compat from https://github.com/JuliaLang/Compat.jl.git
   Installed Compat ────────────── v3.31.0
     Cloning [ffbed154-4ef7-542d-bbb7-c09d3a79fcae] DocStringExtensions from https://github.com/JuliaDocs/DocStringExtensions.jl.git
   Installed DocStringExtensions ─ v0.8.5
     Cloning [31c24e10-a181-5473-b8eb-7969acd0382f] Distributions from https://github.com/JuliaStats/Distributions.jl.git
   Installed Distributions ─────── v0.25.6
     Cloning [21216c6a-2e73-6563-6e65-726566657250] Preferences from https://github.com/JuliaPackaging/Preferences.jl.git
ERROR: failed to clone from https://github.com/JuliaPackaging/Preferences.jl.git, error: GitError(Code:ERROR, Class:OS, failed to read data: El servidor devolvió una respuesta no válida o no reconocida
)

```

I do not understand how to fix the error. Also, I do not understand why for so packages (e.g Compat) it works and for some others it does not (Preferences.jl).

It also yields an error with JLD

```julia
(@v1.6) pkg> add JLD
   Resolving package versions...
     Cloning [5ced341a-0733-55b8-9ab6-a4889d929147] Lz4_jll from https://github.com/JuliaBinaryWrappers/Lz4_jll.jl.git
ERROR: failed to clone from https://github.com/JuliaBinaryWrappers/Lz4_jll.jl.git, error: GitError(Code:ERROR, Class:OS, failed to read data: El servidor devolvió una respuesta no válida o no reconocida
)

```

But I do not get it with other packages such as Statistics, Combinatorics or LinearAlgebra. The output when I install this is

```julia
(@v1.6) pkg> add LinearAlgebra
   Resolving package versions...
    Updating `C:\Users\alfaroua\.julia\environments\v1.6\Project.toml`
  [37e2e46d] + LinearAlgebra
    Updating `C:\Users\alfaroua\.julia\environments\v1.6\Manifest.toml`
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra

(@v1.6) pkg> add Combinatorics
   Resolving package versions...
     Cloning [861a8166-3701-5b0c-9a16-15d98fcdc6aa] Combinatorics from https://github.com/JuliaMath/Combinatorics.jl.git Installed Combinatorics ─ v1.0.2
    Updating `C:\Users\XXX\.julia\environments\v1.6\Project.toml`
  [861a8166] + Combinatorics v1.0.2
    Updating `C:\Users\XXX\.julia\environments\v1.6\Manifest.toml`
  [861a8166] + Combinatorics v1.0.2
Precompiling project...
  1 dependency successfully precompiled in 2 seconds

```

Any help works because I have a whole project written in Julia and this issue with the packages has not allowed me to run my code for a week, so I am very worried.

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [June 25, 2021, 9:11pm UTC](https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578/2 "2021-06-25T21:11:48Z")

</div>

I think the examples you mention as working are in Base, meaning they are already installed. Try cloning the repo of one other package in the shell to see if that works.

---

<div class="post-metadata">

**Author:** ![jmcastro2109](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jmcastro2109/32/38427_2.png) [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Post date:** [June 25, 2021, 9:27pm UTC](https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578/3 "2021-06-25T21:27:59Z")

</div>

Thanks for the reply!

I think they were not, but correct me if I am wrong, but I ran this before adding all the packages

```julia
(@v1.6) pkg> status
      Status `C:\Users\XXX\.julia\environments\v1.6\Project.toml` (empty project)

```

---

<div class="post-metadata">

**Author:** ![jmcastro2109](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jmcastro2109/32/38427_2.png) [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Post date:** [June 25, 2021, 9:52pm UTC](https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578/4 "2021-06-25T21:52:15Z")

</div>

Still I might be wrong. I do not understand pretty well these issues. Certainly, any help works because I have a whole project written in Julia and this issue with the packages has not allowed me to run my code for a week, so I am very worried. I edited the post above with the code I get when I run the ones that work.

---

<div class="post-metadata">

**Author:** ![jmcastro2109](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jmcastro2109/32/38427_2.png) [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Post date:** [June 26, 2021, 12:33am UTC](https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578/5 "2021-06-26T00:33:27Z")

</div>

By the way, the same error happens with Conda

```julia

(@v1.6) pkg> add Conda
    Updating registry at `C:\Users\alfaroua\.julia\registries\General`
    Updating git-repo `https://github.com/JuliaRegistries/General.git`
   Resolving package versions...
     Cloning [69de0a69-1ddd-5017-9359-2bf0b02dc9f0] Parsers from https://github.com/JuliaData/Parsers.jl.git
   Installed Parsers ──────── v1.1.0
     Cloning [8f4d0f93-b110-5947-807f-2305c1781a2d] Conda from https://github.com/JuliaPy/Conda.jl.git
   Installed Conda ────────── v1.5.2
     Cloning [682c06a0-de6a-54ab-a142-c8b1cf79cde6] JSON from https://github.com/JuliaIO/JSON.jl.git
   Installed JSON ─────────── v0.21.1
     Cloning [81def892-9a0e-5fdd-b105-ffc91e053289] VersionParsing from https://github.com/JuliaInterop/VersionParsing.jl.git
ERROR: failed to clone from https://github.com/JuliaInterop/VersionParsing.jl.git, error: GitError(Code:ERROR, Class:OS, failed to read data: El servidor devolvió una respuesta no válida o no reconocida
)

```

---

<div class="post-metadata">

**Author:** ![jmcastro2109](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jmcastro2109/32/38427_2.png) [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Post date:** [June 26, 2021, 1:33am UTC](https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578/6 "2021-06-26T01:33:38Z")

</div>

@lmiq

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [June 26, 2021, 5:45am UTC](https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578/7 "2021-06-26T05:45:33Z")

</div>

Well, most of them (if not all) _are_ Base. You can for instance run `using Iterators` without adding it.

In a command line, run `git --version`. What’s the output?

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [June 26, 2021, 9:38am UTC](https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578/8 "2021-06-26T09:38:53Z")

</div>

I don’t know if that has anything to do with that, but a weird package problem I had once was solved with this:

> [@Package updated but not available (12 hours latter)](https://discourse.julialang.org/t/package-updated-but-not-available-12-hours-latter/61718/11):
>
> Your answer was no, so that clause doesn’t apply. To switch to a git provided registry, run Julia with the environment variable JULIA\_PKG\_SERVER set to "" (empty string) and do pkg\> registry rm General pkg\> registry add General

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [June 26, 2021, 10:04am UTC](https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578/9 "2021-06-26T10:04:17Z")

</div>

> [@jmcastro2109](#):
>
> But I do not get it with other packages such as Statistics, Combinatorics or LinearAlgebra.

Those packages are so called `stdlib`s, packages which are included with Julia and don’t require a download.

> [@jmcastro2109](#):
>
> I do not understand how to fix the error. Also, I do not understand why for so packages (e.g Compat) it works and for some others it does not (Preferences.jl).

I agree that there’s little obvious system to that. Are you behind a firewall that can interfere with your network traffic? Do you have antivirus software that may overreact to certain files? Does git cloning of the difficult packages work outside of Julia? E.g.

```julia
git clone https://github.com/JuliaPackaging/Preferences.jl.git

```

> [@lmiq](#):
>
> I don’t know if that has anything to do with that, but a weird package problem I had once was solved with this:

This looks unrelated since it’s git cloning that fails. Here I would rather suggest trying with the package servers, but since that’s the default and has apparently been disabled I assume that has already been tried.

---

<div class="post-metadata">

**Author:** ![jmcastro2109](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jmcastro2109/32/38427_2.png) [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Post date:** [June 26, 2021, 6:41pm UTC](https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578/10 "2021-06-26T18:41:29Z")

</div>

Thanks so much @GunnarFarneback . Yes, I think that this might be related to the firewall or some proxy settings. What is weird is that I can enter to [GitHub - JuliaPackaging/Preferences.jl: Project Preferences Package](https://github.com/JuliaPackaging/Preferences.jl.git) or to [GitHub - JuliaInterop/VersionParsing.jl: flexible VersionNumber parsing in Julia](https://github.com/JuliaInterop/VersionParsing.jl.git) through the browser, however, it does not work to download the packages through Julia.

I will try to clone things through the shell to see what I get. However, can you think of any other diagnostic or fix?

---

<div class="post-metadata">

**Author:** ![jmcastro2109](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jmcastro2109/32/38427_2.png) [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Post date:** [June 26, 2021, 6:58pm UTC](https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578/11 "2021-06-26T18:58:30Z")

</div>

```julia
C:\Users\XXX>git --version
"git" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.

```

I get this output. It basically says in Spanisg something like git is not recognized as an internal or external command, program or file

---

<div class="post-metadata">

**Author:** ![jmcastro2109](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jmcastro2109/32/38427_2.png) [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Post date:** [June 26, 2021, 7:02pm UTC](https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578/12 "2021-06-26T19:02:28Z")

</div>

Git cloning packages does not work in the cmd for example. Weird

```julia

$ git clone https://github.com/JuliaPackaging/Preferences.jl.git
Cloning into 'Preferences.jl'...
fatal: unable to access 'https://github.com/JuliaPackaging/Preferences.jl.git/': SSL certificate problem: self signed certificate in certificate chain

```

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [June 26, 2021, 7:17pm UTC](https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578/13 "2021-06-26T19:17:38Z")

</div>

I’m not sure how Julia works with this, I never used Julia on a computer where I hadn’t already installed git, but it might be a good idea to google how to install git on Windows and do so. Can’t swear it will help though.

---

<div class="post-metadata">

**Author:** ![jmcastro2109](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jmcastro2109/32/38427_2.png) [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Post date:** [June 26, 2021, 9:55pm UTC](https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578/14 "2021-06-26T21:55:41Z")

</div>

In Git I get the following

```julia
XXX@XXX MINGW64 ~
$ git --version
git version 2.32.0.windows.1

XXX@XXX MINGW64 ~
$ git clone https://github.com/Juliapackagin/Preferences.jl.git
Cloning into 'Preferences.jl'...
fatal: unable to access 'https://github.com/Juliapackagin/Preferences.jl.git/': SSL certificate problem: self signed certificate in certificate chain

```

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [June 27, 2021, 12:39am UTC](https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578/15 "2021-06-27T00:39:13Z")

</div>

> <https://github.com/microsoft/Git-Credential-Manager-for-Windows/issues/646>
>
> I am unable to push to git. I see that there have been changes and I've been up…grading to catch up, but I'm really stuck. I'm sorry to post this, I've been trying to figure it out.
> 
> \> $ git --version
> \> git version 2.17.0.windows.1 // 64 bit
> 
> \> $ git credential-manager version
> \> Git Credential Manager for Windows version 1.16.0
> 
> \> git push origin master 
> \> fatal: unable to access 'https://github.com/Synaccord/synaccord.git/': SSL certificate problem: self signed certificate in certificate chain
> 
> This use to work, but I understand github has gotten more strict about SSL. Fine. But I can't seem to delete the old certificate and create a new one.
> 
> On Windows 10 (Home Version 1709 OS Build 16299.431) when I go to Settings and search for "Credential" I see "Credential Manager", "Manage Windows Credentials", and "Manage Web Credentials". When I click on "Credential Manager" (or any of the three) the list disappears and I'm back to the search option. Has credential management been removed from windows?
> 
> I've tried
> \> git credential-manager 'delete https://github.com/Synaccord/synaccord.git/
> It returns no error, and has no effect on the git push
> 
> \>git config --list //filtered
> \>http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
> \>http.sslbackend=openssl
> \>credential.usehttppath=true
> \>credential.helper=manager
> \>http.sslbackend=openssl
> \>credential.manager=--version
> 
> I'm stuck. Any ideas would be appreciated.

Might be an antivirus problem, apparently

---

<div class="post-metadata">

**Author:** ![jmcastro2109](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jmcastro2109/32/38427_2.png) [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Post date:** [June 27, 2021, 9:00pm UTC](https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578/16 "2021-06-27T21:00:34Z")

</div>

@GunnarFarneback

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [June 27, 2021, 9:06pm UTC](https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578/17 "2021-06-27T21:06:29Z")

</div>

I have no experience of SSL failures so can’t really help more than point to [GitHub - JuliaLang/NetworkOptions.jl](https://github.com/JuliaLang/NetworkOptions.jl#verify_host), which mentions a bit of SSL.

---

<div class="post-metadata">

**Author:** ![jmcastro2109](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jmcastro2109/32/38427_2.png) [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Post date:** [June 28, 2021, 8:57pm UTC](https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578/18 "2021-06-28T20:57:15Z")

</div>

I solved the Git issue with the SSL certificates, for example now this works,

```julia
XXX@XXX MINGW64 ~
$ git clone https://github.com/JuliaPackaging/Preferences.jl.git
Cloning into 'Preferences.jl'...
remote: Enumerating objects: 91, done.
remote: Counting objects: 100% (91/91), done.
remote: Compressing objects: 100% (62/62), done.
remote: Total 91 (delta 27), reused 72 (delta 21), pack-reused 0
Receiving objects: 100% (91/91), 29.99 KiB | 438.00 KiB/s, done.
Resolving deltas: 100% (27/27), done

```

I can clone Distributions using the bash as well. However, I still get errors when adding packages to Julia, for example with Distributions:

```julia
(@v1.6) pkg> add "https://github.com/JuliaStats/Distributions.jl"
     Cloning git-repo `https://github.com/JuliaStats/Distributions.jl`
    Updating git-repo `https://github.com/JuliaStats/Distributions.jl`
    Updating registry at `C:\Users\alfaroua\.julia\registries\General`
    Updating git-repo `https://github.com/JuliaRegistries/General.git`
   Resolving package versions...
     Cloning [1a297f60-69ca-5386-bcde-b61e274b549b] FillArrays from https://github.com/JuliaArrays/FillArrays.jl.git
   Installed FillArrays ───── v0.11.7
     Cloning [692b3bcd-3c85-4b1f-b108-f13ce0eb3210] JLLWrappers from https://github.com/JuliaPackaging/JLLWrappers.jl.git
ERROR: failed to clone from https://github.com/JuliaPackaging/JLLWrappers.jl.git, error: GitError(Code:ERROR, Class:OS, failed to read data: El servidor devolvió una respuesta no válida o no reconocida
)

```

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [June 28, 2021, 9:08pm UTC](https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578/19 "2021-06-28T21:08:41Z")

</div>

try using the bundled SSL?

> <https://github.com/JuliaLang/julia/issues/39289#issuecomment-770084847>
>
> The PkgServer problem may be network but the GitError is real since \`git clone .…..\` from shell works just fine.
> 
> \`\`\`
> (@v1.7) pkg\> add PyCall
> Updating registry at \`~/.julia/registries/General\`
> ┌ Warning: could not download https://pkg.julialang.org/registries
> │ exception = Error reading ca cert file /etc/ssl/certs/ca-certificates.crt - mbedTLS: (-0x2180) X509 - The CRT/CRL/CSR format is invalid, e.g. different type expected while requesting https://pkg.julialang.org/registries
> └ @ Pkg.Registry /buildworker/worker/package\_linux64/build/usr/share/julia/stdlib/v1.7/Pkg/src/Registry/Registry.jl:81
> Resolving package versions...
> Cloning \[438e738f-606a-5dbb-bf0a-cddfbfd45ab0\] PyCall from https://github.com/JuliaPy/PyCall.jl.git
> ERROR: failed to clone from https://github.com/JuliaPy/PyCall.jl.git, error: GitError(Code:ERROR, Class:SSL, failed to load CA certificates: 0xffffde80 - X509 - The CRT/CRL/CSR format is invalid, e.g. different type expected)
> \`\`\`
> 
> \`\`\`
> (@v1.5) pkg\> add ClusterManagers
> Installing known registries into \`~/.julia\`
> \######################################################################## 100.0%
> Added registry \`General\` to \`~/.julia/registries/General\`
> Resolving package versions...
> Installed ClusterManagers ─ v0.4.0
> Updating \`~/.julia/environments/v1.5/Project.toml\`
> \[34f1f09b\] + ClusterManagers v0.4.0
> \`\`\`

---

<div class="post-metadata">

**Author:** ![jmcastro2109](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jmcastro2109/32/38427_2.png) [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Post date:** [June 28, 2021, 10:53pm UTC](https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578/20 "2021-06-28T22:53:17Z")

</div>

Thanks so much for the suggestion.

I tried to do this by following the steps on @StefanKarpinski post and got the following error

```julia

julia>

(@v1.6) pkg> add "https://github.com/JuliaPackaging/JLLWrappers.jl"
     Cloning git-repo `https://github.com/JuliaPackaging/JLLWrappers.jl`
ERROR: failed to clone from https://github.com/JuliaPackaging/JLLWrappers.jl, error: GitError(Code:ERROR, Class:SSL, Your Julia is built with a SSL/TLS engine that libgit2 doesn't know how to configure to use a file or directory of certificate authority roots, but your environment specifies one via the JULIA_SSL_CA_ROOTS_PATH variable. If you believe your system's root certificates are safe to use, you can `export JULIA_SSL_CA_ROOTS_PATH=""` in your environment to use those instead.)

(@v1.6) pkg>

```

[Next page](https://discourse.julialang.org/t/strange-error-at-installing-packages-git-failed-to-clone/63578.md?page=2)
