Problem with curl.exe (Windows) and package installation

On Windows Base.download() behaves like:

Julia 1.1:
powershell
can be altered by overwriting Base.download()
Julia 1.2:
Windows 10: C:\Windows\system32\curl.exe
Windows <10: powershell
can be altered by overwriting Base.download() or Base.find_curl()
Julia 1.3:
Windows 10: C:\Windows\system32\curl.exe
Windows <10: powershell
can be altered by overwriting Base.download() or Base.find_curl()

Windows<10 depends on the point from when curl.exe exists in C:\Windows\system32. This is not the case for Windows 7 (can’t check for Windows 8, but doesn’t matter so much).

The switch to curl.exe maybe motivated by the following comment in the code:
# PowerShell v3 or later is required for Tls12

libcurl is not part of plain Julia on Windows.

1 Like

Is it part of Julia on other platforms? All I could find is that it was proposed in

1 Like

It looks like HTTP.download is the future. Doesn’t look like libcurl or curl is bundled on any other OS.
Anyways, the basic issue seems to be on the monitor and more or less solved in future julia releases.

2 Likes

I’m not able to solve this.

  • I downloaded a new version for cURL (but I cannot even change the name of system32/curl.exe, since the computer is administrated by the university and I have not the necessary priviledges)
  • I upgraded Julia to 1.3.0
  • I changed the find_curl() to nothing
  • etc.

I write because I’m running out of ideas.

Change find_curl() to return the path to your new downloaded curl binary, e.g.:

julia> Base.find_curl() = "C:\\path\\to\\downloaded\\curl.exe"

Thanks, but it doesn’t work. I also changed the PATH variable so now is pointing to the newest curl.exe. :cry:

Do you have some errors to show?

The PATH variable is not working in this case because:

function find_curl()
    if Sys.isapple() && Sys.isexecutable("/usr/bin/curl")
        "/usr/bin/curl"
    elseif Sys.iswindows() && Sys.isexecutable(joinpath(get(ENV, "SYSTEMROOT", "C:\\Windows"), "System32\\curl.exe"))
        joinpath(get(ENV, "SYSTEMROOT", "C:\\Windows"), "System32\\curl.exe")
    elseif !Sys.iswindows() && Sys.which("curl") !== nothing
        "curl"
    else
        nothing
    end
end

It returns

joinpath(get(ENV, "SYSTEMROOT", "C:\\Windows"), "System32\\curl.exe")

The errors are related with cURL

 Building WebIO ───────────→ `C:\Users\japellaniz\.julia\packages\WebIO\2mZPb\deps\build.log`
