NodeRed Gives 502 error since upgrade to 2022.4.x
See original GitHub issueProblem/Motivation
I’ve upgraded from 3.8 to 4.0 and my flows stopped working. When injecting an timestamp it looks like Node-RED is crashing. The exact behavior and log is below. I don’t want to garbage too much, is there any more information i can provide I’d be more than happy to. Thanks and regards Paul
Expected behavior
That my flows are running normally
Actual behavior
Some flows, by the looks the timestamp starting flows don’t inject properly resulting in a 502 error most of the time.
Diagnostics information
After upgrading from 3.8 to 4.0 flows stopped working. When testing the flows i don’t get the status reports underneath the node with a timestamp anymore. If pressing the timestamp node a couple of times i get an 502 error, after that it responds again, but if pressing it again a 502 error comes up.
I’ve reverted back to 3.8 and all seems to work again in NodeRed including injecting and seeing the timestamps on the nodes.
I noticed this morning that 4.1 was available and decided to give that one a go and i’m experiencing the exact same behavior. Not sure if there is something in my installation.
Additionally if reverting back to 3.8 my state history is not present anymore if just clicking on a card. Going to 4.1 solved that one.
The configuration of NodeRed had not been changed.
I’ve also tried a complete reboot of the machine, and i uninstalled the addon, renaming the local config directories, reinstalling and reimporting my flows. This results in the same 502 error unfortunately.
Anything in the logs that might be useful for us?
Add-on: Node-RED
Flow-based programming for the Internet of Things
-----------------------------------------------------------
Add-on version: 11.1.1
You are running the latest version of this add-on.
System: Home Assistant OS 7.6 (amd64 / qemux86-64)
Home Assistant Core: 2022.4.1
Home Assistant Supervisor: 2022.03.5
-----------------------------------------------------------
Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing...
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] customizations.sh: executing...
[cont-init.d] customizations.sh: exited 0.
[cont-init.d] nginx.sh: executing...
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] node-red.sh: executing...
patching file nodes/ui_base.html
Hunk #1 succeeded at 1164 (offset 633 lines).
up to date, audited 1 package in 216ms
found 0 vulnerabilities
[cont-init.d] node-red.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[10:25:05] INFO: Starting Node-RED...
> start
> node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
8 Apr 10:25:06 - [info]
Welcome to Node-RED
===================
8 Apr 10:25:06 - [info] Node-RED version: v2.2.2
8 Apr 10:25:06 - [info] Node.js version: v16.14.0
8 Apr 10:25:06 - [info] Linux 5.10.108 x64 LE
8 Apr 10:25:06 - [info] Loading palette nodes
8 Apr 10:25:07 - [info] Dashboard version 3.1.6 started at /endpoint/ui
Traceback (most recent call last):
File "/opt/node_modules/node-red-node-pi-gpio/testgpio.py", line 3, in <module>
import RPi.GPIO as GPIO
File "/usr/lib/python3.9/site-packages/RPi/GPIO/__init__.py", line 23, in <module>
from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!
8 Apr 10:25:07 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
8 Apr 10:25:07 - [info] Settings file : /etc/node-red/config.js
8 Apr 10:25:07 - [info] Context store : 'default' [module=memory]
8 Apr 10:25:07 - [info] User directory : /config/node-red/
8 Apr 10:25:07 - [warn] Projects disabled : editorTheme.projects.enabled=false
8 Apr 10:25:07 - [info] Flows file : /config/node-red/flows.json
8 Apr 10:25:07 - [info] Server now running at http://127.0.0.1:46836/
8 Apr 10:25:07 - [info] Starting flows
[10:25:08] INFO: Starting NGinx...
nginx: [warn] "ssl_stapling" ignored, issuer certificate not found for certificate "/ssl/fullchain.pem"
8 Apr 10:25:08 - [info] Started flows
8 Apr 10:25:12 - [info] [server:Home Assistant] Connecting to http://supervisor/core
8 Apr 10:25:12 - [info] [server:Home Assistant] Connecting to http://supervisor/core
8 Apr 10:25:12 - [info] [server:Home Assistant] Connected to http://supervisor/core
8 Apr 10:25:12 - [info] [server:Home Assistant] Connected to http://supervisor/core
8 Apr 10:25:40 - [red] Uncaught Exception:
8 Apr 10:25:40 - [error] UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<Object>".
[10:25:40] INFO: Starting Node-RED...
> start
> node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
2022/04/08 10:25:40 [error] 566#566: *6 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.183, server: a0d7b954-nodered, request: "POST /inject/9b806e1912ff11ff HTTP/2.0", upstream: "http://127.0.0.1:46836/inject/9b806e1912ff11ff", host: "192.168.2.3:1880", referrer: "https://192.168.2.3:1880/"
8 Apr 10:25:40 - [info]
Welcome to Node-RED
===================
8 Apr 10:25:40 - [info] Node-RED version: v2.2.2
8 Apr 10:25:40 - [info] Node.js version: v16.14.0
8 Apr 10:25:40 - [info] Linux 5.10.108 x64 LE
2022/04/08 10:25:41 [error] 566#566: *12 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.183, server: a0d7b954-nodered, request: "GET /comms HTTP/1.1", upstream: "http://127.0.0.1:46836/comms", host: "192.168.2.3:1880"
8 Apr 10:25:41 - [info] Loading palette nodes
8 Apr 10:25:42 - [info] Dashboard version 3.1.6 started at /endpoint/ui
Traceback (most recent call last):
File "/opt/node_modules/node-red-node-pi-gpio/testgpio.py", line 3, in <module>
import RPi.GPIO as GPIO
File "/usr/lib/python3.9/site-packages/RPi/GPIO/__init__.py", line 23, in <module>
from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!
8 Apr 10:25:42 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
8 Apr 10:25:42 - [info] Settings file : /etc/node-red/config.js
8 Apr 10:25:42 - [info] Context store : 'default' [module=memory]
8 Apr 10:25:42 - [info] User directory : /config/node-red/
8 Apr 10:25:42 - [warn] Projects disabled : editorTheme.projects.enabled=false
8 Apr 10:25:42 - [info] Flows file : /config/node-red/flows.json
8 Apr 10:25:42 - [info] Server now running at http://127.0.0.1:46836/
8 Apr 10:25:42 - [info] Starting flows
8 Apr 10:25:42 - [info] Started flows
Additional information
No yaml changes where made prior and after the upgrades of the core.
Issue Analytics
- State:
- Created a year ago
- Comments:9 (2 by maintainers)

Top Related StackOverflow Question
I would validate against this issue https://github.com/zachowj/node-red-contrib-home-assistant-websocket/issues/625
I’ll close the issue as i don’t have it anymore.