zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Error on start on docker

Open 3DIRK opened this issue 7 years ago • 20 comments

Bug Report

What happened

Docker environment: First start after creating container zigbee2mqtt refuses to start with an error. Second time starting the container zigbee2mqtt comes up.

What did you expect to happen

Clean start

How to reproduce it (minimal and precise)

Latest docker image - create and start container

Debug Info

zigbee2mqtt version: latest dev (zigbee2mqtt version 1.6.0 (commit #d53e133)) CC253X firmware version: latest

zigbee2mqqt debug log: https://pastebin.com/RNeTxrWP npm log: https://pastebin.com/EsZMUxss

3DIRK avatar Sep 12 '19 13:09 3DIRK

Can you provide the logging with DEBUG=* npm start? (for docker set environment variable DEBUG to *)

Koenkk avatar Sep 12 '19 19:09 Koenkk

Here you are (this is the "docker container logs <>" log. https://pastebin.com/gMjnw8sy

The log in /app/data/log/2019-09-13.09-32-47/log.txt is rather unmeaning https://pastebin.com/bwa6XhqR

3DIRK avatar Sep 13 '19 08:09 3DIRK

Can you check if the issue has been fixed in the latest dev branch?

Koenkk avatar Sep 14 '19 06:09 Koenkk

Hello, I also have a problem using the newest docker image. I flashed my CC2530 with the latest Stack Firmware, then updated the zigbee2mqtt docker container (build 4 days ago). The container keeps crashing every time I start it.

Here is the part from docker-compose.yaml: `zigbee: container_name: zigbee2mqtt image: koenkk/zigbee2mqtt volumes: - ./zigbee2mqqt/data:/app/data devices: - /dev/ttyUSB0:/dev/ttyUSB0 restart: always networks: - fhem-network

networks: fhem-network: driver: bridge `

Here is the log from zigbee2mqtt 9/14/2019, 8:51:31 AM - info: Logging to directory: '/app/data/log/2019-09-14.08-51-31' 9/14/2019, 8:51:31 AM - info: Starting zigbee2mqtt version 1.6.0 (commit #e26ad2a) 9/14/2019, 8:51:31 AM - info: Starting zigbee-shepherd 9/14/2019, 8:51:33 AM - info: Error while starting zigbee-shepherd, attempting to fix... (takes 60 seconds) (Error: Cluster with key '64527' does not exist) 9/14/2019, 8:52:33 AM - info: Starting zigbee-shepherd 9/14/2019, 8:52:35 AM - error: Error while starting zigbee-shepherd! (Error: dev exists, unregister it first.)

And here the log from docker: `sing '/app/data' as data directory

[email protected] start /app node index.js

 zigbee2mqtt:info 9/14/2019, 8:52:37 AM Logging to directory: '/app/data/log/2019-09-14.08-52-37'  zigbee2mqtt:info 9/14/2019, 8:52:37 AM Starting zigbee2mqtt version 1.6.0 (commit #e26ad2a)  zigbee2mqtt:info 9/14/2019, 8:52:37 AM Starting zigbee-shepherd  zigbee2mqtt:info 9/14/2019, 8:52:39 AM Error while starting zigbee-shepherd, attempting to fix... (takes 60 seconds) (Error: Cluster with key '64527' does not exist)  zigbee2mqtt:info 9/14/2019, 8:53:39 AM Starting zigbee-shepherd  zigbee2mqtt:error 9/14/2019, 8:53:40 AM Error while starting zigbee-shepherd! (Error: dev exists, unregister it first.)  zigbee2mqtt:error 9/14/2019, 8:53:40 AM Press the reset button on the stick (the one closest to the USB) and start again  zigbee2mqtt:error 9/14/2019, 8:53:40 AM Failed to start {"message":"dev exists, unregister it first.","stack":"Error: dev exists, unregister it first.\n at /app/node_modules/zigbee-herdsman/dist/lib/shepherd.js:449:19\n at Promise.apply (/app/node_modules/zigbee-herdsman/node_modules/q/q.js:1185:26)\n at Promise.promise.promiseDispatch (/app/node_modules/zigbee-herdsman/node_modules/q/q.js:808:41)\n at /app/node_modules/zigbee-herdsman/node_modules/q/q.js:1411:14\n at runSingle (/app/node_modules/zigbee-herdsman/node_modules/q/q.js:137:13)\n at flush (/app/node_modules/zigbee-herdsman/node_modules/q/q.js:125:13)\n at process._tickCallback (internal/process/next_tick.js:61:11)"}  zigbee2mqtt:error 9/14/2019, 8:53:40 AM Exiting... npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] start: node index.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2019-09-14T08_53_40_769Z-debug.log Using '/app/data' as data directory

[email protected] start /app node index.js

 zigbee2mqtt:info 9/14/2019, 8:53:43 AM Logging to directory: '/app/data/log/2019-09-14.08-53-42'  zigbee2mqtt:info 9/14/2019, 8:53:43 AM Starting zigbee2mqtt version 1.6.0 (commit #e26ad2a)  zigbee2mqtt:info 9/14/2019, 8:53:43 AM Starting zigbee-shepherd  zigbee2mqtt:info 9/14/2019, 8:53:44 AM Error while starting zigbee-shepherd, attempting to fix... (takes 60 seconds) (Error: Cluster with key '64527' does not exist)  zigbee2mqtt:info 9/14/2019, 8:54:44 AM Starting zigbee-shepherd  zigbee2mqtt:error 9/14/2019, 8:54:46 AM Error while starting zigbee-shepherd! (Error: dev exists, unregister it first.)  zigbee2mqtt:error 9/14/2019, 8:54:46 AM Press the reset button on the stick (the one closest to the USB) and start again  zigbee2mqtt:error 9/14/2019, 8:54:46 AM Failed to start {"message":"dev exists, unregister it first.","stack":"Error: dev exists, unregister it first.\n at /app/node_modules/zigbee-herdsman/dist/lib/shepherd.js:449:19\n at Promise.apply (/app/node_modules/zigbee-herdsman/node_modules/q/q.js:1185:26)\n at Promise.promise.promiseDispatch (/app/node_modules/zigbee-herdsman/node_modules/q/q.js:808:41)\n at /app/node_modules/zigbee-herdsman/node_modules/q/q.js:1411:14\n at runSingle (/app/node_modules/zigbee-herdsman/node_modules/q/q.js:137:13)\n at flush (/app/node_modules/zigbee-herdsman/node_modules/q/q.js:125:13)\n at process._tickCallback (internal/process/next_tick.js:61:11)"}  zigbee2mqtt:error 9/14/2019, 8:54:46 AM Exiting... npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] start: node index.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2019-09-14T08_54_46_303Z-debug.log Using '/app/data' as data directory

[email protected] start /app node index.js

 zigbee2mqtt:info 9/14/2019, 8:54:48 AM Logging to directory: '/app/data/log/2019-09-14.08-54-48'  zigbee2mqtt:info 9/14/2019, 8:54:48 AM Starting zigbee2mqtt version 1.6.0 (commit #e26ad2a)  zigbee2mqtt:info 9/14/2019, 8:54:48 AM Starting zigbee-shepherd  zigbee2mqtt:info 9/14/2019, 8:54:50 AM Error while starting zigbee-shepherd, attempting to fix... (takes 60 seconds) (Error: Cluster with key '64527' does not exist)`

Thank you for your help!!!

opl-git avatar Sep 14 '19 08:09 opl-git

@opl-git please check the dev branch.

Koenkk avatar Sep 15 '19 11:09 Koenkk

@Koenkk Thank you for your effort.

Just pulled the latest dev. The error (failure on first start) seems to be disappeared. The log throws some strange errors but at least z2m runs through.

https://pastebin.com/KP6CYNzH

I'll do some more testing before closing the issue. Ok?

3DIRK avatar Sep 15 '19 12:09 3DIRK

@3DIRK can you check if that issue also has been fixed?

Koenkk avatar Sep 16 '19 18:09 Koenkk

Hello,

Same here.

CC2531 firmware version: latest

I use the latest dev hass.io plugin (zigbee2mqtt version 1.6.0 (commit #a987aff08187b974c9dea2730421d599efabc673)) and I get the same messages as the first issue : https://pastebin.com/wB3gMLYP

I can provide more log if needed.

Thanks

MastaaK avatar Sep 16 '19 19:09 MastaaK

Hello j'ai un problem avec docker merci

root@pi:/home/pi# docker run \

-it
-v $(pwd)/data:/app/data
--device=/dev/ttyACM2
-e TZ=Europe/Amsterdam
koenkk/zigbee2mqtt Using '/app/data' as data directory

[email protected] start /app node index.js

zigbee2mqtt:info 9/16/2019, 10:54:12 PM Logging to directory: '/app/data/log/2019-09-16.22-54-10' zigbee2mqtt:info 9/16/2019, 10:54:12 PM Starting zigbee2mqtt version 1.6.0 (commit #e26ad2a) zigbee2mqtt:info 9/16/2019, 10:54:12 PM Starting zigbee-shepherd events.js:167 throw er; // Unhandled 'error' event ^

Error: Port is not open at SerialPort.close (/app/node_modules/zigbee-herdsman/node_modules/@serialport/stream/stream.js:425:29) at Znp. (/app/node_modules/zigbee-herdsman/dist/znp/znp.js:107:37) at Generator.next () at /app/node_modules/zigbee-herdsman/dist/znp/znp.js:7:71 at new Promise () at __awaiter (/app/node_modules/zigbee-herdsman/dist/znp/znp.js:3:12) at SerialPort.serialPort.open (/app/node_modules/zigbee-herdsman/dist/znp/znp.js:103:45) at SerialPort._error (/app/node_modules/zigbee-herdsman/node_modules/@serialport/stream/stream.js:197:14) at binding.open.then.err (/app/node_modules/zigbee-herdsman/node_modules/@serialport/stream/stream.js:241:12) Emitted 'error' event at: at SerialPort.onerror (_stream_readable.js:690:12) at SerialPort.emit (events.js:182:13) at SerialPort._error (/app/node_modules/zigbee-herdsman/node_modules/@serialport/stream/stream.js:199:10) at process.nextTick (/app/node_modules/zigbee-herdsman/node_modules/@serialport/stream/stream.js:204:31) at process._tickCallback (internal/process/next_tick.js:61:11) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] start: node index.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2019-09-16T20_54_12_610Z-debug.log

corv45 avatar Sep 16 '19 21:09 corv45

@Koenkk Bad news, the errors still persists --> https://pastebin.com/hx5jDCqe

  • Small feature request: pls. remove non printable chars from logging as this log broke my console. ;-)

3DIRK avatar Sep 18 '19 09:09 3DIRK

@3DIRK with what commit? I've done some more fixes yesterday (https://github.com/Koenkk/zigbee2mqtt/commit/ef7049f899d0ed136824be079a85087368e5045c)

Koenkk avatar Sep 18 '19 09:09 Koenkk

@Koenkk still the same issue as @3DIRK with the latest Hass.io addon : version 1.6.0 (commit #14a9ec9f11e12ab43401b8c4945158965e0167e0)

https://pastebin.com/tszcKQwX

MastaaK avatar Sep 18 '19 11:09 MastaaK

@Koenkk Latest. Should be d7401c817c6247f8020c13cc356378775797b9e5

3DIRK avatar Sep 18 '19 12:09 3DIRK

@3DIRK why is the zigbee2mqtt logging missing from your pastebin? I only see the DEBUG logs.

Koenkk avatar Sep 18 '19 13:09 Koenkk

@Koenkk These were the docker logs. /app/data/log/<DATE_TIME>/* was empty.

But I forgot to set "LOG_LEVEL = DEBUG" in configuration.yaml. So, created a new log --> https://pastebin.com/c5wgY6Dx /app/data/log/<DATE_TIME>/* is still empty.

Btw. how does "LOG_LEVEL = DEBUG" in configuration.yaml and "ENV DEBUG=*" in docker interact? What about the npm log (in the container) under /root?

3DIRK avatar Sep 18 '19 14:09 3DIRK

@3DIRK I did another attempt to fix this, can you check again with latest dev?

Koenkk avatar Sep 18 '19 17:09 Koenkk

@Koenkk Done. See here https://pastebin.com/HE6u1rQV

3DIRK avatar Sep 18 '19 18:09 3DIRK

I think i found it, can you try again?

Koenkk avatar Sep 18 '19 19:09 Koenkk

@Koenkk

Looks great. No error messages anymore.

https://pastebin.com/N93SFgUk

3DIRK avatar Sep 18 '19 20:09 3DIRK

... but wait: now I do not get any logs (neither docker stdout / stderror nor /app/data/log/*). configuration.yaml says "log_level: DEBUG"

3DIRK avatar Sep 18 '19 20:09 3DIRK