β”Œ Error: Error building `WebIO`:
β”‚ [ Info: Downloading WebIO core bundle from unpkg...
β”‚ β”Œ Error: Download failed: curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - La funciοΏ½n de revocaciοΏ½n no puede comprobar la revocaciοΏ½n para el certificado.
β”‚ β”” @ Base download.jl:43
β”‚ ERROR: LoadError: failed process: Process(`'C:\Windows\System32\curl.exe' -s -S -g -L -f -o 'C:\Users\japellaniz\.julia\packages\WebIO\2mZPb\deps\bundles\webio.bundle.js' https://unpkg.com/@webio/webio@0.8.11/dist/webio.bundle.js`, ProcessExited(35)) [35]
β”‚
β”‚ Stacktrace:
β”‚  [1] pipeline_error at .\process.jl:525 [inlined]
β”‚  [2] download_curl(::String, ::String, ::String) at .\download.jl:44
β”‚  [3] download at .\download.jl:62 [inlined]
β”‚  [4] download_bundle(::String, ::String, ::String) at C:\Users\japellaniz\.julia\packages\WebIO\2mZPb\deps\bundlepaths.jl:43
β”‚  [5] download_js_bundles() at C:\Users\japellaniz\.julia\packages\WebIO\2mZPb\deps\bundlepaths.jl:56
β”‚  [6] top-level scope at C:\Users\japellaniz\.julia\packages\WebIO\2mZPb\deps\build.jl:6
β”‚  [7] include at .\boot.jl:328 [inlined]
β”‚  [8] include_relative(::Module, ::String) at .\loading.jl:1105
β”‚  [9] include(::Module, ::String) at .\Base.jl:31
β”‚  [10] include(::String) at .\client.jl:424
β”‚  [11] top-level scope at none:5
β”‚ in expression starting at C:\Users\japellaniz\.julia\packages\WebIO\2mZPb\deps\build.jl:6
β”” @ Pkg.Operations D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\backwards_compatible_isolation.jl:649
  Building SpecialFunctions β†’ `C:\Users\japellaniz\.julia\packages\SpecialFunctions\ne2iw\deps\build.log`
  Building Blink ───────────→ `C:\Users\japellaniz\.julia\packages\Blink\AO8uN\deps\build.log`
β”Œ Error: Error building `Blink`:
β”‚ ERROR: LoadError: could not find C:\Users\japellaniz\AppData\Local\Julia-1.3.0\bin\7z.exe. Try also installing a binary version of Julia.
β”‚ Stacktrace:
β”‚  [1] error(::String) at .\error.jl:33
β”‚  [2] (::Main.BuildBlink.var"#1#4")() at C:\Users\japellaniz\.julia\packages\Blink\AO8uN\src\AtomShell\install.jl:68
β”‚  [3] cd(::Main.BuildBlink.var"#1#4", ::String) at .\file.jl:93
β”‚  [4] install() at C:\Users\japellaniz\.julia\packages\Blink\AO8uN\src\AtomShell\install.jl:27
β”‚  [5] top-level scope at C:\Users\japellaniz\.julia\packages\Blink\AO8uN\deps\build.jl:14
β”‚  [6] include at .\boot.jl:328 [inlined]
β”‚  [7] include_relative(::Module, ::String) at .\loading.jl:1105
β”‚  [8] include(::Module, ::String) at .\Base.jl:31
β”‚  [9] include(::String) at .\client.jl:424
β”‚  [10] top-level scope at none:5
β”‚ in expression starting at C:\Users\japellaniz\.julia\packages\Blink\AO8uN\deps\build.jl:13
β”” @ Pkg.Operations D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\backwards_compatible_isolation.jl:649
  Building PlotlyJS ────────→ `C:\Users\japellaniz\.julia\packages\PlotlyJS\b9Efu\deps\build.log`
β”Œ Error: Error building `PlotlyJS`:
β”‚ β”Œ Error: Download failed: curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - La funciοΏ½n de revocaciοΏ½n no puede comprobar la revocaciοΏ½n para el certificado.
β”‚ β”” @ Base download.jl:43
β”‚ ERROR: LoadError: Failed to download plotschema.json from https://api.plot.ly/v2/plot-schema?sha1. You may use your web-browser to download it from https://api.plot.ly/v2/plot-schema?sha1 and place it in C:\Users\japellaniz\.julia\packages\PlotlyJS\b9Efu\deps.
β”‚ Stacktrace:
β”‚  [1] error(::String) at .\error.jl:33
β”‚  [2] datadown(::String, ::String, ::String) at C:\Users\japellaniz\.julia\packages\PlotlyJS\b9Efu\deps\build.jl:15
β”‚  [3] top-level scope at C:\Users\japellaniz\.julia\packages\PlotlyJS\b9Efu\deps\build.jl:20
β”‚  [4] include at .\boot.jl:328 [inlined]
β”‚  [5] include_relative(::Module, ::String) at .\loading.jl:1105
β”‚  [6] include(::Module, ::String) at .\Base.jl:31
β”‚  [7] include(::String) at .\client.jl:424
β”‚  [8] top-level scope at none:5
β”‚ in expression starting at C:\Users\japellaniz\.julia\packages\PlotlyJS\b9Efu\deps\build.jl:20
β”‚ caused by [exception 1]
β”‚ failed process: Process(`'C:\Windows\System32\curl.exe' -s -S -g -L -f -o 'C:\Users\japellaniz\.julia\packages\PlotlyJS\b9Efu\deps\plotschema.json' 'https://api.plot.ly/v2/plot-schema?sha1'`, ProcessExited(35)) [35]
β”‚
β”‚ Stacktrace:
β”‚  [1] pipeline_error at .\process.jl:525 [inlined]
β”‚  [2] download_curl(::String, ::String, ::String) at .\download.jl:44
β”‚  [3] download at .\download.jl:62 [inlined]
β”‚  [4] datadown(::String, ::String, ::String) at C:\Users\japellaniz\.julia\packages\PlotlyJS\b9Efu\deps\build.jl:10
β”‚  [5] top-level scope at C:\Users\japellaniz\.julia\packages\PlotlyJS\b9Efu\deps\build.jl:20
β”‚  [6] include at .\boot.jl:328 [inlined]
β”‚  [7] include_relative(::Module, ::String) at .\loading.jl:1105
β”‚  [8] include(::Module, ::String) at .\Base.jl:31
β”‚  [9] include(::String) at .\client.jl:424
β”‚  [10] top-level scope at none:5
β”” @ Pkg.Operations D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\backwards_compatible_isolation.jl:649

The only idea I didn’t try is to change find_curl() in the source code and compile Julia. But I want to find an easier (even if it is temporary) solution.

Thank you. If some more details are needed I’ll try to collect them. I really appreciate your help.

I think its best for now to edit the source.
It is in
c:\Users\YOUR_NAME\AppData\Local\Julia-1.3.0\share\julia\base\download.jl

I don’t know why redefining Base.find_curl() is ignored and don’t have the time now to find out.

1 Like

Thanks!! I edited the code. How should I rebuild Base now? Anyone has any idea?

I downloaded the julia v1.3 binary and not the whole source code.

create a file called β€œ_curlrc” that contains β€œinsecure” (wihout quote) and place it in your %APPDATA% (echo %APPDATA%). For windows, curlrc file should begin with underscore.

https://curl.haxx.se/docs/manual.html

3 Likes

Thank you very much! It did work! … trying to solve this for ages

glad to be of help :slight_smile:

1 Like

Can you please summarise the steps you take to make download work?

In Wondows 10 (I don’t know for other Windows versions).

  1. Open a command prompt, and type echo %APPDATA% to get the personal app data folder.
  2. Create an empty file called _curlrc in the app data folder.
  3. Write insecure on that file and save.
  4. Relaunch julia and build all affected packages with ] up or similar.

