zwave-js / node-red-contrib-zwave-js

The most powerful, high performing and highly polished Z-Wave node for Node-RED based on Z-Wave JS. If you want a fully featured Z-Wave framework in your Node-RED instance, you have found it.
MIT License
47 stars 6 forks source link

[Bug]: #205

Closed fabnavigator closed 2 years ago

fabnavigator commented 2 years ago

Contact Details (optional)

wcmarinelli@gmail.com

What happened?

I followed the instructions:

cd ~/.node-red
npm install node-red-contrib-zwave-js@beta --force

and node-red doesn't start now.

Note: I run node-red in a docker container.

*** I know you said "Please raise issues on PR #204", but I didn't see how to do that.

How to reproduce?

I restart the node-red docker container.

Version

7.0.0

Node-RED Version

2.2.2

What hardware are you seeing the problem on?

Raspberry Pi

Relevant Z-Wave-JS log output

> node-red-docker@2.2.2 start
> node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"
29 Apr 16:34:34 - [info] 
Welcome to Node-RED
===================
29 Apr 16:34:34 - [info] Node-RED version: v2.2.2
29 Apr 16:34:34 - [info] Node.js  version: v16.13.1
29 Apr 16:34:34 - [info] Linux 5.15.32-v8+ arm64 LE
29 Apr 16:34:35 - [info] Loading palette nodes
29 Apr 16:34:39 - [info] Dashboard version 3.1.6 started at /ui
29 Apr 16:34:39 - [info] Settings file  : /data/settings.js
29 Apr 16:34:39 - [info] Context store  : 'default' [module=localfilesystem]
29 Apr 16:34:39 - [info] Context store  : 'memory' [module=memory]
29 Apr 16:34:39 - [info] User directory : /data
29 Apr 16:34:39 - [warn] Projects disabled : editorTheme.projects.enabled=false
29 Apr 16:34:39 - [info] Flows file     : /data/flows.json
29 Apr 16:34:39 - [info] Server now running at http://127.0.0.1:1880/
29 Apr 16:34:39 - [info] Starting flows
29 Apr 16:34:40 - [info] Started flows
npm ERR! path /usr/src/node-red
npm ERR! command failed
npm ERR! signal SIGSEGV
npm ERR! command sh -c node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"
npm ERR! A complete log of this run can be found in:
npm ERR!     /data/.npm/_logs/2022-04-29T20_34_41_543Z-debug.log

/data/.npm/_logs/2022-04-29T20_34_41_543Z-debug.log:

0 verbose cli [
0 verbose cli   '/usr/local/bin/node',
0 verbose cli   '/usr/local/bin/npm',
0 verbose cli   '--no-update-notifier',
0 verbose cli   '--no-fund',
0 verbose cli   'start',
0 verbose cli   '--cache',
0 verbose cli   '/data/.npm',
0 verbose cli   '--',
0 verbose cli   '--userDir',
0 verbose cli   '/data'
0 verbose cli ]
1 info using npm@8.1.2
2 info using node@v16.13.1
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 6ms
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 3ms
6 timing config:load:builtin Completed in 3ms
7 timing config:load:cli Completed in 7ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:/usr/src/node-red/.npmrc Completed in 0ms
10 timing config:load:project Completed in 4ms
11 timing config:load:file:/.npmrc Completed in 0ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:/usr/local/etc/npmrc Completed in 1ms
14 timing config:load:global Completed in 1ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:credentials Completed in 3ms
17 timing config:load:setEnvs Completed in 5ms
18 timing config:load Completed in 32ms
19 timing npm:load:configload Completed in 32ms
20 timing npm:load:setTitle Completed in 1ms
21 timing npm:load:setupLog Completed in 2ms
22 timing config:load:flatten Completed in 11ms
23 timing npm:load:cleanupLog Completed in 7ms
24 timing npm:load:configScope Completed in 0ms
25 timing npm:load:projectScope Completed in 2ms
26 timing npm:load Completed in 57ms
27 timing command:run-script Completed in 8490ms
28 timing command:start Completed in 8501ms
29 verbose stack Error: command failed
29 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
29 verbose stack     at ChildProcess.emit (node:events:390:28)
29 verbose stack     at maybeClose (node:internal/child_process:1064:16)
29 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
30 verbose pkgid node-red-docker@2.2.2
31 verbose cwd /usr/src/node-red
32 verbose Linux 5.15.32-v8+
33 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "--no-update-notifier" "--no-fund" "start" "--cache" "/data/.npm" "--" "--userDir" "/data"
34 verbose node v16.13.1
35 verbose npm  v8.1.2
36 error path /usr/src/node-red
37 error command failed
38 error signal SIGSEGV
39 error command sh -c node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"
40 verbose exit 1
marcus-j-davies commented 2 years ago

Hi @fabnavigator, zwave js V9 will convert files - does the container have write permissions. Disclaimer; I know nothing about docker

marcus-j-davies commented 2 years ago

I currently can't think of anything else that would cause a black out like this. nothing is pointing at the zwave module causing it - but the files write access is my only assumption

the only thing I can see is this: 29 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27) which is not connected to anything zwave

Can you enable any further logging?

fabnavigator commented 2 years ago

I was able to get back to 6.5.5 and everything is working again. I will look into the permissions issue.

fabnavigator commented 2 years ago

If I recall, I initially had issues when I installed with npm. Everything worked when I installed using Manage Palette from with node-red. Is there a way to install the beta version from the Manage Palette UI?

marcus-j-davies commented 2 years ago

OK - it might be the serial port update (it now uses V10 of serial port), which changes compilation. can you try the following in your Node-RED docker container?

npm install serialport - to see what happens?

Is there a way to install the beta version from the Manage Palette UI?

there isn't sadly (at least to my knowledge)

fabnavigator commented 2 years ago
bash-5.0# npm list
node-red-docker@2.2.2 /usr/src/node-red
+-- node-red@2.2.2
`-- serialport@10.4.0

It looks like it worked. What now?

marcus-j-davies commented 2 years ago

ok and a restart if NR is still fine?

again I know nothing about docker 😁

fabnavigator commented 2 years ago

I did a restart. NR is still okay.

marcus-j-davies commented 2 years ago

ok,

now npm install node-red-contrib-zwave-js@beta Ensure your console environment is the one that NR is running under.

I don't know how docker works - but I do know console commands can use a different node version that NR its self is using -which can have complications.

I therefore suggest any console commands are under the same umbrella as NR - what ever that means 😅

installs are fine so far - but docker adds a layer that I don't know enough about, if needs be, I'll try it here

marcus-j-davies commented 2 years ago

Im going to move this to a convo - I like to keep things on issues related to release versions