Fixing broken Node-RED flows

This tutorial shows how you can recover Node-RED flows that are stuck in an endless loop of crashing.

2 minute read

Prerequisites

  • Node-RED in a crash loop because of one 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)

Tutorial

The solution is to boot Node-RED in safe mode by changing the environment variable NODE_RED_ENABLE_SAFE_MODE to true.

After 0.6.1

  1. Open Lens and connect to the cluster (you should know how to do it if you followed the Getting Started guide)
  2. Select the namespace, where Node-RED is in (factorycube-edge or factorycube-server)
  3. Go to Apps –> Releases and select your Releases
  4. Search for NODE_RED_ENABLE_SAFE_MODE and change the value from false to true
  5. Save

Using this method you might encounter an error message on the top right while saving RELEASE not found in Lens. We recommend following this guide to fix the RELEASE not found message while updating a RELEASE in Lens

Before 0.6.1

  1. Open Lens and connect to the cluster (you should know how to do it if you followed the Getting Started guide)
  2. Select the namespace, where Node-RED is in (factorycube-edge or factorycube-server)
  3. Select the StatefulSet Node-RED. A popup should appear on the right side.
  4. Press the edit button

    Press the edit button / pen symbol on top right of the screen

  5. Find the line
env:
    - name: TZ
      value: Berlin/Europe

and change it to this:

env:
    - name: TZ
      value: Berlin/Europe
    - name: NODE_RED_ENABLE_SAFE_MODE
      value: "true"
  1. Check whether it says "true" and not true (use quotation marks!)
  2. Press Save
  3. Terminate the pod manually if necessary (or if you are impatient)
  4. Node-RED should now start in safe mode. This means that it will boot, but will not execute any flows.
  5. Do your changes, fix the Nodes
  6. Do steps 1 - 5, but now set NODE_RED_ENABLE_SAFE_MODE to false