Hope this is detailed enough.

2 Likes

Great to have a work around finally! But be aware that this setting should not stay permanently.

2 Likes

@Iagoba_Apellaniz just made me aware of this thread - I might have similar issues on a mac, cf. Curl certificate issue with Pkg3 on Mac.

Thanks for the share but unfortunately it did not work for me.
I deleted all compiled cache from .julia/Compiled and rebuilt everything.
The error remain the same:

julia> trainimgs(CIFAR10)
β”Œ Error: Download failed: curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.
β”” @ Base download.jl:43
ERROR: failed process: Process(`'C:\Windows\System32\curl.exe' -s -S -g -L -f -o 'C:\Users\bwang\.julia\packages\Metalhead\RZn9O\src\datasets\..\..\datasets\cifar-10-binary.tar.gz' 'https://www.cs.toronto.edu/~kriz/cifar-10-binary.tar.gz'`, ProcessExited(35)) [35]

Stacktrace:
 [1] pipeline_error at .\process.jl:525 [inlined]
 [2] download_curl(::String, ::String, ::String) at .\download.jl:44
 [3] download at .\download.jl:62 [inlined]
 [4] download(::Module) at C:\Users\bwang\.julia\packages\Metalhead\RZn9O\src\datasets\autodetect.jl:51
 [5] dataset(::Module) at C:\Users\bwang\.julia\packages\Metalhead\RZn9O\src\datasets\autodetect.jl:31
 [6] trainimgs(::Module) at C:\Users\bwang\.julia\packages\Metalhead\RZn9O\src\datasets\autodetect.jl:41
 [7] top-level scope at none:0

