Launching node-red crashing at pallet load

I've been using node-red for a couple of years on my home-server. Recently I updated some npm packages and restarted the server and now it's failing to run.

The output from journalctl when running the service hints to some sort of opcode issue (which I have no idea).

alpha@home-server:~$ sudo service node-red start && journalctl -f
-- Logs begin at Mon 2019-03-11 18:34:40 CET. --
Aug 03 20:50:21 home-server node-red[32320]: 3 Aug 20:50:21 - [info]
Aug 03 20:50:21 home-server node-red[32320]: Welcome to Node-RED
Aug 03 20:50:21 home-server node-red[32320]: ===================
Aug 03 20:50:21 home-server node-red[32320]: 3 Aug 20:50:21 - [info] Node-RED version: v2.0.5
Aug 03 20:50:21 home-server node-red[32320]: 3 Aug 20:50:21 - [info] Node.js  version: v12.22.4
Aug 03 20:50:21 home-server node-red[32320]: 3 Aug 20:50:21 - [info] Linux 4.15.0-151-generic x64 LE
Aug 03 20:50:23 home-server node-red[32320]: 3 Aug 20:50:23 - [info] Loading palette nodes
Aug 03 20:50:27 home-server kernel: traps: node[32320] trap invalid opcode ip:7fdf2edc1f1f sp:7ffc69beb148 error:0 in libvips-cpp.so.42[7fdf2eb8f000+c9e000]
Aug 03 20:50:28 home-server systemd[1]: node-red.service: Main process exited, code=dumped, status=4/ILL
Aug 03 20:50:28 home-server systemd[1]: node-red.service: Failed with result 'core-dump'.
Aug 03 20:50:28 home-server systemd[1]: node-red.service: Service hold-off time over, scheduling restart.
Aug 03 20:50:28 home-server systemd[1]: node-red.service: Scheduled restart job, restart counter is at 1.
Aug 03 20:50:28 home-server systemd[1]: Stopped Node-RED.

It enters into a loop where it's keep on crashing and restarting. I tried to google the opcode issue, but couldn't find anything useful.

Also, launching the node-red on terminal causes the following output:

alpha@home-server:~$ node-red
3 Aug 20:44:42 - [info]

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

3 Aug 20:44:42 - [info] Node-RED version: v2.0.5
3 Aug 20:44:42 - [info] Node.js  version: v12.22.4
3 Aug 20:44:42 - [info] Linux 4.15.0-151-generic x64 LE
3 Aug 20:44:44 - [info] Loading palette nodes
Illegal instruction (core dumped)

Versions I'm using:

alpha@home-server:~$ node -v && npm -v
v12.22.4
7.20.3

Is there any way to know which node when loading the pallet is causing the issue?
I tried launching node-red with an empty flow too and still experienced the same behavior.
Any help would be appreciated.

Edit settings.js in the .node-red folder and set the log level to trace. Then restart node-red. That may enable you to tell what is crashing.

The error is coming from libvips-cpp.so.

A quick Google finds that is an image processing library: GitHub - libvips/libvips: A fast image processing library with low memory needs.

So I'd start with disabling any nodes that work with images.

This is the output after setting log level to trace

alpha@home-server:~$ node-red
3 Aug 22:20:47 - [info]

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

