itzg / docker-minecraft-bedrock-server

Containerized Minecraft Bedrock Dedicated Server with selectable version
MIT License
1.2k stars 226 forks source link

Health Check failure on macvtap container network with ipv6 enabled. #100

Closed kbrierly closed 4 years ago

kbrierly commented 4 years ago

Health check fails when the container is ran on top of macvtap network with ipv6 enabled Bedrock appears to be binding ports properly

# docker exec -it minecraft-flat '/bin/ss' '-a' | grep 191
udp    UNCONN  0       0               0.0.0.0:19132              0.0.0.0:*
udp    UNCONN  0       0                     *:19133                    *:*

heath check logs from inspect:

  "Health": {
                "Status": "unhealthy",
                "FailingStreak": 15223,
                "Log": [
                    {
                        "Start": "2020-10-10T00:45:43.251676132-05:00",
                        "End": "2020-10-10T00:45:43.389290046-05:00",
                        "ExitCode": 1,
                        "Output": "2020/10/10 00:45:43 failed to query bedrock server localhost:19132: timeout reading the response: read udp [::1]:35096->[::1]:19132: read: connection refused\n"
                    },
                    {
                        "Start": "2020-10-10T00:46:13.405775219-05:00",
                        "End": "2020-10-10T00:46:13.572008863-05:00",
                        "ExitCode": 1,
                        "Output": "2020/10/10 00:46:13 failed to query bedrock server localhost:19132: timeout reading the response: read udp [::1]:54201->[::1]:19132: read: connection refused\n"
                    },
                    {
                        "Start": "2020-10-10T00:46:43.589491012-05:00",
                        "End": "2020-10-10T00:46:43.724537235-05:00",
                        "ExitCode": 1,
                        "Output": "2020/10/10 00:46:43 failed to query bedrock server localhost:19132: timeout reading the response: read udp [::1]:52308->[::1]:19132: read: connection refused\n"
                    },
                    {
                        "Start": "2020-10-10T00:47:13.757200217-05:00",
                        "End": "2020-10-10T00:47:13.912538689-05:00",
                        "ExitCode": 1,
                        "Output": "2020/10/10 00:47:13 failed to query bedrock server localhost:19132: timeout reading the response: read udp [::1]:34256->[::1]:19132: read: connection refused\n"
                    },
                    {
                        "Start": "2020-10-10T00:47:43.917948253-05:00",
                        "End": "2020-10-10T00:47:44.062608234-05:00",
                        "ExitCode": 1,
                        "Output": "2020/10/10 00:47:44 failed to query bedrock server localhost:19132: timeout reading the response: read udp [::1]:39737->[::1]:19132: read: connection refused\n"
                    }
                ]
            }
        },
kbrierly commented 4 years ago

I believe the health check's target of localhost inside the container might be trying to connect to ipv6 localhost 19132 which is not listening on said port as it listens on 19133 for ipv6 based on default server properties configuration. I'd suggest changing the heatlth check to use 127.0.0.1 or the containers ip for the check.

itzg commented 4 years ago

That's a good suggestion about addressing 127.0.0.1 since it binds differently by protocol. I'll fix that.

In the meantime you can always alter the health check using --health-cmd.

kbrierly commented 4 years ago

Thanks.

itzg commented 4 years ago

This change is now available on Docker Hub.