itzg / docker-minecraft-bedrock-server

Containerized Minecraft Bedrock Dedicated Server with selectable version
MIT License
1.14k stars 219 forks source link

Download failing for 1.21.31.04 #461

Closed singleserveapps closed 1 week ago

singleserveapps commented 1 week ago

Using Truecharts on a TrueNAS Scale server.

App Version: latest Chart Version: 9.0.10 Last Updated: N/A Source: github.com/itzg/docker-minecraft-servergithub.com/truecharts/charts/tree/master/charts/stable/minecraft-bedrockhub.docker.com/r/itzg/minecraft-bedrock-server Developer: N/A Catalog: Truecharts Train: stable

Using /data to match uid and gid
Resolved UID=568 from match path
Resolved GID=568 from match path
Skipping uid/gid change since current user is not root Looking up latest version... Downloading Bedrock server version 1.21.31.04 ... curl: (92) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2) ERROR failed to download from https://www.minecraft.net/bedrockdedicatedserver/bin-linux/bedrock-server-1.21.31.04.zip Double check that the given VERSION is valid

teedog commented 1 week ago

Same issue here, the download of archives from https://www.minecraft.net with command line tools fails. Connecting with SSH to the NAS itself and using curl to download the archive results in curl (or wget) hanging after establishing the connection (see below). I helped myself with downloading the archive using a browser on windows, transferring it over with SCP, and unpacking it to the datadir - I consider this a hacky workaround. So far, I did not find out what causes curl and wget to hang (btw, it also hangs on windows, not only on the NAS). DNS resolution and TLS handshake both look good, it seems like the server is just not sending data at all.

$ curl -vvvvv https://www.minecraft.net/bedrockdedicatedserver/bin-linux/bedrock-server-1.21.31.04.zip
* Host www.minecraft.net:443 was resolved.
* IPv6: (none)
* IPv4: 185.22.140.8, 185.22.140.10
*   Trying 185.22.140.8:443...
* Connected to www.minecraft.net (185.22.140.8) port 443
* ALPN: curl offers http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
*  CAfile: none
*  CApath: /etc/ssl/certs
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 / X25519 / id-ecPublicKey
* ALPN: server accepted http/1.1
* Server certificate:
*  subject: C=US; ST=WA; L=Redmond; O=Microsoft Corporation; CN=*.minecraft.net
*  start date: May 29 20:28:20 2024 GMT
*  expire date: May 24 20:28:20 2025 GMT
*  subjectAltName: host "www.minecraft.net" matched cert's "*.minecraft.net"
*  issuer: C=US; O=Microsoft Corporation; CN=Microsoft Azure ECC TLS Issuing CA 04
*  SSL certificate verify ok.
*   Certificate level 0: Public key type EC/prime256v1 (256/128 Bits/secBits), signed using ecdsa-with-SHA384
*   Certificate level 1: Public key type EC/secp384r1 (384/192 Bits/secBits), signed using ecdsa-with-SHA384
*   Certificate level 2: Public key type EC/secp384r1 (384/192 Bits/secBits), signed using ecdsa-with-SHA384
* using HTTP/1.x
> GET /bedrockdedicatedserver/bin-linux/bedrock-server-1.21.31.04.zip HTTP/1.1
> Host: www.minecraft.net
> User-Agent: curl/8.5.0
> Accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
[HANGS FOREVER]
teedog commented 1 week ago

Update: I checked how Chrome on Windows is able to download the file by copying the curl line from network inspector, then deleting the headers one by one. The header that causes the download to hang is User-Agent. Once you change the download command to curl 'https://www.minecraft.net/bedrockdedicatedserver/bin-linux/bedrock-server-1.21.31.04.zip' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36' --output bedrock-server-1.21.31.04.zip, everything works as expected. The string of the user agent doesn't seem to matter; even if you set it to -H 'user-agent: MCS Downloader', the download will proceed and work.

