ESPhome Add-on stuck on: Starting NGINX

Hello everyone!

I am just starting with Home Assistant because I have a couple of Projects i would like to try with ESPhome.

Installed Home Assistant Supervised on my home server:

core-2022.4.6

supervisor-2022.04.0

Operating System: Debian GNU/Linux 11 (bullseye)

Docker version: 20.10.14

ESPHome: 2022.4.0

This is a fresh install and I did not have trouble through the install. But for some reason i cannot access the ESPhome Web UI.I get this error in the Log:

22-04-23 22:26:55 ERROR (MainThread) [supervisor.api.ingress] Ingress error: Cannot connect to host 172.30.32.1:65031 ssl:default [Connect call failed (‘172.30.32.1’, 65031)]

and the ESPhome Log seem to be stuck on:

[services.d] starting services [services.d] done.

[22:24:04] INFO: Waiting for dashboard to come up…

[22:24:04] INFO: Starting ESPHome dashboard… 2022-04-23 22:24:05,053 INFO Starting dashboard web server on unix socket /var/run/esphome.sock and configuration dir /config/esphome…

[22:24:05] INFO: Starting NGINX…

And it seems to be stuck there . even after a restart and a reinstall.

Does anyone have a way to deal with this situation ? appreciate the Help

Edit:
It seems that supervisor is unable to restart. I keep getting this response:

‘Supervisor.restart’ blocked from execution, system is not running - CoreState.STARTUP

The log:

22-04-23 22:57:22 WARNING (MainThread) [supervisor.jobs] ‘Supervisor.restart’ blocked from execution, system is not running - CoreState.STARTUP

22-04-23 22:58:25 ERROR (MainThread) [supervisor.api.ingress] Ingress error: Cannot connect to host 172.30.32.1:65031 ssl:default [Connect call failed (‘172.30.32.1’, 65031)]

I also got this through journalctl -f

[UFW BLOCK] IN=eno1 OUT= MAC=00:25:90:f3:f1:36:00:04:4b:8a:80:af:08:00 SRC=192.168.87.21 DST=192.168.87.20 LEN=715 TOS=0x00 PREC=0x00 TTL=64 ID=12476 DF PROTO=UDP SPT=40902 DPT=39067

The UFW log just shows a really long list of ports:

[ 6994.103115] [UFW BLOCK]

I did read in another thread that a user was having the same issues with ESPhome using Home Assistant Supervised install. So maybe that’s the issue.

I gave up on a supervised install ages ago, if I was installing on a server now I would use a VM.,

Thanks for pointing this out, @moutasem1989 !

In my case, I can’t just disable ufw. In fact, no one should just drop the firewall. So I checked all the ports that were blocked by it, related to ESPHome and enabled just those. Would be nice if the docs would mention these, alongside their purpose. I don’t feel comfortable to open up a bunch of ports w/o knowing what they’re for.

I have no idea if these are fixed or changed dynamically, but so far enabling just the ports logged as being blocked by ufw seemed to have worked.

sudo ufw allow 65031, 58625, 34362, 62914, 55070, 46038, 48958

I identified these by following (tailing) the syslogs of the host machine and filtering for UFW BLOCK

journalctl -f | grep "UFW BLOCK"

or without grep to tail the full log

Note that you have to start and navigate to the ESPHome dashboard in order for the UFW BLOCK records to show up while you’re running the above command. If you want to look in history log, remove the -f - but you’ll probably get a ton of records.

The record should look like below, where the port to unblock is the value of the DPT key. In the example below, 48958

[UFW BLOCK] IN=eno1 OUT= MAC=<...> SRC=<...> DST=<...> LEN=634 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=9999 DPT=48958 LEN=614
2 Likes