IPv6 connect/disconnect issue with mqtt in or out nodes

I'm slowly moving my projects to utilize IPv6, but I found an issue while using a single MQTT IN or OUT node where during a modified node deployment 50% of the time it will disconnect from an IPv6 only broker.

I can reproduce this behavior reliably under NR v3.0.2, ubuntu or rpi os, node.js (v14, v16, or v18) and latest mosquitto broker (TLS or not). I've tested with a few local brokers, remotely on AWS EC2, or test.mosqutto.org (2001:41d0:1:925e::1). I usually only change the QOS level to trigger a modified node deploy.

Logs from NR and broker show only a normal (non-error) IPv6 client disconnect/connect.

Example MQTT IN node:

[
    {
        "id": "497c7a765e26de0b",
        "type": "mqtt in",
        "z": "5ac27d09b93b4452",
        "name": "",
        "topic": "nodered/ipv6/test",
        "qos": "1",
        "datatype": "auto-detect",
        "broker": "5d0c05a3ecea1f46",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 170,
        "y": 200,
        "wires": [
            [
                "30b8c8c7159c6c89"
            ]
        ]
    },
    {
        "id": "30b8c8c7159c6c89",
        "type": "debug",
        "z": "5ac27d09b93b4452",
        "name": "debug 3",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 340,
        "y": 200,
        "wires": []
    },
    {
        "id": "5d0c05a3ecea1f46",
        "type": "mqtt-broker",
        "name": "",
        "broker": "2001:41d0:1:925e::1",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    }
]

Example MQTT OUT node:

[
    {
        "id": "99407118f264a1b3",
        "type": "mqtt out",
        "z": "25e4b7bcd7dc34bb",
        "name": "",
        "topic": "nodered/ipv6/test",
        "qos": "2",
        "retain": "false",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "6fd98d9498ff1cae",
        "x": 550,
        "y": 780,
        "wires": []
    },
    {
        "id": "32b3f8142f268458",
        "type": "inject",
        "z": "25e4b7bcd7dc34bb",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "1",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 330,
        "y": 780,
        "wires": [
            [
                "99407118f264a1b3"
            ]
        ]
    },
    {
        "id": "6fd98d9498ff1cae",
        "type": "mqtt-broker",
        "name": "",
        "broker": "2001:41d0:1:925e::1",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    }
]

If you have only one subscription and you make a change that makes the MQTT node be redeployed (i.e if you modify it or use full deploy mode) you will be hitting a known bug

See here: MQTT not reconnecting if only only one mqtt node using it

And here: MQTT not reconnecting on edit if only only one mqtt node using the config node Ā· Issue #3927 Ā· node-red/node-red Ā· GitHub

Fixed in next release (v3.1.0)

Thanks for the info and that explains why I haven't seen the same issue with IPv4 since most of my broker configs are shared among many MQTT nodes. I now look forward to V3.1.0!

šŸŽ‰ Node-RED 3.1.0-beta.1 released :wink:

Would be cool if you can try it out and confirm?

I installed v3.1 beta on ubuntu and verified deploying a single modified MQTT node does not disconnect from the broker. So it appears it's fixed. Awesome job!

1 Like

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