Node-red inject node and debug nodes are not working correctly after deploying in rancher

I am using node-red version 2.2.2 and node.js version 12.22.8. This instance was deployed in rancher kubernetes management platform. When I use nodered v2.2.2 inject node and debug nodes are enabled but debug outputs are not showing in the the panel but I get successfully injected message. I also tried upgrading to nodered version 3.0.2 In that inject nodes and debug nodes cannot be enabled. What can be the reason for this any fix?, I tried npm update but it didn't fix the issue.

With node-red 3.0.2 start node red in a command window and post the startup log here.

it is likely you have an issue in your flows or a contrib node preventing the flows from starting on the server.

the second common reason is that websockets are blocked.

Check the browsers dev tools -> network tab for any rad requests.

And as @Colin said - post your startup log.

And one additional question - where/how are you running node-red - docker? nas? rasp pi? windows? etc etc

Hi,
Thank you for replying. Forum shows that new users cant upload attachments, so please find part of the log below.

31 Jul 09:55:05 - [warn] [node-red-contrib-mongodb4/mongodb4] Error: Cannot find module 'bson'
Require stack:
- /data/node_modules/mongodb/lib/bson.js
- /data/node_modules/mongodb/lib/utils.js
- /data/node_modules/mongodb/lib/operations/add_user.js
- /data/node_modules/mongodb/lib/admin.js
- /data/node_modules/mongodb/lib/index.js
- /data/node_modules/node-red-contrib-mongodb4/src/mongodb4.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/loader.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/index.js
- /usr/src/node-red/node_modules/node-red/lib/red.js
- /usr/src/node-red/node_modules/node-red/red.js
31 Jul 09:55:05 - [warn] ------------------------------------------------------
31 Jul 09:55:05 - [info] Settings file  : /data/settings.js
31 Jul 09:55:05 - [info] Context store  : 'default' [module=memory]
31 Jul 09:55:05 - [info] User directory : /data
31 Jul 09:55:05 - [warn] Projects disabled : editorTheme.projects.enabled=false
31 Jul 09:55:05 - [info] Flows file     : /data/flows.json
31 Jul 09:55:05 - [info] Server now running at http://127.0.0.1:1880/
31 Jul 09:55:05 - [warn] 

---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------

31 Jul 09:55:05 - [info] Starting flows
31 Jul 09:55:05 - [info] Started flows
31 Jul 09:59:37 - [info] Stopping flows
31 Jul 09:59:37 - [info] Stopped flows
31 Jul 09:59:37 - [info] Updated flows
31 Jul 09:59:37 - [info] Starting flows
31 Jul 09:59:37 - [info] Started flows

In the browser developer options network shows following error also

Firefox can’t establish a connection to the server at wss://nodered-dashboard.test.lk/comms.

Thank you.

Please post the start of the log up to the error. Pasting it in is the correct way to do it.
You didn't answer all of @Steve-Mcl's questions - in particular whether it is a docker install.

The node showing the error has not installed correctly, so I suggest you try installing that again.

Hi, Please find the full log.

31 Jul 09:55:04 - [info] 

Welcome to Node-RED
===================

