After updating my NR local installation (on RPI) from v 0.20.07 to the last one (v. 1.0.3) my MQTT nodes didn't connect to the MQTT broker anymore. Before updating NR I make a backup of my entire RPi MicroSD so I'm able to switch to the old configuration at any time
To be clear I didn't change anything in the flows but I only upgrade the NR version using the standard script provided here https://nodered.org/docs/getting-started/raspberrypi
. As additional information, during the NR update process not any warn/error message was shown on the console.
Below the NR logs of the OLD (and still working configuration) where it's clear that the MQTT connection is correctly established (I've deleted some not-interesting rows).
Starting as a systemd service.
Started Node-RED graphical event wiring tool.
23 Feb 12:12:33 - [info]
Welcome to Node-RED
===================
23 Feb 12:12:33 - [info] Node-RED version: v0.20.7
23 Feb 12:12:33 - [info] Node.js version: v8.16.0
23 Feb 12:12:33 - [info] Linux 4.19.57-v7+ arm LE
23 Feb 12:12:35 - [info] Loading palette nodes
23 Feb 12:12:48 - [info] Dashboard version 2.19.3 started at /ui
23 Feb 12:12:50 - [info] Settings file : /home/pi/.node-red/settings.js
23 Feb 12:12:50 - [info] HTTP Static : /home/pi/Immagini_APA
23 Feb 12:12:50 - [info] Context store : 'default' [module=memory]
23 Feb 12:12:50 - [info] User directory : /home/pi/.node-red
23 Feb 12:12:50 - [warn] Projects disabled : editorTheme.projects.enabled=false
23 Feb 12:12:50 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
23 Feb 12:12:51 - [info] Server now running at http://127.0.0.1:1880/
23 Feb 12:12:52 - [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.
---------------------------------------------------------------------
23 Feb 12:13:18 - [info] Starting flows
…..
……
23 Feb 12:13:28 - [info] [mqtt-broker:MQTT con TLS] Connected to broker: APA0@mqtts://mysite.it:8883
Below, instead the log after updating NR to the last version that throws the mqtt broker connection error.
Starting as a systemd service.
Started Node-RED graphical event wiring tool.
23 Feb 12:05:16 - [info]
Welcome to Node-RED
===================
23 Feb 12:05:16 - [info] Node-RED version: v1.0.3
23 Feb 12:05:16 - [info] Node.js version: v8.16.0
23 Feb 12:05:16 - [info] Linux 4.19.57-v7+ arm LE
23 Feb 12:05:18 - [info] Loading palette nodes
23 Feb 12:05:31 - [info] Dashboard version 2.19.3 started at /ui
23 Feb 12:05:33 - [info] Settings file : /home/pi/.node-red/settings.js
23 Feb 12:05:33 - [info] HTTP Static : /home/pi/Immagini_APA
23 Feb 12:05:33 - [info] Context store : 'default' [module=memory]
23 Feb 12:05:33 - [info] User directory : /home/pi/.node-red
23 Feb 12:05:33 - [warn] Projects disabled : editorTheme.projects.enabled=false
23 Feb 12:05:33 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
23 Feb 12:05:34 - [info] Server now running at http://127.0.0.1:1880/
23 Feb 12:05:35 - [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.
---------------------------------------------------------------------
23 Feb 12:06:01 - [info] Starting flows
…
….
…
23 Feb 12:06:12 - [info] [mqtt-broker:MQTT con TLS] Connection failed to broker: APA0@mqtts://mysite.it:8883
On the server side, the MQTT broker receives the request form NR but disconnect with a "client
unknown" exception.
As clarified above I didn't change anything to the flows or to the MQTT configuration node.
After getting this error - just to make an additional test and thinking it could be the cause - I've changed the MQTT broker configuration in the NR in order not to use $ENV variables (set in the NR settings.json file and used in the flow for convenience) and set the ClientID and Security configuration credentials (I use TLS/SSL connection on port 8883) direclty in the MQTT Broker Config node but with no luck. Also wih this new MQTT node configuration I had the same error showed in the log above.
I suppose that something during the NR update process "broke" the MQTT node. Is there any check I can do to understand/solve the problem?
Note: Trying to find a way to uninstall/reinstall the MQTT node palette I've seen that there's no way to to do it (probably being one of the NR standard node). Is it correct my understanding?