3 Aug 22:20:47 - [info] Node-RED version: v2.0.5
3 Aug 22:20:47 - [info] Node.js  version: v14.17.4
3 Aug 22:20:47 - [info] Linux 4.15.0-151-generic x64 LE
3 Aug 22:20:48 - [info] Loading palette nodes
3 Aug 22:20:49 - [debug] Module: json-db-node-red 0.5.3 /home/bilbo/.node-red/node_modules/json-db-node-red
3 Aug 22:20:49 - [debug] Module: node-red-configurable-ping 1.0.2 /home/bilbo/.node-red/node_modules/node-red-configurable-ping
3 Aug 22:20:49 - [debug] Module: node-red-contrib-blockly 1.1.0 /home/bilbo/.node-red/node_modules/node-red-contrib-blockly
3 Aug 22:20:49 - [debug] Module: node-red-contrib-browser-utils 0.0.10 /home/bilbo/.node-red/node_modules/node-red-contrib-browser-utils
3 Aug 22:20:49 - [debug] Module: node-red-contrib-config 1.2.1 /home/bilbo/.node-red/node_modules/node-red-contrib-config
3 Aug 22:20:49 - [debug] Module: node-red-contrib-cpu 0.0.4 /home/bilbo/.node-red/node_modules/node-red-contrib-cpu
3 Aug 22:20:49 - [debug] Module: node-red-contrib-dashboard-average-bars 0.0.6 /home/bilbo/.node-red/node_modules/node-red-contrib-dashboard-average-bars
3 Aug 22:20:49 - [debug] Module: node-red-contrib-dashboard-bar-chart-data 0.9.7 /home/bilbo/.node-red/node_modules/node-red-contrib-dashboard-bar-chart-data
3 Aug 22:20:49 - [debug] Module: node-red-contrib-device-stats 1.1.2 /home/bilbo/.node-red/node_modules/node-red-contrib-device-stats
3 Aug 22:20:49 - [debug] Module: node-red-contrib-flic-buttons 1.1.1 /home/bilbo/.node-red/node_modules/node-red-contrib-flic-buttons
3 Aug 22:20:49 - [debug] Module: node-red-contrib-ftp-server 1.0.2 /home/bilbo/.node-red/node_modules/node-red-contrib-ftp-server
3 Aug 22:20:49 - [debug] Module: node-red-contrib-ifttt 0.3.1 /home/bilbo/.node-red/node_modules/node-red-contrib-ifttt
3 Aug 22:20:49 - [debug] Module: node-red-contrib-npm 1.0.2 /home/bilbo/.node-red/node_modules/node-red-contrib-npm
3 Aug 22:20:49 - [debug] Module: node-red-contrib-onvif 1.0.3 /home/bilbo/.node-red/node_modules/node-red-contrib-onvif
3 Aug 22:20:49 - [debug] Module: node-red-contrib-os 0.2.1 /home/bilbo/.node-red/node_modules/node-red-contrib-os
3 Aug 22:20:49 - [debug] Module: node-red-contrib-play-audio 2.5.0 /home/bilbo/.node-red/node_modules/node-red-contrib-play-audio
3 Aug 22:20:49 - [debug] Module: node-red-contrib-protobuf 1.1.0 /home/bilbo/.node-red/node_modules/node-red-contrib-protobuf
3 Aug 22:20:49 - [debug] Module: node-red-contrib-qrcode 0.0.1 /home/bilbo/.node-red/node_modules/node-red-contrib-qrcode
3 Aug 22:20:49 - [debug] Module: node-red-contrib-timeout 1.1.5 /home/bilbo/.node-red/node_modules/node-red-contrib-timeout
3 Aug 22:20:49 - [debug] Module: node-red-contrib-ui-led 0.4.9 /home/bilbo/.node-red/node_modules/node-red-contrib-ui-led
3 Aug 22:20:49 - [debug] Module: node-red-contrib-ui-level 0.1.44 /home/bilbo/.node-red/node_modules/node-red-contrib-ui-level
3 Aug 22:20:49 - [debug] Module: node-red-contrib-ui-media 1.2.0 /home/bilbo/.node-red/node_modules/node-red-contrib-ui-media
3 Aug 22:20:49 - [debug] Module: node-red-contrib-web-worldmap 2.15.5 /home/bilbo/.node-red/node_modules/node-red-contrib-web-worldmap
3 Aug 22:20:49 - [debug] Module: node-red-dashboard 2.30.0 /home/bilbo/.node-red/node_modules/node-red-dashboard
3 Aug 22:20:49 - [debug] Module: node-red-node-base64 0.3.0 /home/bilbo/.node-red/node_modules/node-red-node-base64
3 Aug 22:20:49 - [debug] Module: node-red-node-darksky 0.1.19 /home/bilbo/.node-red/node_modules/node-red-node-darksky
3 Aug 22:20:49 - [debug] Module: node-red-node-discovery 0.0.23 /home/bilbo/.node-red/node_modules/node-red-node-discovery
3 Aug 22:20:49 - [debug] Module: node-red-node-dropbox 1.0.2 /home/bilbo/.node-red/node_modules/node-red-node-dropbox
3 Aug 22:20:49 - [debug] Module: node-red-node-email 1.12.3 /home/bilbo/.node-red/node_modules/node-red-node-email
3 Aug 22:20:49 - [debug] Module: node-red-node-feedparser 0.2.1 /home/bilbo/.node-red/node_modules/node-red-node-feedparser
3 Aug 22:20:49 - [debug] Module: node-red-node-openweathermap 0.5.0 /home/bilbo/.node-red/node_modules/node-red-node-openweathermap
3 Aug 22:20:49 - [debug] Module: node-red-node-random 0.4.0 /home/bilbo/.node-red/node_modules/node-red-node-random
3 Aug 22:20:49 - [debug] Module: node-red-node-rbe 0.5.0 /home/bilbo/.node-red/node_modules/node-red-node-rbe
3 Aug 22:20:49 - [debug] Module: node-red-node-sentiment 0.1.6 /home/bilbo/.node-red/node_modules/node-red-node-sentiment
3 Aug 22:20:49 - [debug] Module: node-red-node-serialport 0.14.1 /home/bilbo/.node-red/node_modules/node-red-node-serialport
3 Aug 22:20:49 - [debug] Module: node-red-node-smooth 0.1.2 /home/bilbo/.node-red/node_modules/node-red-node-smooth
3 Aug 22:20:49 - [debug] Module: node-red-node-sqlite 0.6.0 /home/bilbo/.node-red/node_modules/node-red-node-sqlite
3 Aug 22:20:49 - [debug] Module: node-red-node-suncalc 1.0.1 /home/bilbo/.node-red/node_modules/node-red-node-suncalc
3 Aug 22:20:49 - [debug] Module: node-red-node-tail 0.3.1 /home/bilbo/.node-red/node_modules/node-red-node-tail
3 Aug 22:20:49 - [debug] Module: node-red-node-twitter 1.2.0 /home/bilbo/.node-red/node_modules/node-red-node-twitter
3 Aug 22:20:49 - [debug] Module: node-red-node-ui-lineargauge 0.3.6 /home/bilbo/.node-red/node_modules/node-red-node-ui-lineargauge
Illegal instruction (core dumped)

