Node-RED Ingress issue (502 Bad Gateway)

Hello everyone,

I recently setup HA and my environment, and I very much want to use Node-RED. I have the latest Hass.io installed as well as everything else is up to date. I am getting the seemingly unsolved Ingress error with a 502 Bad Gateway. All of the details about my issue is located here: https://github.com/hassio-addons/addon-node-red/issues/260

Can anyone provide some assistant if possible?

Thank you.

Hi,

Something in the Node-RED Hassio add-on logs?
Try to change this:

  "ssl": true,

to that:

  "ssl": false,
1 Like

Thanks for the idea, I did change ssl to false and it didnt do anything. I think the prevalent error is:
ERROR (MainThread) [hassio.api.ingress] Ingress error: Cannot connect to host 172.30.32.1:62819 ssl:None [Host is unreachable]

As for the Node-RED hassio logs, there is nothing erroring out there. Like I said, Node-RED is working fine. This makes me think that either the add on isnt setup properly by the installer, or the docker container isnt exposing that port, or possibly the HA interface has the wrong connection string for node-red… but all of these cases are very out of the ordinary. I have also tried rebooting and reinstalling all of the software to no avail.

So just a thought was that docker wasnt exposing the container. I first tried to ping 172.30.32.1 and that worked.

So next I tried telnet to the port it seemed to want to reach: 62819 and it connected fine. So the port is accessible and the host is up. Hassio locally (connecting via ip) returns a 502 error as well as the proxy’d connection.

Try to set also require_ssl to false.
Or try to access through https://192.168.1.x:8123/a0d7b954_nodered

I have tried both of those already, ssl and require_ssl are both false. also as stated in the github repo local access isnt working either.

I learned from someone on the discord ingress is actually a 3 way communication so HA talks to the supervisor, the supervisor talks to node-red, so maybe its actually the supervisor having the issue? Which would make sense since the ingress error occurs in the supervisor logs…

Unfortunately I am not sure where to go from here.

I’m in nearly the same boat as you.

I can get to NodeRED, but I have to access it via the port through the URL and not through ingress.

It’s odd, because I have two locations, each running Ubuntu 16.04, each running HASS.io in Docker, and one of them can open NodeRED via ingress and another cannot.

The other one that won’t run is ESPHome. VSCode works…but not those other two. Can’t figure out why, but in the error log it has something to do with not being able to access the IP address of docker, despite it being available and pingable

I noticed that the more I messed with firewall rules on CentOS, the more that broke. Ingress for previously working things broke further.

I got fed up, made a backup of the OS and installed Ubuntu Server 18 on the machine, reinstalled hass.io and docker, and everything just worked out of the box. Maybe it was an issue with looking for AppArmour (which doesnt exist in CentOS land, its selinux for us). So for now, since everything is working on Ubuntu I am going to stick with that.

Thanks for anyone that tried to help.

im not sure why but its a browser issue. Im using chrome and kept getting 502 bad gateway. you have to do an empty cache and hard reload then it NR will load.

  1. Press F12
  2. right cilck the refresh button and click “empty cash and hard reload”
  3. Open NR web UI

Hope this helps.

2 Likes

Maybe in your case that was the solution, but in this one it definitely was not. It was a firewall issue on the machine and between the docker networks. Thanks though

What was the firewall issue? My system is running FirewallD

Got it.

How I fixed the Firewall issue.

That solved it for me! Thnx!

This saved me so much time and frustration. I was actually getting a 401 and was getting ready to give up (hence the desperation of looking at a post about a 502 error).

I had everything up and running properly but decided (as part of my Saturday project of setting up my new Unifi gear) to enable SSL throughout my HA. Everything is working now. I cleared cookies and then emptied the cache and the Node-Red UI now opens properly.

Hello
I also had this problem and was looking for a solution without success. I was able to solve the problem.

  1. Back up HAss
  2. Uninstall Node-Red
  3. I renamed the folder in the config / node-red directory at: config / node-red-old
  4. I installed and configured Node-Red
  5. Bad Gateway 502 … disappeared …
  6. :laughing:
  7. Delete directory… config/node-red-old
1 Like

After 5 hours, you fixed my issue. Thank you random internet person!