Node-Red add-on and 502 bad gateway

I tried installing Node-Red . twice.
In the docs it says:

The add-on works straight out the box! No need to configure a server!

ok. I get 502 Bad Gateway errors.
?Maybe because my mqtt server does NOT run on localhost but on a different local rpi?
so the Node-Red add-on does work straight out the box… I just cannot get to it.
Tried the F12-flush-cache like some ppl say it works. I however use Firefox and not Chrome., so that’s not working. (just flushing browser cache did not do anything)

Is it normal that NodeRed runs on 25% cpu? (rpi3)

It may be related to the node-red-contrib-actionflows issue. See the link below for a possible fix while the add-on is not updated.

2 Likes

It may be related to the node-red-contrib-actionflows issue. See the link below for a possible fix while the add-on is not updated.

@mbonani I’ve been using Node Red for a while now and noticed since the update every time I deploy I need to wait say 30 seconds when, for example, using an inject node to try out new flows. Else I also get 502 errors. I am correct assuming this is also this issue in node red you mentioned?

Screenshot 2022-02-05 at 20.15.56

Edit: I can confirm that for me this issue does not happen anymore when I disabled the 3 action-nodes from my pallet and restarted node-red.

3 Likes

tried a lot of stuff;
As homeassistant add-on, Node-Red only gives 502 errors, I cannot get it to work at all. Never did work.
As stand-alone on a different rpi3 it runs (mostly) smoothly with 80-100 nodes, 14 packages. Total flows.json size 1.2 MB.
I planned to let Node-Red as add-on do some mqtt smoothing for HA. That’s probably all HA can handle.

2 Likes

Disabling the ‘node-red-contrib-actionflows’ node from ‘Manage palette’ and restarting NR fixes this issue.

1 Like

config:

certfile: fullchain.pem
credential_secret: ''
http_node:
  password: ''
  username: ''
http_static:
  password: ''
  username: ''
init_commands:
  - npm uninstall node-red-contrib-actionflows
keyfile: privkey.pem
npm_packages: []
ssl: true
system_packages: []
theme: default

hard reboot done, still 502 gateway.

1 Like

ssl: true

Are you using ssl in your home assistant? If not, turn it to false.

4 Likes

I don’t know.
Set it to false, restarted HA, same error.

I think you also need to enter a credential_secret. Just something you make up.
And if you don’t know if your home assistant is behind an ssl certificate (https) then probably is not.
You can also look at the log files and see what error messages it returns there.

credentials do not make difference. I made up ‘F-this-sht’… no difference.
HA is behind ssl. all nicely configured.
Logs are filled to the brim with RF tranlations…I do not go there.
Node-Red updated …Current version: 11.0.0

What’s changed

This release two nodes have been removed from the built-in nodes.

The actionflows node isn't maintained anymore, while the http-request node has become obsolete and thus development on that node has stopped.
🚨 Breaking changes

    🔨 Remove node-red-contrib-actionflows @sinclairpaul (#1260)
    🔨 Remove node-red-contrib-http-request @bonanitech (#1273)

✨ New features

    ✨ Add support for setting max_old_space_size @frenck (#1275)

🐛 Bug fixes

    🔨 Remove node-red-contrib-actionflows @sinclairpaul (#1260)

🚀 Enhancements

    🔨 Reorganize palette categories order @bonanitech (#1259)

⬆️ Dependency updates

    ⬆️ Upgrades nodejs to 16.14.0-r0 @frenck (#1274)
    🔨 Remove node-red-contrib-http-request @bonanitech (#1273)
    Bump node-red-contrib-home-assistant-websocket from 0.41.3 to 0.42.0 in /node-red @dependabot (#1271)


You won’t guess it…
Immediately after a blue border shows up for a second:
502: Bad Gateway

I noticed after a few tries, when trying to start he says the add-on is not running.; start it first. I did that… it stopped on it’s own.

is it normal that between all the icons on top of the Add-on, there is a red one with App-Armor?

1 Like

As far as I know yes. It just let you know Application Armor is being used.

On the other things, I also am at a bit of a loss then. Sorry :frowning: Only been using HA for about 2 weeks myself.

it just won’t run. Maybe it does not like the setup:
one rpi3B+ , usb-SSD with Raspberry OS, Node-Red with 100+ flows managing the house security, smart stuff and climate, Domoticz (purely for the USB-P1 meter).

second rpi3B+ , also w/ USB-ssd. but running HA, using the mqtt on the first rpi. If node-red really won’t run I will never abandon the first.
HA is nice; it supports a lot of systems and APIs but it is not Node-RED. Not even close.
The main issue is that HA i it’s own OS. It should be running on Debian/Raspberry OS. So the machine can be normally managed. An entire machine only running HA seems to me like a waste of resources.

I would suggest reverting back to version 10.4, I have problem with v11 too. Nodes will not update if i click on the blue bar at the top. Most of the entities are removed from the flow.
I get 502 bad gateway ngix, when I try to deploy flow.

Node-Red on Ha has not run here at all, even before the update it did not run.
So there are no flows.
The blue bar on top just flashes once , no time to click anything.
Going back to old version probably will not work either as I have uninstalled it.

Did you check log file, when you start the node-red?
My config:

certfile: fullchain.pem
credential_secret: Somepassword
http_node:
  password: Somepassword2
  username: User
http_static:
  password: Somepassword2
  username: User
init_commands: []
keyfile: privkey.pem
npm_packages: []
ssl: false
system_packages: []
theme: default
log_level: info
dark_mode: false
port: 1880
require_ssl: false
4 Likes

removed HA-OS, reinstalled Raspberry OS, docker, HA. Node-red will not be an add-on but maybe standalone.

Thank you soooo much! Adding the - npm uninstall… worked for me.

I got that one from (I think…) Frenck.

Final conclusion: Node Red will never function as part of HA as well as Node Red runs as standalone. HA simply is not compatible enough.
So I will remain using Node Red standalone as primary home automation system and develop it further to my liking, while HA may handle the graphics and statistics. (And of course report nicely back to Node Red :-).

I see HA simply not doing this:
Monitor 12 PIR RF and a few zigbee PIR , the weather, rainsensors, sunlight sensors to determine where people are in the house, and accordingly switch on/off certain lights so people do not notice there being darkness somewhere at all, with maximum power saving , and control the air quality at the same time.
You think it is easy… well try it :grinning_face_with_smiling_eyes:
Zigbee sensors :mask:
Critical issue is that it all has to run on maximum 2 Raspberry pi 3B’s. A big pc could handle things more easily but with recent energy rates the Rpi’s are the ideal machines for the job (3-5 Watt, passive cooling)

Thank you so much, this helped me!