502 Bad Gateway on NodeRED after new server spinup

On a hunch, I decided to spin up a brand new instance of Ubuntu on a separate computer system in hopes that maybe something was up with the previous server config.

After onboarding and installing only NodeRED, I’m met with the dreaded 502 Bad Gateway problem and a system error reading:

19-08-22 06:47:12 ERROR (MainThread) [hassio.api.ingress] Ingress error: Cannot connect to host 172.30.32.1:64950 ssl:None [Host is unreachable]

At this point, I’m thinking there are only a few areas that may need attention.

  1. Do I need to configure FirewallD in a specific way to get this to work or,
  2. Is there something I need to review in pfSense (my router).
  3. Could this be a problem tied to the Unifi switch (setting in Unifi controller?)

Every time I read this:

Note: The add-on is pre-configured out of the box! There is no need to add/change/update the server connection settings!

On the add-on information page, I feel like slamming my head into the desk. Mayday…need expertise. Thanks!

HOLY #%@#$. It’s FirewallD!

After stopping the firewalld service systemctl stop firewalld NodeRED fired up right away with no gateway problems.

So, now what?

I found this article (https://unrouted.io/2017/08/15/docker-firewall/) which outlines the issue, but my brain melted a bit.

Has anyone dealt with this issue before?

I had the same error. And it was the firewall

My configuration is Debian 9 + Hassio with docker.

And received the code 502.

I added on Debian firewalls, I accept rules for port 1880 when ips calls 172.16.0.0/12, which are ips dockers.

After that, I solved my problem.