How to fix broken Node-RED flows?
2 minute read
If your Node-RED flow is going into a loop, it could be due to a misconfigured node. In any case, you can fix the issue by booting Node-RED in safe mode.
Problem
There could be several reasons why the Node-RED flow is going into a loop:
- Misconfigured node especially azure-iot-hub and python3-function)
- Node-RED installed as part of the United Manufacturing Hub (either as factorycube-edge or factorycube-server)
Solution
To boot Node-RED in safe mode, you will need to change the environment variable NODE_RED_ENABLE_SAFE_MODE to true. Follow the instructions below depending on your version of Node-RED:
After 0.6.1
- Using UMHLens, connect to the cluster and select the namespace where Node-RED is located (factorycube-edge or factorycube-server).
- Go to Apps > Releases and select your releases.
- Search for
NODE_RED_ENABLE_SAFE_MODEand change the value fromfalsetotrue. - Save the changes.
If you receive an error message saying RELEASE not found in UMHLens while saving, follow this guide to fix it.
Before 0.6.1
Using UMHLens, connect to the cluster and select the namespace where Node-RED is located (factorycube-edge or factorycube-server).
Select the StatefulSet Node-RED. A popup should appear on the right side.
Press the edit button.

Press the edit button / pen symbol on top right of the screen
Find the line
env:and add the following underneath it:- name: NODE_RED_ENABLE_SAFE_MODE value: "true"Press save.
If necessary, terminate the pod manually (or if you are impatient).
Node-RED should now start in safe mode, which means it will boot but not execute any flows.
Make your changes and fix the nodes.
Repeat steps 1-5, but this time set
NODE_RED_ENABLE_SAFE_MODEtofalse.
After following these steps, your Node-RED flow should no longer go into a loop