curl -vvvv 'https://www.minecraft.net/bedrockdedicatedserver/bin-linux/bedrock-server-1.21.31.04.zip'   -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36'  --output bedrock-server-1.21.31.04.zip ; rm bedrock-server-1.21.31.04.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Host www.minecraft.net:443 was resolved.
* IPv6: (none)
* IPv4: 185.22.140.8, 185.22.140.10
*   Trying 185.22.140.8:443...
* Connected to www.minecraft.net (185.22.140.8) port 443
* ALPN: curl offers http/1.1
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
*  CAfile: none
*  CApath: /etc/ssl/certs
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
{ [35 bytes data]
* TLSv1.3 (IN), TLS handshake, Certificate (11):
{ [2427 bytes data]
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
{ [79 bytes data]
* TLSv1.3 (IN), TLS handshake, Finished (20):
{ [52 bytes data]
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* TLSv1.3 (OUT), TLS handshake, Finished (20):
} [52 bytes data]
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 / X25519 / id-ecPublicKey
* ALPN: server accepted http/1.1
* Server certificate:
*  subject: C=US; ST=WA; L=Redmond; O=Microsoft Corporation; CN=*.minecraft.net
*  start date: May 29 20:28:20 2024 GMT
*  expire date: May 24 20:28:20 2025 GMT
*  subjectAltName: host "www.minecraft.net" matched cert's "*.minecraft.net"
*  issuer: C=US; O=Microsoft Corporation; CN=Microsoft Azure ECC TLS Issuing CA 04
*  SSL certificate verify ok.
*   Certificate level 0: Public key type EC/prime256v1 (256/128 Bits/secBits), signed using ecdsa-with-SHA384
*   Certificate level 1: Public key type EC/secp384r1 (384/192 Bits/secBits), signed using ecdsa-with-SHA384
*   Certificate level 2: Public key type EC/secp384r1 (384/192 Bits/secBits), signed using ecdsa-with-SHA384
* using HTTP/1.x
} [5 bytes data]
> GET /bedrockdedicatedserver/bin-linux/bedrock-server-1.21.31.04.zip HTTP/1.1
> Host: www.minecraft.net
> Accept: */*
> user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
>
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [265 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [265 bytes data]
* old SSL session ID is stale, removing
{ [5 bytes data]
< HTTP/1.1 200 OK
< Content-Length: 56027291
< Content-Type: application/x-zip-compressed
< Content-MD5: gPPO/pbSYdvJnG61s5DuDA==
< Last-Modified: Mon, 30 Sep 2024 15:45:49 GMT
< Accept-Ranges: bytes
< ETag: "0x8DCE166F5659C92"
< Server: Windows-Azure-Web/1.0 Microsoft-HTTPAPI/2.0
< x-ms-request-id: b1a00868-601e-003d-7050-13be84000000
< x-ms-version: 2018-03-28
< Cache-Control: max-age=450445
< Expires: Mon, 07 Oct 2024 15:46:35 GMT
< Date: Wed, 02 Oct 2024 10:39:10 GMT
< Connection: keep-alive
< Server-Timing: cdn-cache; desc=HIT
< Server-Timing: edge; dur=2
< Server-Timing: ak_p; desc="1727865550729_3105262596_810342358_282_13244_15_38_-";dur=1
<
{ [15743 bytes data]
100 53.4M  100 53.4M    0     0  34.7M      0  0:00:01  0:00:01 --:--:-- 34.8M
* Connection #0 to host www.minecraft.net left intact
teedog commented 1 week ago

Created PR https://github.com/itzg/docker-minecraft-bedrock-server/pull/463 to add the user-agent to bedrock-entry.sh.

itzg commented 1 week ago

Re-pull the image. This has already been fixed in #459

singleserveapps commented 1 week ago

I apologize for creating a duplicate issue. This item has been resolved on my server. Thanks!

Resolution info: Attempting to start via TrueCharts Version: 9.0.10 is/was still failing even though it does appear to attempt to pull the latest docker-minecraft-bedrock-server image each time (?)

curl: (92) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2)

And, unfortunately, I'm currently unable to to update to the latest TrueCharts version (10.2.0) on my TrueNAS Scale server (for reasons: https://www.reddit.com/r/truenas/comments/1e1dxvk/truecharts_just_nuked_everything_in_response_to/) to see if that resolves the issue for the TrueCharts apps.

So, I was able to resolve on my TrueNAS Scale server by "migrating" my TrueCharts catalog docker-minecraft-bedrock-server apps to manually created/configured "custom" apps.