docker-minecraft-bedrock-server icon indicating copy to clipboard operation
docker-minecraft-bedrock-server copied to clipboard

Fails to download new version from minecraft.net

Open kennethx opened this issue 10 months ago • 6 comments

bds_1 | Looking up latest version... bds_1 | Downloading Bedrock server version 1.21.61.01 ... bds_1 | curl: (92) HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2) bds_1 | ERROR failed to download from https://www.minecraft.net/bedrockdedicatedserver/bin-linux/bedrock-server-1.21.61.01.zip bds_1 | Double check that the given VERSION is valid minecraft_bds_1 exited with code 2

kennethx avatar Feb 25 '25 17:02 kennethx

hmm, it seems the issue is not related to the agent after all, as the existing agent is accepted, as opposed to no agent at all, but I still have the issue when running docker-compose up

kennethx avatar Feb 25 '25 17:02 kennethx

I have been trying to figure out the issue. Somehow curl fauls, but if I try curl on the command line myself with the same options/url, it works.

I have tried it on two seperate servers both running: Server1: Description: Ubuntu 22.04.5 LTS Linux jarvis 5.15.0-122-generic #132-Ubuntu SMP Thu Aug 29 13:45:52 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Server2: Linux gallifrey 6.8.0-45-generic #45~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Sep 11 15:25:05 UTC 2 x86_64 x86_64 x86_64 GNU/Linux Description: Ubuntu 22.04.5 LTS

They are also on different ISPs.

I tried a 3rd option using WSL on my PC, and to my surprice, it works. Same yml file in all 3 cases.

services: bds: image: itzg/minecraft-bedrock-server environment: EULA: "TRUE" ports: - "19132:19132/udp" volumes: - ./data:/data stdin_open: true tty: true

Not even using volumes or anyting spechial. Why does it fail on ubuntu now? It has worked before...

kennethx avatar Feb 25 '25 19:02 kennethx

It downloads fine for me.

docker run -it --rm -e EULA=true -e DEBUG=true -v bds:/data itzg/minecraft-bedrock-server
DEBU[0000] Using /data to match uid and gid             
DEBU[0000] Resolved UID=0 from match path               
DEBU[0000] Resolved GID=0 from match path               
+ curlArgs=(-v)
++ id -a
++ ls -ld /data
+ echo 'DEBUG: running as uid=0(root) gid=0(root) groups=0(root) with drwxr-xr-x 2 root root 4096 Feb 11 14:08 /data'
DEBUG: running as uid=0(root) gid=0(root) groups=0(root) with drwxr-xr-x 2 root root 4096 Feb 11 14:08 /data
++ pwd
+ echo '       current directory is /data'
+ export HOME=/data
       current directory is /data
+ HOME=/data
+ downloadPage=https://www.minecraft.net/en-us/download/server/bedrock
+ [[ TRUE != TRUE ]]
+ case ${VERSION^^} in
+ echo 'Looking up latest version...'
+ lookupVersion serverBedrockLinux
+ platform=serverBedrockLinux
+ customVersion=
+ for i in {1..3}
Looking up latest version...
++ restify --user-agent=itzg/minecraft-bedrock-server --headers 'accept-language:*' --attribute=data-platform=serverBedrockLinux https://www.minecraft.net/en-us/download/server/bedrock
++ jq -r '.[0].href'
+ DOWNLOAD_URL=https://www.minecraft.net/bedrockdedicatedserver/bin-linux/bedrock-server-1.21.62.01.zip
+ [[ -n https://www.minecraft.net/bedrockdedicatedserver/bin-linux/bedrock-server-1.21.62.01.zip ]]
+ break
+ [[ -z https://www.minecraft.net/bedrockdedicatedserver/bin-linux/bedrock-server-1.21.62.01.zip ]]
+ [[ -n '' ]]
+ [[ https://www.minecraft.net/bedrockdedicatedserver/bin-linux/bedrock-server-1.21.62.01.zip =~ http.*/.*-(.*)\.zip ]]
+ VERSION=1.21.62.01
+ rm -f restify.err
+ [[ ! -f bedrock_server-1.21.62.01 ]]
+ [[ /data/.downloads != /tmp ]]
+ mkdir -p /data/.downloads
++ basename https://www.minecraft.net/bedrockdedicatedserver/bin-linux/bedrock-server-1.21.62.01.zip
+ TMP_ZIP=/data/.downloads/bedrock-server-1.21.62.01.zip
+ echo 'Downloading Bedrock server version 1.21.62.01 ...'
+ curl -v -o /data/.downloads/bedrock-server-1.21.62.01.zip -A itzg/minecraft-bedrock-server -fsSL https://www.minecraft.net/bedrockdedicatedserver/bin-linux/bedrock-server-1.21.62.01.zip
Downloading Bedrock server version 1.21.62.01 ...
*   Trying 184.28.41.29:443...
* Connected to www.minecraft.net (184.28.41.29) port 443 (#0)
* ALPN: offers h2,http/1.1
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  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):
{ [29 bytes data]
* TLSv1.3 (IN), TLS handshake, Certificate (11):
{ [2427 bytes data]
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
{ [78 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
* ALPN: server accepted h2
* 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.
} [5 bytes data]
* using HTTP/2
* h2h3 [:method: GET]
* h2h3 [:path: /bedrockdedicatedserver/bin-linux/bedrock-server-1.21.62.01.zip]
* h2h3 [:scheme: https]
* h2h3 [:authority: www.minecraft.net]
* h2h3 [user-agent: itzg/minecraft-bedrock-server]
* h2h3 [accept: */*]
* Using Stream ID: 1 (easy handle 0xaaaaecd0daf0)
} [5 bytes data]
> GET /bedrockdedicatedserver/bin-linux/bedrock-server-1.21.62.01.zip HTTP/2
> Host: www.minecraft.net
> user-agent: itzg/minecraft-bedrock-server
> accept: */*
> 
{ [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/2 200 
< content-length: 64902136
< content-type: application/x-zip-compressed
< content-md5: r+QZXSjx7pfKlGEqEYQgIA==
< last-modified: Tue, 25 Feb 2025 16:44:08 GMT
< accept-ranges: bytes
< etag: "0x8DD55BB9FE156D7"
< server: Windows-Azure-Web/1.0 Microsoft-HTTPAPI/2.0
< x-ms-request-id: 917878a4-001e-0014-56ad-8780f0000000
< x-ms-version: 2018-03-28
< cache-control: max-age=600106
< expires: Tue, 04 Mar 2025 17:45:09 GMT
< date: Tue, 25 Feb 2025 19:03:23 GMT
< server-timing: cdn-cache; desc=HIT
< server-timing: edge; dur=25
< strict-transport-security: max-age=7884000 ; includeSubDomains
< server-timing: ak_p; desc="1740510203661_3088853021_370314280_2462_14244_8_17_15";dur=1
< 
{ [5 bytes data]
* Connection #0 to host www.minecraft.net left intact
+ rm -rf -- bedrock_server 'bedrock_server-*' '*.so' release-notes.txt bedrock_server_how_to.html valid_known_packs.json premium_cache
+ bkupDir=backup-pre-1.21.62.01
+ rm -rf backup-pre-1.21.62.01
+ for d in behavior_packs definitions minecraftpe resource_packs structures treatments world_templates
+ [[ -d behavior_packs ]]
+ for d in behavior_packs definitions minecraftpe resource_packs structures treatments world_templates
+ [[ -d definitions ]]
+ for d in behavior_packs definitions minecraftpe resource_packs structures treatments world_templates
+ [[ -d minecraftpe ]]
+ for d in behavior_packs definitions minecraftpe resource_packs structures treatments world_templates
+ [[ -d resource_packs ]]
+ for d in behavior_packs definitions minecraftpe resource_packs structures treatments world_templates
+ [[ -d structures ]]
+ for d in behavior_packs definitions minecraftpe resource_packs structures treatments world_templates
+ [[ -d treatments ]]
+ for d in behavior_packs definitions minecraftpe resource_packs structures treatments world_templates
+ [[ -d world_templates ]]
+ ((  2 >= 0  ))
+ shopt -s nullglob
++ ls -td1
++ tail +3
+ unzip -q -n /data/.downloads/bedrock-server-1.21.62.01.zip
+ [[ /data/.downloads != /tmp ]]
+ rm -rf /data/.downloads
+ chmod +x bedrock_server
+ mv bedrock_server bedrock_server-1.21.62.01

itzg avatar Feb 25 '25 19:02 itzg

I tried on a third ubuntu server, and it worked there. same version of os. So I went back to the servers that failed, and I apt removed and purged docker and everything, still it did not work. docker ps -a listed nothing. but still it failed. That's when I ran docker images, and it listed quite a bit, two instances of itzg/minecraft-bedrock-server. I deleted them, and ran the docker-compose again. This time it actually downloaded everyting.

Somehow there old images messed it up. not sure why, shoulden't it download the newest version when I create a new docker?

Unless there is a way to prevent that I guess the issue can be closed =) thanks

kennethx avatar Feb 26 '25 23:02 kennethx

shoulden't it download the newest version when I create a new docker?

No. You have to explicitly do a docker compose pull to pull the updated image and reapply using docker compose up -d.

itzg avatar Feb 27 '25 01:02 itzg

i get same error curl or wget will stuck on wating result

i resolv it by using User-agent to access download url wget -U "Mozilla/5.0" https://www.minecraft.net/bedrockdedicatedserver/bin-linux/bedrock-server-1.21.83.1.zip

RhythmNz avatar Jun 02 '25 20:06 RhythmNz