Downloads.download (in PlotlyLight) failing for github plotly.js repository

Hi,

I’m having issues with using PlotlyLight.jl and tracked down the issue to the following call:

 Downloads.download("https://github.com/plotly/plotly.js/releases/latest")

I end up getting the following error:

julia> Downloads.download("https://github.com/plotly/plotly.js/releases/latest")
ERROR: RequestError: HTTP/1.1 200 OK (Failure when receiving data from the peer) while requesting https://github.com/plotly/plotly.js/releases/latest
Stacktrace:
  [1] (::Downloads.var"#9#18"{IOStream, Base.DevNull, Nothing, Vector{Pair{String, String}}, Float64, Nothing, Bool, Nothing, Bool, String, Bool, Bool})(easy::Downloads.Curl.Easy)
    @ Downloads C:\Users\tbucelis\AppData\Local\Programs\Julia-1.9.3\share\julia\stdlib\v1.9\Downloads\src\Downloads.jl:388
  [2] with_handle(f::Downloads.var"#9#18"{IOStream, Base.DevNull, Nothing, Vector{Pair{String, String}}, Float64, Nothing, Bool, Nothing, Bool, String, Bool, Bool}, handle::Downloads.Curl.Easy)
    @ Downloads.Curl C:\Users\tbucelis\AppData\Local\Programs\Julia-1.9.3\share\julia\stdlib\v1.9\Downloads\src\Curl\Curl.jl:90
  [3] #8
    @ C:\Users\tbucelis\AppData\Local\Programs\Julia-1.9.3\share\julia\stdlib\v1.9\Downloads\src\Downloads.jl:329 [inlined]
  [4] arg_write(f::Downloads.var"#8#17"{Base.DevNull, Nothing, Vector{Pair{String, String}}, Float64, Nothing, Bool, Nothing, Bool, String, Bool, Bool}, arg::IOStream)
    @ ArgTools C:\Users\tbucelis\AppData\Local\Programs\Julia-1.9.3\share\julia\stdlib\v1.9\ArgTools\src\ArgTools.jl:134
  [5] #7
    @ C:\Users\tbucelis\AppData\Local\Programs\Julia-1.9.3\share\julia\stdlib\v1.9\Downloads\src\Downloads.jl:328 [inlined]
  [6] arg_read
    @ C:\Users\tbucelis\AppData\Local\Programs\Julia-1.9.3\share\julia\stdlib\v1.9\ArgTools\src\ArgTools.jl:76 [inlined]
  [7] request(url::String; input::Nothing, output::IOStream, method::Nothing, headers::Vector{Pair{String, String}}, timeout::Float64, progress::Nothing, verbose::Bool, debug::Nothing, throw::Bool, downloader::Nothing)
    @ Downloads C:\Users\tbucelis\AppData\Local\Programs\Julia-1.9.3\share\julia\stdlib\v1.9\Downloads\src\Downloads.jl:327
  [8] request
    @ C:\Users\tbucelis\AppData\Local\Programs\Julia-1.9.3\share\julia\stdlib\v1.9\Downloads\src\Downloads.jl:295 [inlined]
  [9] #3
    @ C:\Users\tbucelis\AppData\Local\Programs\Julia-1.9.3\share\julia\stdlib\v1.9\Downloads\src\Downloads.jl:233 [inlined]
 [10] arg_write(f::Downloads.var"#3#4"{Nothing, Vector{Pair{String, String}}, Float64, Nothing, Bool, Nothing, Nothing, String}, arg::Nothing)
    @ ArgTools C:\Users\tbucelis\AppData\Local\Programs\Julia-1.9.3\share\julia\stdlib\v1.9\ArgTools\src\ArgTools.jl:123
 [11] #download#2
    @ C:\Users\tbucelis\AppData\Local\Programs\Julia-1.9.3\share\julia\stdlib\v1.9\Downloads\src\Downloads.jl:232 [inlined]
 [12] download
    @ C:\Users\tbucelis\AppData\Local\Programs\Julia-1.9.3\share\julia\stdlib\v1.9\Downloads\src\Downloads.jl:221 [inlined]
 [13] download(url::String)
    @ Downloads C:\Users\tbucelis\AppData\Local\Programs\Julia-1.9.3\share\julia\stdlib\v1.9\Downloads\src\Downloads.jl:221
 [14] top-level scope
    @ REPL[16]:1

Running with verbose=true, shows the following before the error:

<
* schannel: failed to decrypt data, need more data
* schannel: failed to decrypt data, need more data
* schannel: failed to decrypt data, need more data
* schannel: failed to decrypt data, need more data
* schannel: failed to decrypt data, need more data
* schannel: server closed abruptly (missing close_notify)
* Closing connection 0
* schannel: shutting down SSL/TLS connection with github.com port 443
ERROR: RequestError: HTTP/1.1 200 OK (Failure when receiving data from the peer) while requesting https://github.com/plotly/plotly.js/releases/latest
Stacktrace:

I have environment variables set for proxy (HTTP_PROXY and HTTPS_PROXY), and JULIA_SSL_NO_VERIFY_HOSTS set to "**".

A simple call Downloads.download("https://www.google.com") works fine, as does using HTTP.get("https://github.com/plotly/plotly.js/releases/latest").

Any ideas on what the issue could be and how to go around fixing that?

Can’t reproduce, but then again, it sounds like this might be a proxy issue.

Agree that it’s something to do with proxy, it works on another device without the proxy.

However, what I find weird is that I have no issues using Pkg for package downloads (from github?), HTTP.get() on that url or downloading from other places (I tried an example I found and it works: Downloads.download("https://raw.githubusercontent.com/JuliaDynamics/DrWatson.jl/master/Project.toml").

But obviously in the case of Downloads.download("https://raw.githubusercontent.com/JuliaDynamics/DrWatson.jl/master/Project.toml") it doesn’t work. And the error is not clear enough for me to figure out what’s wrong myself.

This worked for me but also:

Downloads.download("http://github.com/plotly/plotly.js/releases/latest")

Note “http”, I dropped the s, for secure. Got me thinking, maybe it’s not needed, in this case. I see “latest” implying this may be a moving target (though not really or very slowly?). But for what it currently gives you, it could be verified with SHA, and only fall back to https download if it doesn’t match.

I see now HTTP.get worked for you too, and I’m not sure why it’s not affected by “schannel” (i.e. on Windows only I think), so that would be another option, but then needing an extra dependency, rather than relying on the (deprecated) stdlib one Downloads.

Thanks, using http:// instead of https:// gives the same error unfortunately.

If I understand correctly, latest simply redirects to the latest release tag (at least it does if I open the link in my browser).

Unfortunately HTTP is not really an option as Downloads is used within the PlotlyLight package which I am trying to import.

After trying it over and over, it seems to have worked once (for no reason other than trying again). It hasn’t worked again though or within the package I need it :weary:

Right it gave me: https://github.com/plotly/plotly.js/releases/tag/v2.27.1

where I could find and do with:

Downloads.download("http://github.com/plotly/plotly.js/archive/refs/tags/v2.27.1.zip")

I meant the package itself could use http rather than https, and for the file it gave me look for the right file to download in it, and do the same substitution as I did above.

Of course you should be able to use https also anyway, so this was just a suggested workaround.

I didn’t realize the original download you pointed me to, what the packages starts with gives me just:

<!DOCTYPE html>
<html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark"  data-a11y-animated-images="system" data-a11y-link-underlines="true">

[then there-in somewhere the right file]