Hass.io and node red get 502: Bad Gateway

Hi Guys! I think this is because of SSL problem!! I changed “ssl”: false then worked perfectly!

5 Likes

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.

Can confirm it works now.

Hey I’m still having issues with this. I installed Node-red and i’m unable to get into it. It keeps giving me 502:Bad Gateway error.

I solved mine by changing the config to

SSL: false
credential_secret: cryptokey
3 Likes

i hade the same issue with the last version of HA and Node-red.
what i did to fix it is set a strong password and secret id for recovery the went to the log pressed refresh button many times until it stops shows any messages.
after that started the Nodered and it worked fine.

What worked for me (next to the username, password), was opening Node red on my mobile app. If you then open it in the browser on your pc/laptop it also appears.

Same for me, disable SSL and enter a Cryptokey. The log provides you with the errors, which enables you to fix them.

Using @thecodemonkeyau 's solution I was able to circumvent the Bad Gateway error and launch Node-Red.

I shouldn’t have to disable SSL. Referring to Documentation included with the Add-On;

Option: ssl
Enables/Disables SSL (HTTPS) on the web interface. Set it true to enable it, false otherwise.

Note: The SSL settings only apply to direct access and has no effect on the Ingress service.

Option: certfile
The certificate file to use for SSL.

Note: The file MUST be stored in /ssl/, which is the default

Option: keyfile
The private key file to use for SSL.

Note: The file MUST be stored in /ssl/, which is the default

While troubleshooting the issue, I noticed the directory noted above (/ssl/) was not created during the install process. Given it’s absence I’m assuming Node-Red cannot load the;

certfile: fullchain.pem
keyfile: privkey.pem

Could this be the real cause of the problem - the application fails to start unless @thecodemonkeyau 's solution is utilized. BTW: what why does it work when credential_secret: is set to cryptokey

Why is it that the /ssl/ directory is not located in the /config/ files area?

1 Like

Solution: make a complex password 100% worked

I originally put a generic password on the config file and after looking at the log I noticed it said error, password is in the i am pwned database. I changed my password to something more complex, saved it, made sure ssl was set to false. Restarted node-red and watched the logs. I waited for it to say it was loaded and it 100% worked for me!

5 Likes

Just had the same experience, I had to set password (used same as my user) and disable SSL. I went easiest possible path, my HA is not exposed to the world so I don’t care much.

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

Back up HAss
Uninstall Node-Red
I renamed the folder in the config / node-red directory at: config / node-red-old
I installed and configured Node-Red
Bad Gateway 502 … disappeared …
:laughing:
Delete directory… config/node-red-old

I had the same error.
When opening Node-Red with the WebUI, it works.
After that, it also works the normal way again.

This also fixed mine. Thank you @thecodemonkeyau

After changing the configuration of node_red like following:

‘’’
credential_secret: ‘!secret node_red’
dark_mode: false
http_node:
username: ‘’
password: ‘’
http_static:
username: ‘’
password: ‘’
ssl: false
certfile: fullchain.pem
keyfile: privkey.pem
require_ssl: true
system_packages: []
npm_packages: []
init_commands: []

‘’’

I had the same problem. However, if I click on Developer Tools -> Events -> Available Events, there is a nodered (1 listener) link. Clicking on that solves the problem for me

1 Like

This is the solution, I just had the same problem and now it’s solved.

So stop Node-Red, clear the logs, click on another item in the left menu, go to Supervisor, Node-Red and start. After 1 minute click on Open Web UI.

https://community.home-assistant.io/t/hass-io-and-node-red-get-502-bad-gateway/115328/12

1 Like

Thanks! that got me working too. Nice find!

This resolved my issue - Thanks

+1 to all the helpers that commented on this thread. I honestly didn’t believe those steps would work. Plus, Node-Red still opened separately in my browser window after starting it from terminal, but not in HA. Lo and behold, waiting that minute after doing everything before that worked! Thank you!

1 Like

Worked for me! Upvote!