Home Assistant MTU Woes

By Dale Clutterbuck on on Permalink.

So I was having trouble upgrading Home Assistant OS from 14.1 -> 14.2.

I was getting the following error:

Failed to perform the action update/install. Error updating Home Assistant Operating System: Can't fetch OTA update from https://os-artifacts.home-assistant.io/14.2/haos_ova-14.2.raucb: Cannot connect to host github.com:443 ssl:default [None]

After a lot of Googling and debugging this seemed to be an issue with my over-complicated home lab setup - Home Assistant is running in a Kubevirt VM on Mirok8s. Microk8s comes with Calico with VXLAN and the additional overlay reduces the default MTU. However the docker containers running on HAOS default to 1500. When the supervisor tries to resolve github, the fragmented packets don't get responded to.

First things first - need to get on the console for HAOS:

kubectl virt console vm-homeassistant

Then we check the network config:

# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute
       valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc fq_codel state UP group default qlen 1000
    link/ether e2:b2:3b:f9:22:c7 brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.2/24 brd 10.0.2.255 scope global dynamic noprefixroute enp1s0
       valid_lft 85562858sec preferred_lft 85562858sec
    inet6 fe80::93f4:3cbe:3e81:ffe6/64 scope link noprefixroute
       valid_lft forever preferred_lft forever

And here we see the MTU: enp1s0: <-snip-> mtu 1450 qdisc fq_codel state UP group default qlen 1000

So we need to connect to the console of HAOS. Then connect to the shell of the supervisor container:

docker exec -it hassio_supervisor bash
b5815e61a9a8:/# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
21: eth0@if22: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP
    link/ether 02:42:ac:1e:e8:02 brd ff:ff:ff:ff:ff:ff
    inet 172.30.232.2/23 brd 172.30.233.255 scope global eth0
       valid_lft forever preferred_lft forever
23: eth1@if24: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP
    link/ether 02:42:ac:1e:20:02 brd ff:ff:ff:ff:ff:ff
    inet 172.30.32.2/23 brd 172.30.33.255 scope global eth1
       valid_lft forever preferred_lft forever

And here we see the MTU: 21: eth0@if22: <-snip-> mtu 1500 qdisc noqueue state UP

Time to update the MTU:

b5815e61a9a8:/# ip link set mtu 1450 eth0

And then we try again! (via the console or WebUI... doesn't matter)

To do via the console just leave the supervisor container then run ha os update


Comments are welcome. You can email me at hi @ this domain.