[resolved] Trouble installing add-ons due to registry-1.docker.io 401 connection refused

I’ve installed hass.io on a Raspberry Pi 3 and configured it with a static IP. It’s working with Z-Wave, etc., all looks good. However, when trying to install any add-ons, they fail with:

20-01-31 22:40:25 ERROR (SyncWorker_9) [hassio.docker.interface] Can't install homeassistant/armv7-addon-check_config:3.1 -> 500 Server Error: Internal Server Error ("Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on [::1]:53: read udp [::1]:48270->[::1]:53: read: connection refused").

I’ve SSHed into the hassio server and confirmed it can reach the internet and that host via HTTPS, and DNS is working correctly, it seems. However, there seems to be some kind of credential issue when accessing that docker.io URL. My network is not using any proxy servers.

Any suggestion to try? I’m new to Docker so not so clear where to troubleshoot this. If more logs are needed, I can provide. I’ve also turned on SSH access to the host.

I should clarify: I guessed it was an authorization issue since running “wget ht…tps://registry-1.docker.io/v2/” from the host’s command line shows a 401 Auth required error. However, the hass.io system log itself shows only that "read: connection refused" error. I don’t know if this means there’s a network issue from the hass.io container or something else. Not sure where to look next, but every add-on install attempt yields this same result. Thank you!

RESOLVED – well, that was quick:

On a whim, I re-applied the steps to assign a static IP (using USB with config/network/…), and after that was imported, installing add-ons works.

The only difference was: in the non-working state, I configured two DNS servers: one was my local router (e.g. 192.168.1.1) and the other was Google’s (8.8.8.8). That didn’t work. The working configuration used only Google’s DNS servers (8.8.8.8 and 8.8.4.4). I don’t know why this has different behavior, as DNS queries to my local router work just fine (forwarded, resolved, etc.).

Anyway, hope this helps someone if they have the same issue in future!

2 Likes

I had the same problem- and your solution resolved it.Thanks!

For people on Ubuntu who experience the same issue:

nmcli con mod ipv4.dns “1.1.1.1 8.8.8.8”

will solve your issues too :slight_smile:

I had a similar issue and finally figured, that the docker.service didn’t wait for the NetworkManager to be fully healthy. The DNS for ipv6 was not fully online. Told docker.service to only come up after the NetworkManager-wait-online.service

# in /lib/systemd/system/docker.service

...
After=network-online.target firewalld.service containerd.service NetworkManager-wait-online.service
...

Oh - My - God ! Thank you so much Till! This is THE solution… :relieved:
I was looking for it since weeks

I’m well aware that this is an old post, but since I’m running into the same issue as OP I’d like to try your solution. The only problem is that I’m running into errors when attempting to modify docker.service:

image

And despite extensive googling I have no idea how to circumvent this. Any help is greatly appreciated

Edit: I’m running home assistant 2023.11.3 on vmware