Skip to content

Bad browse NodeId crashes Node-RED with Uncaught Exception #2

Closed
@Steve-Mcl

Description

@Steve-Mcl

Hi, I accidentally set the nodeId to ns=2 instead of `ns=2;i=2 and this crashed Node-RED

    9 Mar 11:02:44 - [red] Uncaught Exception:
    9 Mar 11:02:44 - [error] Error: String cannot be coerced to a nodeId : ns=2
        at coerceNodeId (C:\Users\sdmcl\.node-red\node_modules\node-opcua-nodeid\dist\nodeid.js:310:23)
        at resolveNodeId (C:\Users\sdmcl\.node-red\node_modules\node-opcua-nodeid\dist\nodeid.js:425:18)
        at coerceBrowseDescription (C:\Users\sdmcl\.node-red\node_modules\node-opcua-client\dist\private\client_session_impl.js:61:61)
        at coerceBrowseDescription (C:\Users\sdmcl\.node-red\node_modules\node-opcua-client\dist\private\client_session_impl.js:51:16)
        at Array.map (<anonymous>)
        at ClientSessionImpl.browse (C:\Users\sdmcl\.node-red\node_modules\node-opcua-client\dist\private\client_session_impl.js:190:57)
        at C:\Users\sdmcl\.node-red\node_modules\thenify-ex\dist\index.js:1:1345
        at new Promise (<anonymous>)
        at ClientSessionImpl.browse (C:\Users\sdmcl\.node-red\node_modules\thenify-ex\dist\index.js:1:1278)
        at browseNode (C:\Users\sdmcl\.node-red\node_modules\node-red-opcua-x\opcua-browse.js:29:58)
    Encode Object: {
      level: 20,
      msg: 'Error: String cannot be coerced to a nodeId : ns=2\n' +
        '    at coerceNodeId (C:\\Users\\sdmcl\\.node-red\\node_modules\\node-opcua-nodeid\\dist\\nodeid.js:310:23)\n' +
        '    at resolveNodeId (C:\\Users\\sdmcl\\.node-red\\node_modules\\node-opcua-nodeid\\dist\\nodeid.js:425:18)\n' +
        '    at coerceBrowseDescription (C:\\Users\\sdmcl\\.node-red\\node_modules\\node-opcua-client\\dist\\private\\client_session_impl.js:61:61)\n' +
        '    at coerceBrowseDescription (C:\\Users\\sdmcl\\.node-red\\node_modules\\node-opcua-client\\dist\\private\\client_session_impl.js:51:16)\n' +
        '    at Array.map (<anonymous>)\n' +
        '    at ClientSessionImpl.browse (C:\\Users\\sdmcl\\.node-red\\node_modules\\node-opcua-client\\dist\\private\\client_session_impl.js:190:57)\n' +
        '    at C:\\Users\\sdmcl\\.node-red\\node_modules\\thenify-ex\\dist\\index.js:1:1345\n' +
        '    at new Promise (<anonymous>)\n' +
        '    at ClientSessionImpl.browse (C:\\Users\\sdmcl\\.node-red\\node_modules\\thenify-ex\\dist\\index.js:1:1278)\n' +
        '    at browseNode (C:\\Users\\sdmcl\\.node-red\\node_modules\\node-red-opcua-x\\opcua-browse.js:29:58)',
      timestamp: 1741518164735
    } { maxLength: 1000 }

The golden rule of well behaved Node-RED node packages is that a nodes should catch async errors to avoid crashing the Node-RED runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions