question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug] Driver logs are not pushed on main STDOUT/STDERR

See original GitHub issue

We face an issue with the zwave-js Driver logs. When running the command in our Shell, we can see all logs from zwavejs2mqtt and zwave-js driver in console. Once we run a Docker container OR push stdout/stderr logs to a file, Driver logs missing

Testing this: Console output:

❯ node bin/www
 ______                       _     ___                  _   _
|___  /                      (_)   |__ \                | | | |
   / /_      ____ ___   _____ _ ___   ) |_ __ ___   __ _| |_| |_
  / /\ \ /\ / / _` \ \ / / _ \ / __| / /| '_ ` _ \ / _` | __| __|
 / /__\ V  V / (_| |\ V /  __/ \__ \/ /_| | | | | | (_| | |_| |_
/_____|\_/\_/ \__,_| \_/ \___| |___/____|_| |_| |_|\__, |\__|\__|
                            _/ |                      | |
                           |__/                       |_|
2020-12-17 19:49:14.791 WARN STORE: scenes.json not found
2020-12-17 19:49:14.793 WARN STORE: nodes.json not found
2020-12-17 19:49:15.172 INFO APP: Version: 1.0.0-alpha.0.023fccf
2020-12-17 19:49:15.173 INFO APP: Application path:/home/billias/ongit/zwavejs2mqtt
2020-12-17 19:49:15.218 INFO MQTT: Connecting to mqtt://mqtt.data:1883
2020-12-17 19:49:15.255 INFO ZWAVE: Connecting to /dev/ttyACM0
19:49:15.257 DRIVER   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—    β–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•—   β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—             β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
                      β•šβ•β•β–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘    β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β•β•β•             β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β•β•β•
                        β–ˆβ–ˆβ–ˆβ•”β•  β–ˆβ–ˆβ•‘ β–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—      β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
                       β–ˆβ–ˆβ–ˆβ•”β•   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•”β•β•β•   β•šβ•β•β•β•β• β–ˆβ–ˆ   β–ˆβ–ˆβ•‘ β•šβ•β•β•β•β–ˆβ–ˆβ•‘
                      β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β•šβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘  β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—        β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘
                      β•šβ•β•β•β•β•β•β•  β•šβ•β•β•β•šβ•β•β•  β•šβ•β•  β•šβ•β•   β•šβ•β•β•β•   β•šβ•β•β•β•β•β•β•         β•šβ•β•β•β•β•  β•šβ•β•β•β•β•β•β•
19:49:15.258 DRIVER   version 5.5.0
19:49:15.258 DRIVER
19:49:15.258 DRIVER   starting driver...
19:49:15.267 DRIVER   Send queue: (empty)                                               (0 messages)
19:49:15.267 DRIVER   send thread state: idle
19:49:15.268 DRIVER   opening serial port /dev/ttyACM0
2020-12-17 19:49:15.273 INFO APP: Listening on port 8091
2020-12-17 19:49:15.274 INFO MQTT: getaddrinfo ENOTFOUND mqtt.data mqtt.data:1883
2020-12-17 19:49:15.276 INFO MQTT: MQTT client offline
2020-12-17 19:49:15.277 INFO MQTT: MQTT client closed
19:49:15.277 DRIVER   serial port errored: Error: No such file or directory, cannot open /dev/ttyACM
                      0
19:49:15.278 DRIVER   destroying driver instance...
19:49:15.279 DRIVER   destroying driver instance...
2020-12-17 19:49:15.279 INFO ZWAVE: Driver: Error: No such file or directory, cannot open /dev/ttyACM0
2020-12-17 19:49:15.280 WARN ZWAVE: Retry connection in 3 seconds...
^C2020-12-17 19:49:16.041 INFO APP: Closing clients...
2020-12-17 19:49:16.042 INFO GATEWAY: Closing Gateway...
19:49:16.043 DRIVER   destroying driver instance...

Pushing STDOUT to a file (like docker does)

❯ node bin/www 1>a 2>b
^C%                                                                                                                                                                   

 ❯ cat a
 ______                       _     ___                  _   _
|___  /                      (_)   |__ \                | | | |
   / /_      ____ ___   _____ _ ___   ) |_ __ ___   __ _| |_| |_
  / /\ \ /\ / / _` \ \ / / _ \ / __| / /| '_ ` _ \ / _` | __| __|
 / /__\ V  V / (_| |\ V /  __/ \__ \/ /_| | | | | | (_| | |_| |_
/_____|\_/\_/ \__,_| \_/ \___| |___/____|_| |_| |_|\__, |\__|\__|
                            _/ |                      | |
                           |__/                       |_|
2020-12-17 19:48:37.324 WARN STORE: scenes.json not found
2020-12-17 19:48:37.325 WARN STORE: nodes.json not found
2020-12-17 19:48:37.694 INFO APP: Version: 1.0.0-alpha.0.023fccf
2020-12-17 19:48:37.695 INFO APP: Application path:/home/billias/ongit/zwavejs2mqtt
2020-12-17 19:48:37.735 INFO MQTT: Connecting to mqtt://mqtt.data:1883
2020-12-17 19:48:37.769 INFO ZWAVE: Connecting to /dev/ttyACM0
2020-12-17 19:48:37.780 INFO APP: Listening on port 8091
2020-12-17 19:48:37.781 INFO MQTT: getaddrinfo ENOTFOUND mqtt.data mqtt.data:1883
2020-12-17 19:48:37.783 INFO MQTT: MQTT client offline
2020-12-17 19:48:37.783 INFO MQTT: MQTT client closed
2020-12-17 19:48:37.784 INFO ZWAVE: Driver: Error: No such file or directory, cannot open /dev/ttyACM0
2020-12-17 19:48:37.784 WARN ZWAVE: Retry connection in 3 seconds...
2020-12-17 19:48:38.392 INFO APP: Closing clients...
2020-12-17 19:48:38.394 INFO GATEWAY: Closing Gateway...
 ❯ cat b

b file is STDERR and is empty

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
varet80commented, Dec 21, 2020

Would it give us also possibility to push logs without tty? If thsi is easy to add as option, might worth! more people move to containers, and the load on cpu (for more power systems like rPi4) can be helpful during debugging

File can be worst than stdout, due to more load on system. Ofcourse you could assume we can redirect file to stdout. but still hacky way.

1reaction
AlCalzonecommented, Dec 18, 2020

Could you please try changes a) and/or b) and see if it changes things?

Open packages\zwave-js\src\lib\log\Driver.ts
a) in lines 33, 34, 39 replace "driver" with a different key
b) in line 27, change the loglevel from "verbose" to "debug" or "info".
Compile and link the packages, as described here

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nomad stops streaming Docker stderr/stdout logs to ... - GitHub
I seem to be seeing this behaviour as well. I'm not sure how to correlate logmon and docker_logger to the respective containers but...
Read more >
Confused about stdin, stdout and stderr? - Stack Overflow
Most programs need to read input, write output, and log errors, so stdin ... When opened the standard error stream is not fully...
Read more >
Cluster-level Logging in Kubernetes with Fluentd - Medium
Docker containers in Kubernetes write logs to standard output ( stdout ) and standard ( stderr ) error streams. Docker redirects these streamsΒ ......
Read more >
Where Are Docker Container Logs Stored? - Sematext
I strongly recommend not changing the log driver! Let's start debugging. First of all, to list all running containers, use the docker ps...
Read more >
Databricks Cluster Logs Driver stdout - delayed in dbfs location
Every time, the UI shows me the stdout information very quickly but when I try to read the same from dbfs location, it's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found