Just so you know, I've also updated my nodejs to v14LTS

How do I disable nodes individually when I'm not able to launch the node-red and its admin panel?

Normally you can start node red using
node-red --safe
and it will open the editor but not start the flows. However that may not help here as it may be crashing while loading the editor.

Did you run
npm rebuild
in the .node-red folder after upgrading nodejs? If not then that may be the cause of the crash.

Yes, you are correct. I'm unable to launch editor with --safe mode due to crash.
Also, tried with npm rebuild. The problem remains the same.

You can remove nodes that you think might be causing the problem by going into the .node-red folder and running, for example,
npm remove node-red-contrib-whatever
that will prevent it loading the node when you start node-red so when the other nodes have been loaded you will get a message something like Unable to start node-red due to missing nodes. Then you can remove those nodes from the flow, or re-install them from within node-red.

It turns out that a package which I installed from node-red but never really used was causing all the troubles.
I did grep for libvips in the installed modules and found out that it was being used in a package called sharp which is again used by node-red-contrib-onvif.

alpha@home-server:~/.node-red$ npm ls sharp
node-red-project@0.0.1 /home/alpha/.node-red
└─┬ node-red-contrib-onvif@1.0.3
  └── sharp@0.28.3

Upon uninstalling node-red-contrib-onvif, the problem has been resolved.

Thank you all for the useful pointers.

1 Like

Tagging @BartButenaers as I think he may want to know about this.

Hey @Colin,
Good that you mention me!
But in this case it is about node-red-contrib-onvif. My nodes are called node-red-contrib-onvif-nodes...
Bart

Oh yes, sorry.
You can stand down then. :slight_smile:

1 Like

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