[Node-Red] update of the palette “node-red-node-serialport 1.0.1” crashes the Node-red docker

If you have installed the palette « node-red-node-serialport » to use Rflink for example and you update it to « node-red-node-serialport 1.0.1 », it crashes the Docker Node-Red, which restarts every 15 seconds.

The discussion is here

To fix this, the solution is to reinstall an older version of « node-red-node-serialport » that does not crash the Docker.

As I had version 0.15.0 which worked very well, I chose to reinstall that one.

Prerequisites: having removed the palette « node-red-node-serialport 1.0.1 »

For info, the version « node-red-node-serialport 0.15.0 » is here

  1. Connect via SSH to Gladys with Gladys’s IP address
ssh pi@192.xxx.x.xx
  1. Open a Shell in docker
$ docker exec -it node_red /bin/bash

This returns

bash-5.0#
  1. Copy the following command at the end
npm i node-red-node-serialport@0.15.0

This processes and at the end returns this

 notice created a lockfile as package-lock.json. You should commit this file.
+ node-red-node-serialport@0.15.0
added 48 packages from 37 contributors and audited 338 packages in 60.866s

45 packages are looking for funding
  run `npm fund` for details

found 4 critical severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
  1. As there are 4 critical vulnerabilities, run
npm audit fix

As proposed

  1. Close the Shell and restart Node-Red
exit

and

docker restart node_red

node-red-node-serialport version 0.15.0 is installed

Hello @bjm,
Is everything working fine on your end?
I can’t seem to return to a stable situation. I think my old flow is disrupting the operation of the Node-RED serialport node. I’m on version 0.15.0, and when I add a new serial node, it connects, but if I import my database, even after re-entering the data into the serial node, I experience a server connection loss. I don’t know what to do anymore. I switched to a second Raspberry Pi with an older version of Gladys, but it seems that during installation, it reverts to the latest 64-bit image of Gladys. Even my Xiaomi gateway is causing connection losses, whereas when I followed your tutorial, everything was working fine. I don’t understand anything anymore.

Everything works for me.

I had a big scare when I activated Telegram, which made me lose access to the Gladys web page for 20 minutes. I had asked the question « What’s the weather like? » to test it, and after 20 minutes I got the answer and regained access to the web page.

Regarding my Rflink flow:
I deleted the « serial in node » and « serial out node » before my export.
Once imported, I recreated them on the new Gladys 64 bit.
I forgot, I have a Raspberry Pi 3.

Great, :+1:
For me too it’s back on track but I only have two nodes a « serial in » and a « gateway xiaomi » and they are connected. I tried ten times to reload my database and after tinkering I messed up the TTYUSB0 address, I put USB1 (the USB of the Zigbee key) the database saved it and it crashed every time. But even by doing what you did by deleting the serial nodes it still crashed (maybe also, not patient enough, I say that because I was working on other things and when I redisplayed Node red my nodes were connected) Anyway I will enter all the nodes manually, I’m fed up with restarting every time. :cold_sweat:
Thanks for your help, good continuation
:wink:

You didn’t forget to configure the MQTT node because I forgot to do it.

In the end, today is a day with :smiley:, I recovered my flows. I deleted the Serial nodes and the Xiaomi node, I also deleted all the links with the MQTT broker, with the ttyUSB0 port of the Rflink and the Xiaomi Gateway, then I recreated all my links and configured the Serial and Xiaomi nodes. And finally, I was able to restart everything, but it was necessary to assign the MQTT broker to all the MQTT nodes one by one. But finally, everything works again as before.
Thanks again for your help :wink:

super :+1:

Hello,

I’m bouncing on the topic because I’m facing the same problem but the manipulation did not solve the problem.
Unable to access NodeRed and the container keeps restarting.

Almost the same day or almost, Zigbee 2 Mqtt down and Node Red inaccessible.
I managed to restart Zigbee2Mqtt with the tutorial but I can’t do it with NodeRed.
Should I uninstall it completely and then reinstall it? If so, what is the manipulation please?

