Failed to establish a new connection: [Errno 113] No route to host'

I hope I can get some help with this issue. After I ‘sudo apt-get update’ my rpi3 today HASS won’t start anymore. The home-assistant.log shows the following:

17-01-22 23:51:26 braviarc.braviarc: [W] Exception: HTTPConnectionPool(host='192.168.112.32', port=80): Max retries exceeded with url: /sony/accessControl (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x6d91e650>: Failed to establish a new connection: [Errno 113] No route to host',

What could it be and how to get HA up and running again?

I’ve seen some problems recently on restarting HA, but a complete reboot resolves the issue.

While it shouldn’t be there IMO, I don’t think the ‘No route to host’ error is related to this. It is something else going on in HA. I have seen this for some time now - it is intermittent and the fact that I can ping my Pi by both hostname and IP address, leads me to believe it is some quirck in HA.

“No route to host” typically happens if your network configuration is faulty. What’s the output if you do “route -n” on the pi’s terminal?
Besides that, the message you’ve posted actually just tells us, that HASS wasn’t able to communicate with your Bravia TV. This would also happen if the device is turned off (which might be the more probable reason for the message). But a turned off device certainly shouldn’t stop HASS from starting up. So there’s got to be something after the message that indicates why HASS itself won’t start.

This is what I get when executing ‘route -n’:

Kernel IP routing table                                  
Destination     Gateway         Genmask         Flags Met
ric Ref    Use Iface                                     
0.0.0.0         192.168.1.1     0.0.0.0         UG    202
    0        0 eth0                                      
 192.168.1.0     0.0.0.0         255.255.255.0   U     202
     0        0 eth0

I think something else is going on then just my Bravia. After ‘sudo reboot’ this is the output:

17-01-23 00:45:49 braviarc.braviarc: [W] Exception: HTTPConnectionPool(host='192.168.112.32', port=80): Max retries exceeded with url: /sony/accessControl (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x6d49c2d0>: Failed to establish a new connection: [Errno 113] No route to host',))
17-01-23 02:52:10 pychromecast.socket_client: Heartbeat timeout, resetting connection
17-01-23 02:52:16 pychromecast.socket_client: Heartbeat timeout, resetting connection
17-01-23 02:52:16 pychromecast.socket_client: Failed to connect, retrying in 5.000000s
Traceback (most recent call last):
  File "/home/hass/.homeassistant/deps/pychromecast/socket_client.py", line 239, in initialize_connection
    self.socket.connect((self.host, self.port))
  File "/usr/lib/python3.4/ssl.py", line 840, in connect
    self._real_connect(addr, False)
  File "/usr/lib/python3.4/ssl.py", line 827, in _real_connect
    socket.connect(self, addr)
ConnectionRefusedError: [Errno 111] Connection refused

The chromecast errors will be fixed soon with a pull request. I’ve been having the same issue with my Vizio UHD TV’s built in cast - mainly because if the TV isn’t on, pychromecast can’t connect to it but doesn’t handle the error properly. The PR is supposed to fix this.

It looks like your bravia is on a different subnet than the rest of your network. The bravia reports 192.168.112.32 but your route table seems to think it’s on 192.168.1.1 What subnet are you really using?

I gave my Bravia a static ip adress now and it’s on the same subnet but still HA won’t start.

Ok, it just looked strange. That’s why I asked.

In that case we would still require some sort of log-output. I’m pretty sure it’s not the Bravia that is causing trouble. So somewhere after the Bravia error there has to be something else that could give us a hint why it’s not starting.

Hi,

The rest of the output is in my second post above. After that there is no new log file since HA doesn’t start.

The problem good thing about posting a problem here is that you get a bunch of people looking at the problem. The bad thing about posting a problem here is that you get a bunch of different ideas from people trying to figure out the problem. So with that said, lets go back to the beginning on a few things. The IP addresses being out of whack still bothers me. Why did the bravia have a different address (rhetorical question)?

Tell me more about your network setup.
Are you using DHCP to provide addresses to your,
TV:
HA:

What subnet are you on:192.168.112.xx or 192.168.1.xx

Are you running your RPI headless or are you connected via a local keyboard/mouse/monitor?

Can you post the output of the following commands
ifconfig
route

I’m wondering if something in your os config got buggered up by the os update.

I don’t know what happened but I turned off my RPI3 and rebooted and now it’s up and running! The TV and HA are now on the same subnet (192.168.1.xx), but I still have no clue why the Bravia was on a different subnet.

pi@RPI:~ $ ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:eb:e6:21:fe
          inet addr:192.168.1.22  Bcast:192.168.1.255  Mask:255.255.255.0

I really appreciate all your help by looking at the issue.

1 Like

No problem.

Did you have a power outage or anything? Sometimes I have similar problems if my network looses power. Sometimes the servers and things come back up before the router which hands out the addresses does. This leaves them to their own devices to figure out an IP address. Sometimes they guess wrong… Just a thought

1 Like

This would be a good time to look at assigning static DHCP leases in your router.

Nice catch Chip!

1 Like