hassio-addons / addon-node-red

Node-RED - Home Assistant Community Add-ons
https://addons.community
MIT License
539 stars 125 forks source link

502 Bad Gateway error when creating flows (new install) #470

Closed rebmemer closed 4 years ago

rebmemer commented 4 years ago

Problem/Motivation

On a fresh install of Hassio and a fresh install of Node Red 6.1.0, I'm able to access Node Red and create new flows. It seems that (so far) a specific flow is causing some sort of instability issue when executed which in turn causes Node Red to fail, thus producing a '502 Bad Gateway' (nginx) error.

After this flow has been created and the failure happens, I have to restart the Node Red add-on. It starts up normally, where the log ends with;

26 Feb 21:11:13 - [info] [server:Home Assistant] WebSocket Connecting http://localhost:8123 26 Feb 21:11:14 - [info] [server:Home Assistant] WebSocket Connected to http://localhost:8123

After this I try to access the NR Web UI but it hangs for around 30 seconds before spewing out tons of java heap memory errors. Node Rode is non functional from here on out, the only way to recover it is to delete the flows.json and restart.

(Why the issue was filed) I believe this is unexpected behaviour based on the errors in the add-ons logs (below)

Expected behavior

Flow should have executed without issues. For this scenario, it's just a few HA event triggered actions which update a simple string payload, send it on to a Telegram node which then sends a message to a pre-configured telegram account.

Steps to reproduce

Install the following pallettes; Home Assistant Telegram Chat Bot

Will add the flow to import after submitted, currently trying to recover the NR instance. The flow will require your own configuration to be added for the Telegram BOT Api, chat ID and HA long lived token.

Errors

(Taken from add-on logs for Node Red)

addons-assistant[bot] commented 4 years ago

:wave: Thanks for opening your first issue here! If you're reporting a :bug: bug, please make sure you include steps to reproduce it. Also, logs, error messages and information about your hardware might be useful.

rebmemer commented 4 years ago

NR Failure.txt

rebmemer commented 4 years ago

Re-imported the flows but deleted the Telegram Chat Bot nodes (still present in the palette but not in the flow itself), re-deployed the flow and although I'm not using any external API connectivity the errors seem to have gone away entirely and NR is stable again.

This can probably be closed as not an issue or at least not the fault of HA or the NR add-on itself, but I'd be interested to know if there is a decent way to avoid issues like this in the future? - If we find/install a node which causes fatal errors in the add-on, should they be addressed or just avoided?

node-red-contrib-telegrambot 7.1.1

Thanks

sinclairpaul commented 4 years ago

Unfortunately its really difficult to offer support to all the nodes out there, just for future reference you can close your own issue 😉

As a side comment you may want to validate the settings on you HA server setup in Node Red, to check the option that states you use the addon.

addons-assistant[bot] commented 4 years ago

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.