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

**URL:** https://discourse.julialang.org/t/downloads-download-in-plotlylight-failing-for-github-plotly-js-repository/106226
**Category:** General Usage
**Tags:** proxy, libcurl, http, download, plotlylight
**Created:** [November 14, 2023, 5:01pm UTC](https://discourse.julialang.org/t/downloads-download-in-plotlylight-failing-for-github-plotly-js-repository/106226 "2023-11-14T17:01:27Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Titas22](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/titas22/32/39209_2.png) [@Titas22](https://discourse.julialang.org/u/Titas22)
#### Post date: [November 14, 2023, 5:01pm UTC](https://discourse.julialang.org/t/downloads-download-in-plotlylight-failing-for-github-plotly-js-repository/106226/1 "2023-11-14T17:01:27Z")

</div>

Hi,

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

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

```

I end up getting the following error:

```plaintext
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:

```julia
<
* 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?

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [November 14, 2023, 5:31pm UTC](https://discourse.julialang.org/t/downloads-download-in-plotlylight-failing-for-github-plotly-js-repository/106226/2 "2023-11-14T17:31:17Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Titas22](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/titas22/32/39209_2.png) [@Titas22](https://discourse.julialang.org/u/Titas22)
#### Post date: [November 14, 2023, 5:49pm UTC](https://discourse.julialang.org/t/downloads-download-in-plotlylight-failing-for-github-plotly-js-repository/106226/3 "2023-11-14T17:49:26Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [November 14, 2023, 6:00pm UTC](https://discourse.julialang.org/t/downloads-download-in-plotlylight-failing-for-github-plotly-js-repository/106226/4 "2023-11-14T18:00:07Z")

</div>

This worked for me but also:

```julia
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.

---

<div class="post-metadata">

### Author: ![Titas22](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/titas22/32/39209_2.png) [@Titas22](https://discourse.julialang.org/u/Titas22)
#### Post date: [November 14, 2023, 6:06pm UTC](https://discourse.julialang.org/t/downloads-download-in-plotlylight-failing-for-github-plotly-js-repository/106226/5 "2023-11-14T18:06:15Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Titas22](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/titas22/32/39209_2.png) [@Titas22](https://discourse.julialang.org/u/Titas22)
#### Post date: [November 14, 2023, 6:17pm UTC](https://discourse.julialang.org/t/downloads-download-in-plotlylight-failing-for-github-plotly-js-repository/106226/6 "2023-11-14T18:17:34Z")

</div>

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 😩

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [November 24, 2023, 3:42pm UTC](https://discourse.julialang.org/t/downloads-download-in-plotlylight-failing-for-github-plotly-js-repository/106226/7 "2023-11-24T15:42:50Z")

</div>

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

where I could find and do with:

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

```

> [@Titas22](#):
>
> Unfortunately `HTTP` is not really an option as `Downloads` is used within the `PlotlyLight` package which I am trying to import.

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:

```julia
<!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]