31 Jul 09:55:04 - [info] Node-RED version: v3.0.2
31 Jul 09:55:04 - [info] Node.js  version: v16.20.1
31 Jul 09:55:04 - [info] Linux 3.10.0-1160.el7.x86_64 x64 LE
31 Jul 09:55:05 - [info] Loading palette nodes
31 Jul 09:55:05 - [warn] ------------------------------------------------------
31 Jul 09:55:05 - [warn] [node-red-contrib-modbus/Modbus-Client] Error: Cannot find module '@xstate/fsm'
Require stack:
- /data/node_modules/node-red-contrib-modbus/modbus/core/modbus-client-core.js
- /data/node_modules/node-red-contrib-modbus/modbus/modbus-client.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/loader.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/index.js
- /usr/src/node-red/node_modules/node-red/lib/red.js
- /usr/src/node-red/node_modules/node-red/red.js
31 Jul 09:55:05 - [warn] [node-red-contrib-modbus/Modbus-Read] Error: Cannot find module 'bson'
Require stack:
- /data/node_modules/node-red-contrib-modbus/modbus/core/modbus-core.js
- /data/node_modules/node-red-contrib-modbus/modbus/modbus-read.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/loader.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/index.js
- /usr/src/node-red/node_modules/node-red/lib/red.js
- /usr/src/node-red/node_modules/node-red/red.js
31 Jul 09:55:05 - [warn] [node-red-contrib-modbus/Modbus-Getter] Error: Cannot find module 'bson'
Require stack:
- /data/node_modules/node-red-contrib-modbus/modbus/core/modbus-core.js
- /data/node_modules/node-red-contrib-modbus/modbus/modbus-getter.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/loader.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/index.js
- /usr/src/node-red/node_modules/node-red/lib/red.js
- /usr/src/node-red/node_modules/node-red/red.js
31 Jul 09:55:05 - [warn] [node-red-contrib-modbus/Modbus-Flex-Getter] Error: Cannot find module 'bson'
Require stack:
- /data/node_modules/node-red-contrib-modbus/modbus/core/modbus-core.js
- /data/node_modules/node-red-contrib-modbus/modbus/modbus-flex-getter.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/loader.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/index.js
- /usr/src/node-red/node_modules/node-red/lib/red.js
- /usr/src/node-red/node_modules/node-red/red.js
31 Jul 09:55:05 - [warn] [node-red-contrib-modbus/Modbus-Write] Error: Cannot find module 'bson'
Require stack:
- /data/node_modules/node-red-contrib-modbus/modbus/core/modbus-core.js
- /data/node_modules/node-red-contrib-modbus/modbus/modbus-write.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/loader.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/index.js
- /usr/src/node-red/node_modules/node-red/lib/red.js
- /usr/src/node-red/node_modules/node-red/red.js
31 Jul 09:55:05 - [warn] [node-red-contrib-modbus/Modbus-Flex-Write] Error: Cannot find module 'bson'
Require stack:
- /data/node_modules/node-red-contrib-modbus/modbus/core/modbus-core.js
- /data/node_modules/node-red-contrib-modbus/modbus/modbus-flex-write.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/loader.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/index.js
- /usr/src/node-red/node_modules/node-red/lib/red.js
- /usr/src/node-red/node_modules/node-red/red.js
31 Jul 09:55:05 - [warn] [node-red-contrib-modbus/Modbus-Server] Error: Cannot find module 'jsmodbus'
Require stack:
- /data/node_modules/node-red-contrib-modbus/modbus/modbus-server.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/loader.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/index.js
- /usr/src/node-red/node_modules/node-red/lib/red.js
- /usr/src/node-red/node_modules/node-red/red.js
31 Jul 09:55:05 - [warn] [node-red-contrib-modbus/Modbus-Flex-Server] Error: Cannot find module '@serialport/parser-byte-length'
Require stack:
- /data/node_modules/serialport/dist/index.js
- /data/node_modules/modbus-serial/index.js
- /data/node_modules/node-red-contrib-modbus/modbus/modbus-flex-server.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/loader.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/index.js
- /usr/src/node-red/node_modules/node-red/lib/red.js
- /usr/src/node-red/node_modules/node-red/red.js
31 Jul 09:55:05 - [warn] [node-red-contrib-modbus/Modbus-Queue-Info] Error: Cannot find module 'bson'
Require stack:
- /data/node_modules/node-red-contrib-modbus/modbus/core/modbus-core.js
- /data/node_modules/node-red-contrib-modbus/modbus/core/modbus-queue-core.js
- /data/node_modules/node-red-contrib-modbus/modbus/modbus-queue-info.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/loader.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/index.js
- /usr/src/node-red/node_modules/node-red/lib/red.js
- /usr/src/node-red/node_modules/node-red/red.js
31 Jul 09:55:05 - [warn] [node-red-contrib-modbus/Modbus-IO-Config] Error: Cannot find module 'line-by-line'
Require stack:
- /data/node_modules/node-red-contrib-modbus/modbus/core/modbus-io-core.js
- /data/node_modules/node-red-contrib-modbus/modbus/modbus-io-config.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/loader.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/index.js
- /usr/src/node-red/node_modules/node-red/lib/red.js
- /usr/src/node-red/node_modules/node-red/red.js
31 Jul 09:55:05 - [warn] [node-red-contrib-modbus/Modbus-Response-Filter] Error: Cannot find module 'bson'
Require stack:
- /data/node_modules/node-red-contrib-modbus/modbus/core/modbus-core.js
- /data/node_modules/node-red-contrib-modbus/modbus/modbus-response-filter.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/loader.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/index.js
- /usr/src/node-red/node_modules/node-red/lib/red.js
- /usr/src/node-red/node_modules/node-red/red.js
31 Jul 09:55:05 - [warn] [node-red-contrib-modbus/Modbus-Flex-Sequencer] Error: Cannot find module 'bson'
Require stack:
- /data/node_modules/node-red-contrib-modbus/modbus/core/modbus-core.js
- /data/node_modules/node-red-contrib-modbus/modbus/modbus-flex-sequencer.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/loader.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/index.js
- /usr/src/node-red/node_modules/node-red/lib/red.js
- /usr/src/node-red/node_modules/node-red/red.js
31 Jul 09:55:05 - [warn] [node-red-contrib-mongodb4/mongodb4] Error: Cannot find module 'bson'
Require stack:
- /data/node_modules/mongodb/lib/bson.js
- /data/node_modules/mongodb/lib/utils.js
- /data/node_modules/mongodb/lib/operations/add_user.js
- /data/node_modules/mongodb/lib/admin.js
- /data/node_modules/mongodb/lib/index.js
- /data/node_modules/node-red-contrib-mongodb4/src/mongodb4.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/loader.js
- /usr/src/node-red/node_modules/@node-red/registry/lib/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
- /usr/src/node-red/node_modules/@node-red/runtime/lib/index.js
- /usr/src/node-red/node_modules/node-red/lib/red.js
- /usr/src/node-red/node_modules/node-red/red.js
31 Jul 09:55:05 - [warn] ------------------------------------------------------
31 Jul 09:55:05 - [info] Settings file  : /data/settings.js
31 Jul 09:55:05 - [info] Context store  : 'default' [module=memory]
31 Jul 09:55:05 - [info] User directory : /data
31 Jul 09:55:05 - [warn] Projects disabled : editorTheme.projects.enabled=false
31 Jul 09:55:05 - [info] Flows file     : /data/flows.json
31 Jul 09:55:05 - [info] Server now running at http://127.0.0.1:1880/
31 Jul 09:55:05 - [warn] 

