arch-minecraftbedrockserver icon indicating copy to clipboard operation
arch-minecraftbedrockserver copied to clipboard

Local network Health Check always fail

Open LagunAPaTa opened this issue 7 months ago • 4 comments

My server is local network

HEALTHCHECK &{["CMD-SHELL" "curl -s https://github.com &>/dev/null || kill 1"] "1m0s" "3s" "0s" "0s" '\x00'}

Always fail

so reboot again and again

LagunAPaTa avatar Jul 08 '25 10:07 LagunAPaTa

Do you not have internet connectivity?, this is doing a simple curl to ensure internet connectivity is working from the container.

binhex avatar Jul 08 '25 11:07 binhex

Hi, I'm having similar problems, where health check script is stuck/failing.

I checked the /usr/local/bin/system/scripts/docker/healthcheck.sh (healthcheck.sh) script and did some experiments, here's why it's not working in my setup:

The script contains three checks, which are check_dns, check_https and check_process. check_process works, as the MCBE server process is running as expected. However, check_dns and check_https are both failing in my setup.

I manually ran the check in check_dns and get:

> nslookup google.com
nslookup: parse of /etc/resolv.conf failed

So it seems like /etc/resolv.conf has some issues?

# Generated by Docker Engine.
# This file can be edited; Docker Engine will not make further changes once it
# has been modified.

nameserver 192.168.31.1
nameserver fe80::46df:65ff:fe93:2ab%br0

# Based on host file: '/etc/resolv.conf' (legacy)
# Overrides: []

So it turns out this file is copied over from host OS (unRAID in my case) by docker engine, and the IPv6 nameserver on br0 interface doesn't exist in this container, removing that line does make nslookup happy. (but that's not really a solution because recreating the container resets this file)

check_https is another problem, because I'm from a country where google.com is censored, that command is stuck curl-ing google forever, unless I set a proxy server.

In check_https case, one possible fix is to add an optional env var for specifying the domain to check. Tho I'm not sure how to solve the check_dns case. Maybe also an env var to simply disable all network related checks? At least in this case, I don't think my minecraft server requires any non-local internet connections (correct me if im wrong), so that could be a good idea?

SteveHawk avatar Aug 10 '25 20:08 SteveHawk

So it turns out this file is copied over from host OS (unRAID in my case) by docker engine, and the IPv6 nameserver on br0 interface doesn't exist in this container, removing that line does make nslookup happy. (but that's not really a solution because recreating the container resets this file)

I have now specified IPv4 for nslookup, this should fix the issue, will be live in next image.

check_https is another problem, because I'm from a country where google.com is censored, that command is stuck curl-ing google forever, unless I set a proxy server.

I have just put in a workaround for this, so in the next image built you will be able to specify the hostname you want the check to use, this is done via env var HEALTHCHECK_HOSTNAME and defaults to google.com if not specified, set it to whatever you like.

binhex avatar Aug 23 '25 11:08 binhex

I have now specified IPv4 for nslookup, this should fix the issue, will be live in next image.

Tried the command, doesn't seem to work. nslookup still complains about the parsing failure, so it probably NEED that file to be correct to do anything.

Feeling like this must be an unraid or docker's bug, because it also appears in every other container that doesn't use host or br0 network. I do need IPv6 to work, so trying to see if there's any way to bypass this.

SteveHawk avatar Aug 23 '25 13:08 SteveHawk