Skip to content

localfilesystem context crashes Node-RED when callback throws #6044

Closed

Description

@tobsch04

Current Behavior

When a function node uses a callback that throws in flow.get / flow.set in the On Start then the Node-RED process crashes and the server can not recover (stuck in restart loop).

This is the code that reproduces the issue in the On Start of a function node.

flow.set('x', 1, function (err) {
    done();
});

Expected Behavior

Node-RED process can handle the error.

Steps To Reproduce

Import the flow below and deploy it.

Example flow

[
    {
        "id": "t1",
        "type": "tab",
        "label": "Repro",
        "disabled": false,
        "info": ""
    },
    {
        "id": "n1",
        "type": "function",
        "z": "t1",
        "name": "Buggy On Start",
        "func": "return msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "flow.set('x', 1, function (err) {\n    done();\n});",
        "finalize": "",
        "libs": [],
        "x": 300,
        "y": 100,
        "wires": [[]]
    }
]

Environment

  • Node-RED version: v5.0.6
  • Node.js version: v24.20.0
  • npm version: NA
  • Platform/OS: Linux
  • Browser: NA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions