[Solved] New Unifi Gateway: cannot connect to hass.io

A note on the resolution

When I woke up this morning, it occurred to me that there was one log I hadn’t thought to look at yesterday: homeassistant.log. Of course this is the first place I should have looked, but I didn’t.

I tend to overcomplicate things… I have a habit of overlooking simpler things and jumping straight to a more complicated problem. After all of the initial headache of having the Internet offline for 10 hours during which my impatient “clients” – my 11 & 13 year old sons – were unable to play their favorite games or watch YouTube, I am not surprised that my mind jumped to a more complex troubleshooting mode.

I am going to leave the original post, as well as my misguided followup reply below, in the hopes that someone might learn from my mistakes in the future.


Original Post

I have run hass.io on Ubuntu for couple of months now. Everything worked great until yesterday when I switched from a Ubiquiti EdgeRouter X Lite, to a Unifi Security Gateway. That appears to be when the Home Assistant website became unavailable.

I can connect via SSH so I rebooted the server, but that didn’t fix it. I did a port scan and 8123 is noticeably absent! I can connect to the Node-red add-on… but I can’t get in because it wants a login I don’t remember setting. But, that web server is responding to http requests. I can also connect to Samba to edit and browse the files.

I run docker on a separate unRaid server, but that has never posed a problem in the month I have ran them side-by-side. (And, as I mention in the post below the ip ranges are different: 172.17.x.x vs 172.30.x.x.)

Below I have gathered some logs and reports that may be helpful.


Port Scan Report

IP: 10.0.0.56
Ping: 6 ms
Hostname: hassio.local
Ports: 22,139,445,1880,1883,1884,3000,3306,8086

hassio-supervisor output

$ sudo hassio-supervisor
.
* INFO (MainThread) [__main__] Run Hass.io
* INFO (MainThread) [hassio.misc.dns] Start DNS port forwarding for host add-ons
* INFO (MainThread) [hassio.api] Start API on 172.30.32.2
* INFO (MainThread) [hassio.addons] Phase 'initialize' start 0 add-ons
* INFO (MainThread) [hassio.core] Hass.io reboot detected
* INFO (MainThread) [hassio.tasks] All core tasks are scheduled
* INFO (MainThread) [hassio.core] Hass.io is up and running
* INFO (MainThread) [hassio.api.proxy] Home Assistant WebSocket API request initialize
* INFO (MainThread) [hassio.api.proxy] WebSocket access from a0d7b954_nodered
* ERROR (MainThread) [hassio.api.proxy] Client error on WebSocket API Cannot connect to host 172.30.32.1:8123 ssl:False [Connection refused].
* INFO (MainThread) [hassio.api.proxy] Home Assistant WebSocket API request initialize
* INFO (MainThread) [hassio.api.proxy] WebSocket access from a0d7b954_nodered
* ERROR (MainThread) [hassio.api.proxy] Client error on WebSocket API Cannot connect to host 172.30.32.1:8123 ssl:False [Connection refused].

htop output

Here are some of the things I have tried:

  1. I tried reinstalling hass.io over the top of itself using Frenck’s commands (which is how I got it installed in the first place). But that didn’t help.
    https://bonani.tech/how-to-install-hass.io-on-ubuntu-server-18.04/

  2. Next I reviewed the supervisor error log, and tried a traceroute from my laptop to the docker ip (172.30.32.1). It appears to timeout after reaching an IP I do not recognize 10.166.0.1! Where does that IP set come from? I do not have an 10.166.0.0 subnet configured!

    traceroute to 172.30.32.1 (172.30.32.1), 64 hops max, 52 byte packets
     1  10.0.0.1 (10.0.0.1)  2.069 ms  1.481 ms  1.176 ms
     2  10.166.0.1 (10.166.0.1)  9.886 ms  8.346 ms  8.608 ms
     3  * * *
     4  * * *
    
  3. I checked, and the docker on my other server (running unraid) is using addresses in the 172.17.0.0 range, while my Ubuntu hassio server is using 172.30.0.0. So my suspicion there was a potential ip conflict does not appear to be.

  4. Now it occurs to me to look at homeassistant.log. Maybe it can’t load because hubs don’t have their original IP addresses. The log is filled is complaints that it cannot connect to my Insteon Hub… and my Hue Hub… and my Harmony Hub… I see where this is going. :man_facepalming:

I might be having a similar problem, did you solve this? how so?

Shoot, I don’t remember right now.

Have you looked for error messages in your homeassistant.log file? I can tell you that the problem became obvious to me when I saw the error in it.