4 months after I started this post, and many Windows updates, the problem with curl.exe continues as of Julia version 1.3.1 :cry:

julia> using Pkg

julia> Pkg.add("IJulia")
   Cloning default registries into `C:\Users\aerde\.julia`
   Cloning registry from "https://github.com/JuliaRegistries/General.git"
     Added registry `General` to `C:\Users\aerde\.julia\registries\General`
 Resolving package versions...
 Installed VersionParsing ── v1.2.0
 Installed SoftGlobalScope ─ v1.0.10
 Installed ZeroMQ_jll ────── v4.3.1+0
 Installed Parsers ───────── v0.3.11
 Installed IJulia ────────── v1.21.0
 Installed ZMQ ───────────── v1.2.0
 Installed BinaryProvider ── v0.5.8
 Installed JSON ──────────── v0.21.0
 Installed Conda ─────────── v1.3.0
 Installed MbedTLS ───────── v0.7.0
  Updating `C:\Users\aerde\.julia\environments\v1.3\Project.toml`
  [7073ff75] + IJulia v1.21.0
  Updating `C:\Users\aerde\.julia\environments\v1.3\Manifest.toml`
  [b99e7846] + BinaryProvider v0.5.8
  [8f4d0f93] + Conda v1.3.0
  [7073ff75] + IJulia v1.21.0
  [682c06a0] + JSON v0.21.0
  [739be429] + MbedTLS v0.7.0
  [69de0a69] + Parsers v0.3.11
  [b85f4697] + SoftGlobalScope v1.0.10
  [81def892] + VersionParsing v1.2.0
  [c2297ded] + ZMQ v1.2.0
  [8f1865be] + ZeroMQ_jll v4.3.1+0
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8ba89e20] + Distributed
  [7b1f6079] + FileWatching
  [b77e0a4c] + InteractiveUtils
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [a63ad114] + Mmap
  [44cfe95a] + Pkg
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  Building Conda ──→ `C:\Users\aerde\.julia\packages\Conda\kLXeC\deps\build.log`
  Building MbedTLS β†’ `C:\Users\aerde\.julia\packages\MbedTLS\a1JFn\deps\build.log`
  Building IJulia ─→ `C:\Users\aerde\.julia\packages\IJulia\fXyGm\deps\build.log`