---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------

31 Jul 09:55:05 - [info] Starting flows
31 Jul 09:55:05 - [info] Started flows
31 Jul 09:59:37 - [info] Stopping flows
31 Jul 09:59:37 - [info] Stopped flows
31 Jul 09:59:37 - [info] Updated flows
31 Jul 09:59:37 - [info] Starting flows
31 Jul 09:59:37 - [info] Started flows

The flow I am using for testing is as following.

[
    {
        "id": "99177538a354aa2e",
        "type": "tab",
        "label": "Flow 5",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "6bacc885d0d54737",
        "type": "inject",
        "z": "99177538a354aa2e",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 200,
        "y": 100,
        "wires": [
            [
                "9f7e4c52468117a0"
            ]
        ]
    },
    {
        "id": "9f7e4c52468117a0",
        "type": "debug",
        "z": "99177538a354aa2e",
        "name": "debug 1",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 420,
        "y": 100,
        "wires": []
    }
]

@Steve-Mcl node-red is deployed in Rancher platform in our corporate servers.

As you can see, the install of nodes is messed up.
I don't know anything about Rancher, but if this were a normal install I would recommend deleting the node_modules folder, which in your system appears to be /data/node-modules, then, in a command window, going into /data and running
npm install
which should re-install all the required nodes. Watch for errors with this obviously.

As for the sockets connection problem then it appears that the browser cannot open a web socket connection to the server. That may be a Rancher problem.

As rancher is container based (think docker) your images will need the tools necessary for compiling certain nodes that have a build step (like serial port etc)

Covered many times on the forum. Search "docker build serial"

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.