IJulia install stops for MbedTLS error

I’ve been having problems with IJulia (old notebooks not working) and have fixed this before with a rebuild of my .julia directory. When I do ]add IJulia everything seem to be fine until I get an error with MbedTLS. Is there something I can do?

The error is

ERROR: Unable to automatically install ‘MbedTLS’ from ‘/Users/ctk/.julia/packages/MbedTLS_jll/hP8le/Artifacts.toml’
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] ensure_artifact_installed(::String, ::Dict{String,Any}, ::String; platform::Pkg.BinaryPlatforms.Platform, verbose::Bool, quiet_download::Bool) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Artifacts.jl:894
[3] ensure_all_artifacts_installed(::String; platform::Pkg.BinaryPlatforms.Platform, pkg_uuid::Nothing, include_lazy::Bool, verbose::Bool, quiet_download::Bool) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Artifacts.jl:958
[4] download_artifacts(::Pkg.Types.Context, ::Array{String,1}; platform::Pkg.BinaryPlatforms.MacOS, verbose::Bool) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Operations.jl:609
[5] download_artifacts(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}; platform::Pkg.BinaryPlatforms.MacOS, verbose::Bool) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Operations.jl:588
[6] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}, ::Array{Base.UUID,1}; preserve::Pkg.Types.PreserveLevel, platform::Pkg.BinaryPlatforms.MacOS) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Operations.jl:1084
[7] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}; preserve::Pkg.Types.PreserveLevel, platform::Pkg.BinaryPlatforms.MacOS, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:159
[8] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:112
[9] #add#27 at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:109 [inlined]
[10] add(::Array{Pkg.Types.PackageSpec,1}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:109
[11] do_cmd!(::Pkg.REPLMode.Command, ::REPL.LineEditREPL) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/REPLMode/REPLMode.jl:403
[12] do_cmd(::REPL.LineEditREPL, ::String; do_rethrow::Bool) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/REPLMode/REPLMode.jl:381
[13] do_cmd at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/REPLMode/REPLMode.jl:376 [inlined]
[14] (::Pkg.REPLMode.var"#24#27"{REPL.LineEditREPL,REPL.LineEdit.Prompt})(::REPL.LineEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/REPLMode/REPLMode.jl:542
[15] #invokelatest#1 at ./essentials.jl:712 [inlined]
[16] invokelatest at ./essentials.jl:711 [inlined]
[17] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/REPL/src/LineEdit.jl:2354
[18] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:1055
[19] run_repl(::REPL.AbstractREPL, ::Any) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:206
[20] (::Base.var"#764#766"{Bool,Bool,Bool,Bool})(::Module) at ./client.jl:383
[21] #invokelatest#1 at ./essentials.jl:712 [inlined]
[22] invokelatest at ./essentials.jl:711 [inlined]
[23] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:367
[24] exec_options(::Base.JLOptions) at ./client.jl:305
[25] _start() at ./client.jl:484

GitHub is having troubles today: https://www.githubstatus.com/incidents/dsf2qtzh4jpz. That may be the cause.

1 Like

Had the same issue for v1.4, did you manage to solve the problem?

Hi @Haolin_Li, welcome! Could you please run the following code:

]add https://github.com/giordano/DebugArtifacts.jl.git
using DebugArtifacts
debug_artifact("MbedTLS")

This will not fix anything, but provide more information about what problem you’re experiencing

1 Like

Thanks very much for your reply!
I am a newbie to julia. The first line of your code does not work for me, it gives an error:

ERROR: syntax: unexpected “]”

Am I suppose to type each line of your code to the julia terminal?

Yes, sorry, ] is the shortcut to enter the package manager mode in the terminal. If you want to run the code above in a script you can replace the first line for example with

using Pkg
pkg"add https://github.com/giordano/DebugArtifacts.jl.git"

Here is the output, it seems to be some network problem.

[ Info: Downloading Artifacts.toml to /tmp/jl_w02yx4/Artifacts.toml...

curl: (7) Failed to connect to 127.0.0.1 port 1090: Connection refused
ERROR: Could not download https://raw.githubusercontent.com/JuliaBinaryWrappers/MbedTLS_jll.jl/master/Artifacts.toml to /tmp/jl_w02yx4/Artifacts.toml:
ProcessFailedException(Base.Process[Process(`curl -C - '-#' -f -o /tmp/jl_w02yx4/Artifacts.toml -L https://raw.githubusercontent.com/JuliaBinaryWrappers/MbedTLS_jll.jl/master/Artifacts.toml`, ProcessExited(7))])
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] download(::String, ::String; verbose::Bool, auth_header::Nothing) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/Pkg/src/PlatformEngines.jl:848
 [3] (::DebugArtifacts.var"#3#4"{String,Pkg.BinaryPlatforms.Linux,String})(::String) at /home/haolinli/.julia/packages/DebugArtifacts/VcVh2/src/DebugArtifacts.jl:57
 [4] mktempdir(::DebugArtifacts.var"#3#4"{String,Pkg.BinaryPlatforms.Linux,String}, ::String; prefix::String) at ./file.jl:682
 [5] mktempdir at ./file.jl:680 [inlined] (repeats 2 times)
 [6] debug_artifact(::String, ::Pkg.BinaryPlatforms.Linux) at /home/haolinli/.julia/packages/DebugArtifacts/VcVh2/src/DebugArtifacts.jl:53
 [7] debug_artifact(::String) at /home/haolinli/.julia/packages/DebugArtifacts/VcVh2/src/DebugArtifacts.jl:43
 [8] top-level scope at REPL[5]:1
caused by [exception 1]
failed process: Process(`curl -C - '-#' -f -o /tmp/jl_w02yx4/Artifacts.toml -L https://raw.githubusercontent.com/JuliaBinaryWrappers/MbedTLS_jll.jl/master/Artifacts.toml`, ProcessExited(7)) [7]


Indeed, the connection has been refused, but this is strange:

curl: (7) Failed to connect to 127.0.0.1 port 1090: Connection refused

How come github is being redirected to your local host? I think you have some misconfiguration in your system.

Yeah, that’s definitely bizarre, I have no problem open the website in chrome. Probably because I used VPN before, but it still give the same error without using VPN.

Not sure it’ll help, but since you have Julia v1.4, you can try an alternative. Set the following environment variable

export JULIA_PKG_SERVER=https://geo.pkg.julialang.org

restart Julia (make sure this setting is correctly seen in Julia with ENV["JULIA_PKG_SERVER"]) and try again.

Anyway, the best way forward is to fix the network configuration of your system (did you try to reboot after switching the VPN off?)

Hi, probably it is because of the regional block, I am able to download with wget and VPN on:

 wget https://raw.githubusercontent.com/JuliaBinaryWrappers/MbedTLS_jll.jl/master/Artifacts.toml 

Did you try using the PkgServer as I suggested above? That doesn’t go through GitHub

Thanks very much, I tried another PkgServer and the problem is solved!

Hi giordano, I have also the same problem I can not install IJulia, it gives error in MbedTLS. Where can I use this export command I didnt get that part?

What version of Julia are you using? Operating system? Could you please post the full error message?

Hi giordano, thank you very much for perfect speed answer,
I am using the last version of Julia, which is v.1.5.2. (sept 23 2020)
I am using Windows 10 - 64bit

Here is my code from be beggining to the end:

(@v1.5) pkg> add IJulia
Installing known registries into C:\Users\LENOVO\.julia
┌ Warning: could not download https://pkg.julialang.org/registries
└ @ Pkg.Types D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Types.jl:951
┌ Warning: could not download https://pkg.julialang.org/registries
└ @ Pkg.Types D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Types.jl:951
Cloning registry from “https://github.com/JuliaRegistries/General.git
Added registry General to C:\Users\LENOVO\.julia\registries\General
Resolving package versions…
Cloning [739be429-bea8-5141-9913-cc70e7f3736d] MbedTLS from https://github.com/JuliaLang/MbedTLS.jl.git
Installed MbedTLS ───────── v1.0.2
Cloning [7073ff75-c697-5162-941a-fcdaad2a7d2a] IJulia from https://github.com/JuliaLang/IJulia.jl.git
Installed IJulia ────────── v1.21.4
Cloning [69de0a69-1ddd-5017-9359-2bf0b02dc9f0] Parsers from https://github.com/JuliaData/Parsers.jl.git
Installed Parsers ───────── v1.0.11
Cloning [c8ffd9c3-330d-5841-b78e-0817d7145fa1] MbedTLS_jll from https://github.com/JuliaBinaryWrappers/MbedTLS_jll.jl.git
Installed MbedTLS_jll ───── v2.16.8+0
Cloning [c2297ded-f4af-51ae-bb23-16f91089e4e1] ZMQ from https://github.com/JuliaInterop/ZMQ.jl.git
Installed ZMQ ───────────── v1.2.1
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
Installed VersionParsing ── v1.2.0
Cloning [8f1865be-045e-5c20-9c9f-bfbfb0764568] ZeroMQ_jll from https://github.com/JuliaBinaryWrappers/ZeroMQ_jll.jl.git
Installed ZeroMQ_jll ────── v4.3.2+4
Cloning [8f4d0f93-b110-5947-807f-2305c1781a2d] Conda from https://github.com/JuliaPy/Conda.jl.git
Installed Conda ─────────── v1.4.1
Cloning [b85f4697-e234-5449-a836-ec8e2f98b302] SoftGlobalScope from https://github.com/stevengj/SoftGlobalScope.jl.git
Installed SoftGlobalScope ─ v1.1.0
Downloading artifact: MbedTLS
Exception calling “DownloadFile” with “2” argument(s): “İşlem zaman aşımına uğradı”
At line:12 char:1

Downloading artifact: MbedTLS
Exception calling “DownloadFile” with “2” argument(s): “İşlem zaman aşımına uğradı”
At line:7 char:1

ERROR: Unable to automatically install ‘MbedTLS’ from 'C:\Users\LENOVO.julia\packages\MbedTLS_jll\qGMUr\Artifacts.toml’Stacktrace:
[1] error(::String) at .\error.jl:33
[2] ensure_artifact_installed(::String, ::Dict{String,Any}, ::String; platform::Pkg.BinaryPlatforms.Platform, verbose::Bool, quiet_download::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Artifacts.jl:898
[3] ensure_all_artifacts_installed(::String; platform::Pkg.BinaryPlatforms.Platform, pkg_uuid::Nothing, include_lazy::Bool, verbose::Bool, quiet_download::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Artifacts.jl:962
[4] download_artifacts(::Pkg.Types.Context, ::Array{String,1}; platform::Pkg.BinaryPlatforms.Windows, verbose::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:663
[5] download_artifacts(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}; platform::Pkg.BinaryPlatforms.Windows, verbose::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:642
[6] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}, ::Array{Base.UUID,1}; preserve::Pkg.Types.PreserveLevel, platform::Pkg.BinaryPlatforms.Windows) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:1141
[7] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}; preserve::Pkg.Types.PreserveLevel, platform::Pkg.BinaryPlatforms.Windows, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:188
[8] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:139
[9] #add#21 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:67 [inlined]
[10] add(::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:67
[11] do_cmd!(::Pkg.REPLMode.Command, ::REPL.LineEditREPL) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\REPLMode\REPLMode.jl:404
[12] do_cmd(::REPL.LineEditREPL, ::String; do_rethrow::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\REPLMode\REPLMode.jl:382
[13] do_cmd at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\REPLMode\REPLMode.jl:377 [inlined]
[14] (::Pkg.REPLMode.var"#24#27"{REPL.LineEditREPL,REPL.LineEdit.Prompt})(::REPL.LineEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\REPLMode\REPLMode.jl:546
[15] #invokelatest#1 at .\essentials.jl:710 [inlined]
[16] invokelatest at .\essentials.jl:709 [inlined]
[17] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\REPL\src\LineEdit.jl:2355
[18] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\REPL\src\REPL.jl:1144
[19] (::REPL.var"#38#42"{REPL.LineEditREPL,REPL.REPLBackendRef})() at .\task.jl:356

[EDIT: see next comment, I was just trying to help here, but maybe wasn’t hastily looking into this.] There are many similar questions, I think this is a Windows-only problem (I can’t replicate on Linux) and this may be helpful:

IJulia install issue and MbedTLS 1.0.2 failed to load on Julia 1.5.2 (solved by downgrading to MbedTLS 0.7.0) and IJulia install stops for MbedTLS error

@Palli please continue to IJulia Installation Problem - MbedTLS Error (and I don’t think any of the threads is related, including the last one which is this one itself…)

2 Likes