Hass.io and node red get 502: Bad Gateway

Hi everybody, since the last update of HA, I have bad gateway error 502… with Node Red.

HA Version core-2021.4.4 on Raspbery PI4 32bit

I made a totally new installation and i have the same issue, I can open Node Red into HA or directly in Web UI but after some second, I have the message “Lost Connection” and after the connexion come back, and lost… it’s cyclic

See below the error:

> 21-04-14 18:21:52 INFO (MainThread) [supervisor.api.proxy] WebSocket access from a0d7b954_nodered
> 21-04-14 18:21:52 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request running
> 21-04-14 18:21:52 INFO (MainThread) [supervisor.api.proxy] WebSocket access from a0d7b954_nodered
> 21-04-14 18:21:52 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request running
> 21-04-14 18:21:58 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API connection is closed
> 21-04-14 18:21:58 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API connection is closed
> 21-04-14 18:21:59 ERROR (MainThread) [supervisor.api.ingress] Ingress error: 502, message='Invalid response status', url=URL('http://172.30.32.1:62597/comms')
> 21-04-14 18:22:01 ERROR (MainThread) [supervisor.api.ingress] Ingress error: 502, message='Invalid response status', url=URL('http://172.30.32.1:62597/comms')
> 21-04-14 18:22:03 ERROR (MainThread) [supervisor.api.ingress] Ingress error: 502, message='Invalid response status', url=URL('http://172.30.32.1:62597/comms')
> 21-04-14 18:22:05 ERROR (MainThread) [supervisor.api.ingress] Ingress error: 502, message='Invalid response status', url=URL('http://172.30.32.1:62597/comms')
> 21-04-14 18:22:07 ERROR (MainThread) [supervisor.api.ingress] Ingress error: 502, message='Invalid response status', url=URL('http://172.30.32.1:62597/comms')
> 21-04-14 18:22:13 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request initialize
> 21-04-14 18:22:13 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request initialize
> 21-04-14 18:22:13 INFO (MainThread) [supervisor.api.proxy] WebSocket access from a0d7b954_nodered
> 21-04-14 18:22:13 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request running
> 21-04-14 18:22:13 INFO (MainThread) [supervisor.api.proxy] WebSocket access from a0d7b954_nodered
> 21-04-14 18:22:14 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request running
> 21-04-14 18:22:19 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API connection is closed
> 21-04-14 18:22:19 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API connection is closed
> 21-04-14 18:22:21 ERROR (MainThread) [supervisor.api.ingress] Ingress error: 502, message='Invalid response status', url=URL('http://172.30.32.1:62597/comms')
> 21-04-14 18:22:23 ERROR (MainThread) [supervisor.api.ingress] Ingress error: 502, message='Invalid response status', url=URL('http://172.30.32.1:62597/comms')
> 21-04-14 18:22:25 ERROR (MainThread) [supervisor.api.ingress] Ingress error: 502, message='Invalid response status', url=URL('http://172.30.32.1:62597/comms')
> 21-04-14 18:22:27 ERROR (MainThread) [supervisor.api.ingress] Ingress error: 502, message='Invalid response status', url=URL('http://172.30.32.1:62597/comms')
> 21-04-14 18:22:29 ERROR (MainThread) [supervisor.api.ingress] Ingress error: 502, message='Invalid response status', url=URL('http://172.30.32.1:62597/comms')

Do you have any solution?

UPDATE: I found the problem, it’s was somes Nodes lost de relation between Home Assistant and Node Red, Node Red getting kicked by HA. I delleded all of my flows and creat a new relation… Now everything is ok

Thanks

Thank you.

This worked!!

Try this

Click on the conf tab of the Node-red add-on and basically paste this in. This is my configuration and it just works.

credential_secret: redacted but something difficult to guess
dark_mode: false
http_node:
username: redacted but same as HA login
password: redacted but same as HA password
http_static:
username: redacted but same as HA login
password: redacted but same as HA password
ssl: false
certfile: fullchain.pem
keyfile: privkey.pem
require_ssl: false
system_packages: []
npm_packages: []
init_commands: []

Now obviously, if you want dark mode or SSL etc., you’ll need to update this as required, but for now let’s try and get straight into node-red. Also some of this may or may not be necessary, but as I mentioned before, this just works for me. If you want to go through the full configuration options, you can check here: https://github.com/hassio-addons/addon-node-red/blob/master/node-red/DOCS.md

In order to preserve the correct lay out, here’s an example of it on the page:

1 Like

It works for me too. Thanks!

Strange shit the nodered settings.js missed a comma.

1 Like

I just about tried everything in this thread. Went back and saw this simple tip, and that solved it :slight_smile:

This resolved my issue too - Thanks

Thank you this resolved my issue 100%
From a TOTAL Newby

Thanks, you saved my day!