NB: I sometimes manage to display on my browser a page indicating Node-RED in the tab but blank page.

If you have a backup of your flows, you can delete the flows.json file
In the terminal

cd /var/lib/node-red
ls
sudo rm flows.json
docker restart node_red

Then you can re-import your flow

Super thanks @bjm.
I can access Node-Red again.
I had kept my flow on a local Node-Red for testing.
:+1:

Hi, I’m bumping the thread because I’m encountering an issue with Node-RED again.
The container starts correctly but it’s impossible to access it using the IP address on port 1880. Page not found!
The connection on port 8080 to Zigbee works fine.
I tried removing the flow but nothing changes ..
With a docker ps, it shows me:
(health: starting)
Any idea?

Hi!
The reason is the latest Node-RED update.
Solution here

Hello everyone !

Sorry but I need a bit of help because I didn’t figure out how to reinstall to version 0.15

thanks in advance

Good evening @jerome,
I made this list to reinstall Node-RED from scratch

Installation of Node-RED

1 - run @VonOx’s command

docker run -d \

--log-opt max-size=10m \

--restart=always \

--network=host \

--name node_red \

-u node-red:dialout \

--device=/dev/ttyUSB0 \

--device=/dev/ttyUSB1 \

--label com.centurylinklabs.watchtower.enable=false \

-v /var/lib/node-red:/data \

nodered/node-red

2 - then this one

sudo chown -R 1000:1000 /var/lib/node-red

3 - Generate a hash: For more accuracy watch Pierre-Gilles’ video: Intégrer Node-RED avec Gladys Assistant en MQTT | Gladys Assistant

Generate a hash

docker exec -it node_red node-red admin hash-pw

4 - Edit the file with nano: Don’t forget sudo (I need it in front)

sudo nano /var/lib/node-red/settings.js

Remove the double // between « adminAuth: » and the matching closing brace } corresponding to adminAuth: {

5 - Paste the generated hash

6 - Then restart Node-RED

docker restart node_red

Downgrading the Serialport version

we will use version 0.15.0 instead of version 1.0.1

thanks to @Bjm

So you need to keep the node-red-node-serialport version 0.15.0. To get this version, follow @Bjm’s tutorial, which I paste below

I installed node-red-node-serialport version 0.15.0 which worked on my 32-bit
https://www.npmjs.com/package/node-red-node-serialport/v/0.15.0

1 - In the terminal to open a shell in docker

docker exec -it node_red /bin/bash

this returns me
bash-5.0#

2 - I append the following command

npm i node-red-node-serialport@0.15.0

it churns and at the end returns this to me:

notice created a lockfile as package-lock.json. You should commit this file.

node-red-node-serialport@ 0.15.0

added 48 packages from 37 contributors and audited 338 packages in 60 .866s

45 packages are looking for funding

run npm fund for details

found 4 critical severity vulnerabilities
run npm audit fix to fix them, or npm audit for details

3 - Since there are 4 critical vulnerabilities I run

npm audit fix

As suggested

4 - Then

exit

5 – restart Node-RED

docker  restart node_red

after that you reinstall your Serial palette, Node-RED still offers you the higher version, you click on it and when it installs it becomes 0.15.0
good luck
:wink:

@jerome

It may be necessary to adapt these lines. They correspond, for me, to my USB ports. One for my Zigbee dongle and the other for my Rflink

cool thanks @Psoy

Thanks to you I finally took the time to restart Node-

Well, another crash after updating to 1.0.1

But I think I’ve found the solution
Supprimer le Flow
Update node-red-node-serialport to 1.0.1
then

docker exec -it node_red /bin/bash
cd /data
npm rebuild --build-from-source
exit
docker restart node_red

Found here

Node-RED (Docker) crashes when /dev/ttyACM0 is configured in flow - Raspberry Pi 4 · Issue #3461 · node-red/node-red · GitHub

EDIT: It’s been a day running with node-red-node-serialport at 1.0.1 and no crashes.