itzg / docker-minecraft-bedrock-server

Containerized Minecraft Bedrock Dedicated Server with selectable version
MIT License
1.13k stars 215 forks source link

Download error with curl: (6) getaddrinfo() thread failed to start and the workaround #360

Closed AnyOfYou closed 11 months ago

AnyOfYou commented 11 months ago

Hi, I have a old linux server(Ubuntu 16.04 with glibc 2.23) running bedrock server with this project for years. Today when i try to pull the latest image and update the server version, it ends quickly with this error 'Download error with curl: (6) getaddrinfo() thread failed to start', the debug log is down below.

Details

++ pwd + echo ' current directory is /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 + for i in {1..3} current directory is /data 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://minecraft.azureedge.net/bin-linux/bedrock-server-1.20.32.03.zip + [[ -n https://minecraft.azureedge.net/bin-linux/bedrock-server-1.20.32.03.zip ]] + break 2 + [[ -z https://minecraft.azureedge.net/bin-linux/bedrock-server-1.20.32.03.zip ]] + [[ https://minecraft.azureedge.net/bin-linux/bedrock-server-1.20.32.03.zip =~ http.*/.*-(.*)\.zip ]] + VERSION=1.20.32.03 + rm -f restify.err + '[' '!' -f bedrock_server-1.20.32.03 ']' + [[ ! -n https://minecraft.azureedge.net/bin-linux/bedrock-server-1.20.32.03.zip ]] + [[ /tmp != /tmp ]] ++ basename https://minecraft.azureedge.net/bin-linux/bedrock-server-1.20.32.03.zip + TMP_ZIP=/tmp/bedrock-server-1.20.32.03.zip + echo 'Downloading Bedrock server version 1.20.32.03 ...' + curl -v -o /tmp/bedrock-server-1.20.32.03.zip -fsSL https://minecraft.azureedge.net/bin-linux/bedrock-server-1.20.32.03.zip Downloading Bedrock server version 1.20.32.03 ... * getaddrinfo() thread failed to start * Could not resolve host: minecraft.azureedge.net * Closing connection 0 curl: (6) getaddrinfo() thread failed to start + echo 'ERROR failed to download from https://minecraft.azureedge.net/bin-linux/bedrock-server-1.20.32.03.zip' + echo ' Double check that the given VERSION is valid' + exit 2

Its weird because the previous step (use restify to get latest server version) is successful, and i could download the zip file no problem with curl command on my server manually, the network of my server is okay.

So I go dig more about this issue, and found some related posts, u could read more at here and here. Although the details may have some differents, but I believe this issue is related with system's glibc version/docker/curl.

My temporary fix is add "--security-opt seccomp=unconfined" option with docker run command, its succeed, so I shard this finding to help.

itzg commented 11 months ago

Thanks for sharing.

I’m going to convert this to a discussion so it doesn’t get closed out.