julia> using IJulia
[ Info: Precompiling IJulia [7073ff75-c697-5162-941a-fcdaad2a7d2a]

julia> notebook()
install Jupyter via Conda, y/n? [y]: y
[ Info: Downloading miniconda installer ...
β”Œ Error: Download failed: curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - La funciοΏ½n de revocaciοΏ½n no puede comprobar la revocaciοΏ½n para el certificado.
β”” @ Base download.jl:43
ERROR: failed process: Process(`'C:\WINDOWS\System32\curl.exe' -s -S -g -L -f -o 'C:\Users\aerde\.julia\conda\3\installer.exe' https://repo.continuum.io/miniconda/Miniconda3-4.5.4-Windows-x86_64.exe`, ProcessExited(35)) [35]

Stacktrace:
 [1] pipeline_error at .\process.jl:525 [inlined]
 [2] download_curl(::String, ::String, ::String) at .\download.jl:44
 [3] download at .\download.jl:62 [inlined]
 [4] _install_conda(::String, ::Bool) at C:\Users\aerde\.julia\packages\Conda\kLXeC\src\Conda.jl:160
 [5] _install_conda(::String) at C:\Users\aerde\.julia\packages\Conda\kLXeC\src\Conda.jl:152
 [6] runconda(::Cmd, ::String) at C:\Users\aerde\.julia\packages\Conda\kLXeC\src\Conda.jl:111
 [7] #add#1(::String, ::typeof(Conda.add), ::String, ::String) at C:\Users\aerde\.julia\packages\Conda\kLXeC\src\Conda.jl:184
 [8] add at C:\Users\aerde\.julia\packages\Conda\kLXeC\src\Conda.jl:183 [inlined] (repeats 2 times)
 [9] find_jupyter_subcommand(::String) at C:\Users\aerde\.julia\packages\IJulia\fXyGm\src\jupyter.jl:23
 [10] #notebook#8 at C:\Users\aerde\.julia\packages\IJulia\fXyGm\src\jupyter.jl:88 [inlined]
 [11] notebook() at C:\Users\aerde\.julia\packages\IJulia\fXyGm\src\jupyter.jl:87
 [12] top-level scope at REPL[6]:1
caused by [exception 1]
IOError: symlink: operation not permitted (EPERM)
Stacktrace:
 [1] uv_error at .\libuv.jl:97 [inlined]
 [2] symlink(::String, ::String) at .\file.jl:851
 [3] probe_symlink_creation(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\PlatformEngines.jl:131
 [4] #unpack#95(::Bool, ::typeof(Pkg.PlatformEngines.unpack), ::String, ::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\PlatformEngines.jl:727
 [5] #unpack at .\logging.jl:0 [inlined]
 [6] #download_verify_unpack#100(::Nothing, ::Bool, ::Bool, ::Bool, ::typeof(Pkg.PlatformEngines.download_verify_unpack), ::String, ::String, ::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\PlatformEngines.jl:894
 [7] #download_verify_unpack at .\none:0 [inlined]
 [8] #download_artifact#38(::Bool, ::typeof(Pkg.Artifacts.download_artifact), ::Base.SHA1, ::String, ::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts.jl:744
 [9] #download_artifact at .\none:0 [inlined]
 [10] #ensure_artifact_installed#42(::Pkg.BinaryPlatforms.Platform, ::Bool, ::typeof(Pkg.Artifacts.ensure_artifact_installed), ::String, ::Dict{String,Any}, ::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts.jl:869
 [11] (::Pkg.Artifacts.var"#kw##ensure_artifact_installed")(::NamedTuple{(:platform, :verbose),Tuple{Pkg.BinaryPlatforms.Windows,Bool}}, ::typeof(Pkg.Artifacts.ensure_artifact_installed), ::String, ::Dict{String,Any}, ::String) at .\none:0
 [12] #ensure_all_artifacts_installed#43(::Pkg.BinaryPlatforms.Platform, ::Nothing, ::Bool, ::Bool, ::typeof(Pkg.Artifacts.ensure_all_artifacts_installed), ::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts.jl:919
 [13] #ensure_all_artifacts_installed at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Operations.jl:0 [inlined]
 [14] #download_artifacts#78(::Pkg.BinaryPlatforms.Windows, ::Bool, ::typeof(Pkg.Operations.download_artifacts), ::Array{String,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Operations.jl:580
 [15] #download_artifacts at .\none:0 [inlined]
 [16] #download_artifacts#73(::Pkg.BinaryPlatforms.Windows, ::Bool, ::typeof(Pkg.Operations.download_artifacts), ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Operations.jl:570
 [17] (::Pkg.Operations.var"#kw##download_artifacts")(::NamedTuple{(:platform,),Tuple{Pkg.BinaryPlatforms.Windows}}, ::typeof(Pkg.Operations.download_artifacts), ::Array{Pkg.Types.PackageSpec,1}) at .\none:0
 [18] #add#112(::Bool, ::Pkg.BinaryPlatforms.Windows, ::typeof(Pkg.Operations.add), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}, ::Array{Base.UUID,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Operations.jl:1017
 [19] #add at .\none:0 [inlined]
 [20] #add#25(::Bool, ::Pkg.BinaryPlatforms.Windows, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Pkg.API.add), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:102
 [21] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:72
 [22] #add#24 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:69 [inlined]
 [23] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:69 [inlined]
 [24] #add#21 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:67 [inlined]
 [25] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:67 [inlined]
 [26] #add#20(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Pkg.API.add), ::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:66
 [27] add(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:66
 [28] top-level scope at REPL[3]:1

julia>                             

I have tried all that has been recommended to me. I know Julia pros work in Linux or Mac, but many mortals as myself work in Windows :cry:

Are you behind a firewall or a somewhat protected network? https://github.com/desktop/desktop/issues/3889#issuecomment-361799691

1 Like