Intermittant network connectivity in Docker

Got a super weird problem. The last few days I’ve noticed issues with HA. The weather app periodically reports unavailable, automations are intermittently not working.

Finally got some time to dig into it and it seems to be a network problem. HTTP requests are periodically failing in the container with “Network unreachable”. This occurs both to addresses on my local network and to the Internet.

I can re-create this by running a wget inside the container, e.g.

f0a135ba2c48:/config# wget https://api.glowmarkt.com -O - >/dev/null
Connecting to api.glowmarkt.com (154.51.163.100:443)
wget: server returned error: HTTP/1.1 404 Not Found
f0a135ba2c48:/config# wget https://api.glowmarkt.com -O - >/dev/null
Connecting to api.glowmarkt.com (154.51.163.100:443)
wget: can't connect to remote host (154.51.163.100): Network unreachable
f0a135ba2c48:/config# wget https://api.glowmarkt.com -O - >/dev/null
Connecting to api.glowmarkt.com (154.51.163.100:443)
wget: can't connect to remote host (154.51.163.100): Network unreachable
f0a135ba2c48:/config# wget https://api.glowmarkt.com -O - >/dev/null
Connecting to api.glowmarkt.com (154.51.163.100:443)
wget: server returned error: HTTP/1.1 404 Not Found

I’ve tried deleting and recreating the the container. I’ve updated to the latest version.

I run a number of containers on this host and the issue is isolated to this container, the others are fine. As is network connectivity on the host its self.

And it seems to be only HTTP(S)/TCP traffic impacted. Pings at least works fine.

I’m running Ubuntu 24.04. Anyone else seen this? I’m a bit stumped.

I have this problem already for a long time on my test system, which is also Ubuntu 24.04. It seems to be a problem with the linux kernel.
See also this thread: Can't reach GitHub (and other sites) when Home Assistant is running
For me issuing “sudo ip route flush cache” when home assistant is restarted helps to solve the problem until the next stop/start.

xxx

The cache flush didn’t work for me. I’ve rolled back to 6.8.0-94 and now all is good again. Hopefully there’s a fix in the works.

I’m also seeing this issues for various hosts, including the ones below, but could not yet recreate the issue using wget.
The connections seem to work fine for some time, then break, then work again.
I just noticed the issue since I switched from pihole (container) to technitium (container) yesterday. I will switch back to pihole and see if the issue comes up again, even if I don’t see how this switch could create an issue - there are no errors / blocks in the technitium logs for those addresses.
I’m on Ubuntu 24.04.3 LTS, kernel 6.8.0-101-generic

host emea.bff.cariad.digital:443 ssl:default [Network unreachable]
host opendata.dwd.de:443 ssl:default [Network unreachable]
supervisor Cannot connect to host version.home-assistant.io:443 ssl:default [Network unreachable]