Neither am I with that particular error.
download() doesn’t support HTTP/3 (that always uses https), I believe, neither HTTP/2 apparently (at least not always).
In many cases you could change https → http, and both are supported (by the web server; the latter always by Julia). In most cases it would work, but not here (an issue with the server):
julia> using Downloads
julia> Downloads.download("http://www.hkex.com.hk/eng/stat/smstat/dayquot/d250806e.htm")
ERROR: RequestError: Operation too slow. Less than 1 bytes/sec transferred the last 20 seconds while requesting http://www.hkex.com.hk/eng/stat/smstat/dayquot/d250806e.htm
however this worked quickly (so seemingly NOT the same web server serving the above file despite same host?)::
julia> Downloads.download("http://www.hkex.com.hk/")
"/tmp/jl_HMxKLOjudO"
The issue seems to be Julia’s built in dependency curl (at least how Julia configures it), and I would usually think curl
handles anything out there…:
[2] with_handle(f::Downloads.var"#23 #24"{IOStream, Base.DevNull, Nothing, Vector{Pair{String, String}}, Float64, Nothing, Bool, Nothing, Bool, Nothing, String, Bool, Bool}, handle::Downloads.Curl.Easy)
@ Downloads.Curl ~/.julia/juliaup/julia-1.12.0-rc1+0.x64.linux.gnu/share/julia/stdlib/v1.12/Downloads/src/Curl/Curl.jl:105
I looked into if better on 1.12-rc1, or any newer (no).
I’m not sure why this rather worked, seemingly it instructs using the older HTTP/1.1
julia> hr = HTTP.get(“https://www.hkex.com.hk/eng/stat/smstat/dayquot/d250806e.htm”)HTTP.Messages.Response:“”"HTTP/1.1 200 OK
…
24411176-byte body“”"
Maybe Curl config in Julia can be changed to always work?
$ curl https://www.hkex.com.hk/eng/stat/smstat/dayquot/d250806e.htm
curl: (92) HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2)
$ wget https://www.hkex.com.hk/eng/stat/smstat/dayquot/d250806e.htm
--2025-08-07 18:23:23-- https://www.hkex.com.hk/eng/stat/smstat/dayquot/d250806e.htm
Resolving www.hkex.com.hk (www.hkex.com.hk)... 2.19.176.170, 2.19.176.185
Tengist www.hkex.com.hk (www.hkex.com.hk)|2.19.176.170|:443... connected.
HTTP fyrirspurn send, bíð svars... [HTTP query sent, waiting for answer]
opened 12:35PM - 14 Oct 23 UTC
closed 05:31PM - 14 Oct 23 UTC
HTTP/2
not-a-curl-bug
### I did this
I have a small app to performs curl requests and returns json … from an endpoint, it all works fine locally on my machine however when I run the same code on my remote DigitalOcean droplet I get the following error:
`Curl error: HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2)Curl error: HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2`
Running cURL requests via a DigitalOcean droplet running the following:
Ubuntu 22.04 LTS
PHP 8.2.8
MySQL 8.0.34-0ubuntu0.22.04.1 for Linux on x86_64
### I expected the following
A curl request is to be completed successfully and return some array data
### curl/libcurl version
Curl 7.8.1.0
curl --version
curl 7.81.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.15
Release-Date: 2022-01-05
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets zstd
### operating system
Ubuntu 22.04 LTS
To replicate this I can curl the URL directly from my PHP8.2.8 DigitalOcean droplet
`curl -v https://proclubs.ea.com/api/fc/clubs/matches?matchType=leagueMatch&platform=common-gen5&clubIds=542851`
Response
```
curl -v https://proclubs.ea.com/api/fc/clubs/matches?matchType=leagueMatch&platform=common-gen5&clubIds=542851
[1] 54883
[2] 54884
* Trying 23.194.14.89:443...
* Connected to proclubs.ea.com (23.194.14.89) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
[2]+ Done platform=common-gen5
* CAfile: /etc/ssl/certs/ca-certificates.crt
* CApath: /etc/ssl/certs
* TLSv1.0 (OUT), TLS header, Certificate Status (22):
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS header, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS header, Finished (20):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.2 (OUT), TLS header, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
* subject: C=US; ST=CALIFORNIA; L=Redwood City; O=Electronic Arts, Inc.; CN=www.origin.com
* start date: Jul 18 00:00:00 2023 GMT
* expire date: Jul 17 23:59:59 2024 GMT
* subjectAltName: host "proclubs.ea.com" matched cert's "*.ea.com"
* issuer: C=US; O=DigiCert Inc; CN=DigiCert SHA2 Secure Server CA
* SSL certificate verify ok.
* Using HTTP2, server supports multiplexing
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* Using Stream ID: 1 (easy handle 0x563fa00f4e90)
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
> GET /api/fc/clubs/matches?matchType=leagueMatch HTTP/2
> Host: proclubs.ea.com
> user-agent: curl/7.81.0
> accept: */*
>
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2)
* stopped the pause stream!
* Connection #0 to host proclubs.ea.com left intact
curl: (92) HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2)
```
PHP CODE
```php
private static function initializeCurl(string $url): CurlHandle|false
{
// exampleURL
$url = 'https://proclubs.ea.com/api/fc/clubs/matches?matchType=leagueMatch&platform=common-gen5&clubIds=542851;
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2,
CURLOPT_FAILONERROR => true,
CURLOPT_REFERER => self::REFERER,
CURLOPT_HTTPHEADER => [
'accept-language: en-US,en;q=0.9,pt-BR;q=0.8,pt;q=0.7',
'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36',
],
]);
return $curl;
}
```
“Closed as not planned” there at Curl/upstream, apparently because “not-a-curl-bug” then what, bad config at that web server?