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] node process exit when saving config. #27

Closed
1 of 3 tasks
varet80 opened this issue Nov 24, 2020 · 13 comments · Fixed by #32 or #34
Closed
1 of 3 tasks

[bug] node process exit when saving config. #27

varet80 opened this issue Nov 24, 2020 · 13 comments · Fixed by #32 or #34
Assignees
Labels
bug Something isn't working

Comments

@varet80
Copy link
Collaborator

varet80 commented Nov 24, 2020

Version

Build/Run method

  • Docker
  • PKG
  • Manually built (git clone - npm install - npm run build )

zwavejs2mqtt version: master

When saving the configuration on zwavejs2mqtt web interface process exits

running npm with trace-exit

Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:208:20)
18:27:41.267 DRIVER   destroying driver instance...
18:27:41.269 DRIVER   destroying driver instance...
18:27:41.270 DRIVER   destroying driver instance...
(node:66) WARNING: Exited the environment with code 1
    at exit (internal/process/per_thread.js:172:13)
    at /usr/src/app/node_modules/@sentry/node/dist/handlers.js:231:24
    at onfulfilled (/usr/src/app/node_modules/@sentry/utils/dist/syncpromise.js:138:33)
    at /usr/src/app/node_modules/@sentry/utils/dist/syncpromise.js:67:33
    at SyncPromise._executeHandlers (/usr/src/app/node_modules/@sentry/utils/dist/syncpromise.js:60:28)
    at SyncPromise._setResult (/usr/src/app/node_modules/@sentry/utils/dist/syncpromise.js:45:19)
    at SyncPromise._resolve (/usr/src/app/node_modules/@sentry/utils/dist/syncpromise.js:28:19)
    at onfulfilled (/usr/src/app/node_modules/@sentry/utils/dist/syncpromise.js:138:25)
    at /usr/src/app/node_modules/@sentry/utils/dist/syncpromise.js:67:33
    at SyncPromise._executeHandlers (/usr/src/app/node_modules/@sentry/utils/dist/syncpromise.js:60:28)
/usr/src/app #zwavejs2mqtt 

i receive as error

@varet80 varet80 added the bug Something isn't working label Nov 24, 2020
@varet80 varet80 changed the title [bug] [bug] node process exit when saving config. Nov 24, 2020
@robertsLando
Copy link
Member

18:27:41.267 DRIVER destroying driver instance...
18:27:41.269 DRIVER destroying driver instance...
18:27:41.270 DRIVER destroying driver instance...

I don't understand why there are 3 logs, like that, also seems something related to @sentry module used by zwave-js, @AlCalzone do you have any idea?

@AlCalzone
Copy link
Member

The destroying driver instance should be no problem, but we can just avoid executing the method multiple times.

About sentry: I haven't seen that warning before. It is probably because it was trying to send an error log while shutting down the process.

@robertsLando
Copy link
Member

robertsLando commented Nov 25, 2020

The problem is that, based on what @billiaz said to me, that error caused the process to exit

@AlCalzone
Copy link
Member

Sentry should do nothing until a fatal error occurs (or I tell it to capture a message).
So it is more likely that something crashed, sentry tries to capture the error, then calls process.exit(1).

@robertsLando
Copy link
Member

Ok what I'm missing so is that fatal error, cannot see any stack trace of that and that's why I don't understand where it's coming from 😕

@billiaz Does this happens EVERY time you save new settings?

@varet80
Copy link
Collaborator Author

varet80 commented Nov 25, 2020

@robertsLando noticed it happens 99% of the times.

@AlCalzone
Copy link
Member

That does sound like something crashes. I've never seen the warning before

@varet80
Copy link
Collaborator Author

varet80 commented Nov 25, 2020

i had to run and get this using the --trace-exit command or something similar in node, otherwise logs where giving nothing.

@AlCalzone
Copy link
Member

Any chance to narrow down where the error is coming from? E.g. an unhandledException handler in z2m? @robertsLando

@robertsLando
Copy link
Member

robertsLando commented Nov 26, 2020

@billiaz Could you try with #32 ?

@AlCalzone
Copy link
Member

@robertsLando did you find out whats happening?

@robertsLando
Copy link
Member

@AlCalzone Not sure but I'm trying :)

@robertsLando
Copy link
Member

Now it's fixed 🎉

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
3 participants