Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] zwavejs 5.0.0 doesn't run #1326

Closed
4 of 7 tasks
yajrendrag opened this issue Jun 10, 2021 · 15 comments · Fixed by #1334
Closed
4 of 7 tasks

[bug] zwavejs 5.0.0 doesn't run #1326

yajrendrag opened this issue Jun 10, 2021 · 15 comments · Fixed by #1334
Assignees
Labels
bug Something isn't working

Comments

@yajrendrag
Copy link

yajrendrag commented Jun 10, 2021

Version

Checklist:

  • I am not using HomeAssistant. Or: a developer has told me to come here. - i opened at HomeAssistant and they instructed me to open issue here
  • I have checked the troubleshooting section and my problem is not described there.
  • I have read the changelog problem was not mentioned there.

Build/Run method

  • Docker
  • PKG
  • Snap package
  • Manually built (git clone - yarn install - yarn run build )

zwavejs2mqtt version: 5.0.0
zwave-js version: 7.7.3

Describe the bug

zwavejs2mqtt doesn't start

Error in logfile:

Writing the device index to disk failed: File or directory '/**/zwavejs2mqtt/node_modules/@zwave-js/config/config/devices/index.json' was not included into executable at compilation stage. Please recompile adding it as asset or script

Results of systemctl status zwavejs2mqtt:
● zwavejs2mqtt.service - zwavejs2mqtt server
Loaded: loaded (/etc/systemd/system/zwavejs2mqtt.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2021-06-10 13:52:27 MDT; 11s ago
Process: 45269 ExecStart=/home/jhass/zwavejs2mqtt/zwavejs2mqtt (code=exited, status=1/FAILURE)
Main PID: 45269 (code=exited, status=1/FAILURE)

Jun 10 13:52:27 hass zwavejs2mqtt[45269]: at Object.Module._extensions..node (internal/modules/cjs/loader.js:1248:18)
Jun 10 13:52:27 hass zwavejs2mqtt[45269]: at Module.load (internal/modules/cjs/loader.js:1047:32)
Jun 10 13:52:27 hass zwavejs2mqtt[45269]: at Function.Module._load (internal/modules/cjs/loader.js:935:14)
Jun 10 13:52:27 hass zwavejs2mqtt[45269]: at Module.require (internal/modules/cjs/loader.js:1087:19)
Jun 10 13:52:27 hass zwavejs2mqtt[45269]: at Module.require (pkg/prelude/bootstrap.js:1338:31)
Jun 10 13:52:27 hass zwavejs2mqtt[45269]: at require (internal/modules/cjs/helpers.js:73:18)
Jun 10 13:52:27 hass zwavejs2mqtt[45269]: at bindings (/snapshot/zwavejs2mqtt/node_modules/bindings/bindings.js:112:48)
Jun 10 13:52:27 hass zwavejs2mqtt[45269]: at Object. (/snapshot/zwavejs2mqtt/node_modules/@serialport/bindings/lib/linux.js:2:3
Jun 10 13:52:27 hass systemd[1]: zwavejs2mqtt.service: Main process exited, code=exited, status=1/FAILURE
Jun 10 13:52:27 hass systemd[1]: zwavejs2mqtt.service: Failed with result 'exit-code'.


### To Reproduce

Steps to reproduce the behavior:

1. stop zwavejs2mqtt
2. upgrade to zwavejs2mqtt v5.0.0 by unzipping zwavejs2mqtt-v5.0.0.zip
3. start zwavejs2mqtt (i have a systemd unit file, so i simply do systemctl start zwavejs2mqtt

### Expected behavior

zwavejs2mqtt should be running when i check via `pgrep zwavejs2mqtt`
it isn't running, however.

### Additional context

Reinstalling zwavejs2mqtt v 4.5.2 runs fine.

- zwavejs2mqtt is installed on my hass machine via git clone from the repository
- first i stop zwavejs2mqtt
- i simply unzip and overwrite bindings.node and zwavejs2mqtt executable
- then i restart by `systemctl start zwavejs2mqtt`
- contents of my systemd unit file:

[Unit]
Description=zwavejs2mqtt server
After=network-online.target

[Service]
Type=simple
User=jhass
WorkingDirectory=/home/jhass/zwavejs2mqtt
ExecStart=/home/jhass/zwavejs2mqtt/zwavejs2mqtt

[Install]
WantedBy=multi-user.target
@RualdOrdelman
Copy link

RualdOrdelman commented Jun 11, 2021

@robertsLando Maybe it's the same issue. I did a container recreate to update to release 5.00. After that upgrade the containers starts successful but ZwaveJs2Mqtt isn't running. I saw the following error in de log in the Docker container

`Error: Cannot find module '/usr/src/app/bin/www'

at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)

at Function.Module._load (node:internal/modules/cjs/loader:769:27)

at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)

at node:internal/main/run_main_module:17:47 {

code: 'MODULE_NOT_FOUND',

requireStack: []

}

node:internal/modules/cjs/loader:927

throw err;

^
`

@robertsLando
Copy link
Member

robertsLando commented Jun 11, 2021

@RualdOrdelman Could you try to remove the container, drop the local z2m image and pull a fresh new one using latest tag?

@robertsLando
Copy link
Member

@yajrendrag Please show me all the steps you are doing to run z2m. I think you may have forgot to run npm install or npm run build? Or are you using pkg version?

@yajrendrag
Copy link
Author

i am running a package version. i simply unzip it - it overwrites the bindings.node and zwavejs2mqtt executable, then i start with systemctl. (see initial post additional context section for my systemd unit file). BTW, i do have a 2nd instance that i run in docker and that one runs fine (& i updated that one like you suggest avboce - removing container, dropping the image and then pull a new one with latest tag).

@yajrendrag
Copy link
Author

tried the fix - still doesn't work... different error message now:

log file content after installing release 5.01:

2021-06-15T06:50:12.618Z CNTRLR   [Node 071] The node did not respond after 1 attempts.
                                  It is probably asleep, moving its messages to the wakeup queue.
2021-06-15T07:49:11.503Z CNTRLR   [Node 071] The node did not respond after 1 attempts.
                                  It is probably asleep, moving its messages to the wakeup queue.
2021-06-15T08:48:10.217Z CNTRLR   [Node 071] The node did not respond after 1 attempts.
                                  It is probably asleep, moving its messages to the wakeup queue.
2021-06-15T09:47:12.632Z CNTRLR   [Node 071] The node did not respond after 1 attempts.
                                  It is probably asleep, moving its messages to the wakeup queue.
2021-06-15T10:46:11.506Z CNTRLR   [Node 071] The node did not respond after 1 attempts.
                                  It is probably asleep, moving its messages to the wakeup queue.
2021-06-15T11:45:12.128Z CNTRLR   [Node 071] The node did not respond after 1 attempts.
                                  It is probably asleep, moving its messages to the wakeup queue.
2021-06-15T12:44:10.179Z CNTRLR   [Node 071] The node did not respond after 1 attempts.
                                  It is probably asleep, moving its messages to the wakeup queue.
2021-06-15T13:43:10.395Z CNTRLR   [Node 071] The node did not respond after 1 attempts.
                                  It is probably asleep, moving its messages to the wakeup queue.

systemctl status message:

root@hass:/home/jhass/zwavejs2mqtt# systemctl status zwavejs2mqtt
● zwavejs2mqtt.service - zwavejs2mqtt server
   Loaded: loaded (/etc/systemd/system/zwavejs2mqtt.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2021-06-15 08:46:16 MDT; 56s ago
  Process: 265 ExecStart=/home/jhass/zwavejs2mqtt/zwavejs2mqtt (code=exited, status=1/FAILURE)
 Main PID: 265 (code=exited, status=1/FAILURE)

Jun 15 08:46:16 hass zwavejs2mqtt[265]:     at Object.Module._extensions..node (internal/modules/cjs/loader.js:1248:18)
Jun 15 08:46:16 hass zwavejs2mqtt[265]:     at Module.load (internal/modules/cjs/loader.js:1047:32)
Jun 15 08:46:16 hass zwavejs2mqtt[265]:     at Function.Module._load (internal/modules/cjs/loader.js:935:14)
Jun 15 08:46:16 hass zwavejs2mqtt[265]:     at Module.require (internal/modules/cjs/loader.js:1087:19)
Jun 15 08:46:16 hass zwavejs2mqtt[265]:     at Module.require (pkg/prelude/bootstrap.js:1338:31)
Jun 15 08:46:16 hass zwavejs2mqtt[265]:     at require (internal/modules/cjs/helpers.js:73:18)
Jun 15 08:46:16 hass zwavejs2mqtt[265]:     at bindings (/snapshot/zwavejs2mqtt/node_modules/bindings/bindings.js:112:48)
Jun 15 08:46:16 hass zwavejs2mqtt[265]:     at Object.<anonymous> (/snapshot/zwavejs2mqtt/node_modules/@serialport/bindings/lib/linux.js:2:36)
Jun 15 08:46:16 hass systemd[1]: zwavejs2mqtt.service: Main process exited, code=exited, status=1/FAILURE
Jun 15 08:46:16 hass systemd[1]: zwavejs2mqtt.service: Failed with result 'exit-code'.

@robertsLando
Copy link
Member

robertsLando commented Jun 15, 2021

@yajrendrag Could you please share the complete log output of the service?

@yajrendrag
Copy link
Author

sure, but need a little help understanding what you mean by "complete log output" - are you looking for store/zwavejs_[date].log or something else/additional? if just that file, then above output was the complete output in the logfile after upgrading, but am happy to do it again... there are other log files in the store directory, but am thinking some may be old... as well as additional content in syslog..

@robertsLando
Copy link
Member

Actually also the outupt you attached in your previous command is trimmed. I mean systemctl status zwavejs2mqtt command. I'm working on this btw in #1346 but as you can see it needs a fix from pkg package

@yajrendrag
Copy link
Author

ok, will be back in front of it in about 6 hours from now and will send then..

@yajrendrag
Copy link
Author

ok, here's a shell session which should show everything you're looking for...

root@hass:/home/jhass/zwavejs2mqtt# systemctl stop zwavejs2mqtt
root@hass:/home/jhass/zwavejs2mqtt# date
Tue Jun 15 17:32:13 MDT 2021
root@hass:/home/jhass/zwavejs2mqtt# pgrep zwavejs2mqtt
root@hass:/home/jhass/zwavejs2mqtt# unzip zwavejs2mqtt-v5.0.1.zip
Archive:  zwavejs2mqtt-v5.0.1.zip
replace bindings.node? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: bindings.node           
replace zwavejs2mqtt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: zwavejs2mqtt            
root@hass:/home/jhass/zwavejs2mqtt# systemctl start zwavejs2mqtt
root@hass:/home/jhass/zwavejs2mqtt# pgrep zwavejs2mqtt
root@hass:/home/jhass/zwavejs2mqtt# systemctl status zwavejs2mqtt
● zwavejs2mqtt.service - zwavejs2mqtt server
   Loaded: loaded (/etc/systemd/system/zwavejs2mqtt.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2021-06-15 17:32:57 MDT; 18s ago
  Process: 5859 ExecStart=/home/jhass/zwavejs2mqtt/zwavejs2mqtt (code=exited, status=1/FAILURE)
 Main PID: 5859 (code=exited, status=1/FAILURE)

Jun 15 17:32:57 hass zwavejs2mqtt[5859]:     at Object.Module._extensions..node (internal/modules/cjs/loader.js:1248:18)
Jun 15 17:32:57 hass zwavejs2mqtt[5859]:     at Module.load (internal/modules/cjs/loader.js:1047:32)
Jun 15 17:32:57 hass zwavejs2mqtt[5859]:     at Function.Module._load (internal/modules/cjs/loader.js:935:14)
Jun 15 17:32:57 hass zwavejs2mqtt[5859]:     at Module.require (internal/modules/cjs/loader.js:1087:19)
Jun 15 17:32:57 hass zwavejs2mqtt[5859]:     at Module.require (pkg/prelude/bootstrap.js:1338:31)
Jun 15 17:32:57 hass zwavejs2mqtt[5859]:     at require (internal/modules/cjs/helpers.js:73:18)
Jun 15 17:32:57 hass zwavejs2mqtt[5859]:     at bindings (/snapshot/zwavejs2mqtt/node_modules/bindings/bindings.js:112:48)
Jun 15 17:32:57 hass zwavejs2mqtt[5859]:     at Object.<anonymous> (/snapshot/zwavejs2mqtt/node_modules/@serialport/bindings/lib/linux.js:2:36)
Jun 15 17:32:57 hass systemd[1]: zwavejs2mqtt.service: Main process exited, code=exited, status=1/FAILURE
Jun 15 17:32:57 hass systemd[1]: zwavejs2mqtt.service: Failed with result 'exit-code'.
root@hass:/home/jhass/zwavejs2mqtt# 
root@hass:/home/jhass/zwavejs2mqtt# 
root@hass:/home/jhass/zwavejs2mqtt# date
Tue Jun 15 17:33:24 MDT 2021
root@hass:/home/jhass/zwavejs2mqtt# 

There are a couple of lines in syslog from the same time as the systemctl status command - that don't appear in the output of systemctl status - here's the full list from syslog - it's the 1st 8 lines that don't appear in the systemctl status command:

Jun 15 17:32:57 hass systemd[1]: zwavejs2mqtt.service: Failed to reset devices.list: Operation not permitted
Jun 15 17:32:57 hass systemd[1]: Started zwavejs2mqtt server.
Jun 15 17:32:57 hass zwavejs2mqtt[5859]: pkg/prelude/bootstrap.js:1359
Jun 15 17:32:57 hass zwavejs2mqtt[5859]:       throw error;
Jun 15 17:32:57 hass zwavejs2mqtt[5859]:       ^
Jun 15 17:32:57 hass zwavejs2mqtt[5859]: Error: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /home/jhass/zwavejs2mqtt/bindings.node)
Jun 15 17:32:57 hass zwavejs2mqtt[5859]:     at tryImporting (pkg/prelude/bootstrap.js:1736:37)
Jun 15 17:32:57 hass zwavejs2mqtt[5859]:     at process.dlopen (pkg/prelude/bootstrap.js:1762:5)
Jun 15 17:32:57 hass zwavejs2mqtt[5859]:     at Object.Module._extensions..node (internal/modules/cjs/loader.js:1248:18)
Jun 15 17:32:57 hass zwavejs2mqtt[5859]:     at Module.load (internal/modules/cjs/loader.js:1047:32)
Jun 15 17:32:57 hass zwavejs2mqtt[5859]:     at Function.Module._load (internal/modules/cjs/loader.js:935:14)
Jun 15 17:32:57 hass zwavejs2mqtt[5859]:     at Module.require (internal/modules/cjs/loader.js:1087:19)
Jun 15 17:32:57 hass zwavejs2mqtt[5859]:     at Module.require (pkg/prelude/bootstrap.js:1338:31)
Jun 15 17:32:57 hass zwavejs2mqtt[5859]:     at require (internal/modules/cjs/helpers.js:73:18)
Jun 15 17:32:57 hass zwavejs2mqtt[5859]:     at bindings (/snapshot/zwavejs2mqtt/node_modules/bindings/bindings.js:112:48)
Jun 15 17:32:57 hass zwavejs2mqtt[5859]:     at Object.<anonymous> (/snapshot/zwavejs2mqtt/node_modules/@serialport/bindings/lib/linux.js:2:36)
Jun 15 17:32:57 hass systemd[1]: zwavejs2mqtt.service: Main process exited, code=exited, status=1/FAILURE
Jun 15 17:32:57 hass systemd[1]: zwavejs2mqtt.service: Failed with result 'exit-code'.

@robertsLando
Copy link
Member

@yajrendrag Ok so this is a problem with serialport binidings, we are speaking about it with serialport authors. BTW did you also try with 5.0.2?

@yajrendrag
Copy link
Author

same problem with 5.0.2

@robertsLando
Copy link
Member

Wait until #1346 is fixed

@yajrendrag
Copy link
Author

yajrendrag commented Jul 10, 2021

Evidently, i can't update hass now as #1346 is still open and homeassistant 2021.7.x needs a newer version of zwavejs than i'm able to run using the pkg version... so, wondering if it's possible/easy to migrate to a docker version? can i just map my store directory that i use w/ the pkg version to the /usr/src/app/store directory in the container?

@robertsLando
Copy link
Member

Fixed, release is coming

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants