[Errno -3] Temporary failure in name resolution

Periodically - I get this message in my homeassistant log file - not just for ‘myq’ but for any component that attempts to contact an http or https address.

I’m running 0.59.2 on a Raspberry Pi 3 - and the only way I’ve found to recover from this error once it starts occurring is to restart Home Assistant. It’s not a problem with my network or my router or my Raspberry Pi - at least not a persistent one. Once I’ve noticed that the error is occurring, I’ve logged into the Raspberry Pi with Termius and I’m able to ping the same addresses that Home Assistant is not able to communicate with. Perhaps there was a temporary problem on my network that triggered the problem. I can’t say for sure that there wasn’t. But if there was - it was a temporary problem. The bigger problem is that Home Assistant doesn’t seem to be able to recover once it occurs. It remains broken until a restart.

Does anyone know why this is happening - and if it’s been fixed in newer versions of HA? Or how I can add something to my configuration that detects when this is occurring and takes steps to recover from it without needing an application restart?

requests.exceptions.ConnectionError: HTTPSConnectionPool(host=‘myqexternal.myqdevice.com’, port=443): Max retries exceeded with url: /api/v4/UserDeviceDetails/Get (Caused by NewConnectionError(’<urllib3.connection.VerifiedHTTPSConnection object at 0x6364cf30>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution’,))

So - since I posted the above problem description - I’ve let HomeAssistant run for a few days - and it seems that this message does come and go. Given enough time, it seems to start working again on its own.

So - now the problem is - why does it take so long for Python/Home Assistant to recover from this “name resolution” problem? And how can I reduce that time? As stated above - I have already proven that my networking - and the Raspberry Pi network configuration is working properly - yet this name resolution error message continues to be logged in Home Assistant for several hours - during which my weather updates, location updates, ring and myQ connectivity as well as other things are stale or not working.

Is nobody else experiencing this issue?

I have just experienced this after rebooting my RP3. It’s the first time I have rebooted it after setting up SSL but that works fine so unsure what the issue is. I get the error for both Nest and DuckDNS. On the dash it says:

Invalid config: the following components could not be set up:
Nest
DuckDNS

However I have not changed the config for these and if I run a config check it’s all OK.
I am running HASS 0.62.1

Just bumping this becauses it has happened to me again. All of my components with outgoing connections (pushbullet and duckdns) do not work. I can’t set up Nest either for the same reason. All give the same error:

Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

Last time it just went away on its own randomly, but took the best part of 2 days, during which pushbullet would not work. Could do with a solution to fix instantly.

I have tried removing the components from the config, restarting HA, adding them again and restarting but to no avail. Have also tried all the different “solutions” to this error if you Google it but nothing works. Must be HA related. Really annoying.

Any pointers appreciated!!

A-ha! Figured it out… like all the Googling suggested it was a DNS error. What fixed it for me was changing the /etc/resolv.conf file. Inside mine all I had was:

# Generated by resolvconf
nameserver 192.168.0.1 

That being the IP of my router. As my ISP is notorious for having total shit DNS, I changed the above to Googles address. e.g.

# Generated by resolvconf
nameserver 8.8.8.8
nameserver 8.8.4.4

Then restarted HA and woohoo!

1 Like

Great that you were able to fix your problem - but if it was a problem with your ISP’s DNS Servers (as you suggested), you could have changed the DNS server settings configured on your router to use Google’s DNS servers instead of your ISP servers. That would have fixed your Home Assistant problem AND provided better DNS service for all of the other devices on your network.

However - the tests that you’ve performed are not conclusive. The problem could have been your Router itself handling/caching the DNS queries - or as you suggested, the DNS Servers from your ISP. Just thought I’d mention this in case you are having problems with any of your other devices.

1 Like