BiancoRoyal / node-red-contrib-modbus

maintained by PLUS for Node-RED - https://plus4nodered.com
https://www.npmjs.com/package/node-red-contrib-modbus
BSD 3-Clause "New" or "Revised" License
278 stars 107 forks source link

Segmentation fault (core dumped) when configuring Modbus in Node-RED Docker #468

Open mariacomsa opened 2 weeks ago

mariacomsa commented 2 weeks ago

Which node-red-contrib-modbus version are you using?

5.31.0

What happened?

I am using Node-RED with Docker. When I configure the node-red-contrib-modbus module, a segmentation fault error occurs. The error message is as follows: Captura This issue can be resolved by running npm run rebuild inside the Docker volume at data/node_modules/@serialport/bindings-cpp.

Server

Modbus-Server Node

How can this be reproduced?

  1. Use Node-RED with Docker.
  2. Install node-red-contrib-modbus version 5.31.0.
  3. Configure the Modbus settings.
  4. Observe the segmentation fault error as shown in the attached screenshot.
  5. Disable the flow or node that uses the node-red-contrib-modbus library by editing the flows.json file to allow the container to restart.
  6. After the container restarts, run npm run rebuild in the Docker volume at data/node_modules/@serialport/bindings-cpp.
  7. Re-enable the flow or node and verify the configuration.

What did you expect to happen?

I expected the Modbus configuration to work without causing a segmentation fault error. Ideally, there should be no need to manually rebuild the @serialport/bindings-cpp module inside the Docker volume

Other Information

No response

Kovalenko2002 commented 22 hours ago

Hello, I met what seems to be the same issue when trying to use the Modbus-Read node for serial communication. After having configured the modbus-client node, activating the flow causes :

node-red-1  | ./entrypoint.sh: line 14:     7 Segmentation fault    (core dumped) /usr/local/bin/node $NODE_OPTIONS node_modules/node-red/red.js --userDir /data $FLOWS "${@}"
node-red-1 exited with code 139

My config is :

System info

Model           : Raspberry Pi Zero W Rev 1.0
OS               : Ubuntu/Linaro 8.4.0-3ubuntu1
Architecture : arm64
RS485 CAN HAT Waveshare Electronics

Docker info

Client version        : 20.10.5+dfsg1
Server version       : 20.10 5+dfsg1
containerd             : 1.4.13~ds1
runc                       : 1.0.0~rc93+ds1
docker-init version : 0.19.0

Node-red info

Node-RED version  : v4.01
Node.js version       : v20.15.0
Linux 5.15.32-v8+ arm64 LE

node-red-contrib-modbus info

version 5.40.0

I've also tested on my laptop with a usb to rs485 adaptator and it worked without any issue. The configuration was :

OS : Debian 12.2.0-14 Linux version 6.1.0-21-amd64
Architecture : x86_64

I've tried the quickfix proposed but it didn't work. If anyone has another idea to temporarily fix it - I'm interested.