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]: Docker container not starting since 519dee8 / ZwaveJS 9 #2349

Closed
3 tasks done
phipolis opened this issue Apr 4, 2022 · 15 comments · Fixed by #2351
Closed
3 tasks done

[Bug]: Docker container not starting since 519dee8 / ZwaveJS 9 #2349

phipolis opened this issue Apr 4, 2022 · 15 comments · Fixed by #2351
Labels
bug Something isn't working

Comments

@phipolis
Copy link

phipolis commented Apr 4, 2022

Checklist

  • I am not using Home Assistant. Or: a developer has told me to come here.
  • I have checked the troubleshooting section and my problem is not described there.
  • I have read the changelog and my problem is not mentioned there.

Deploy method

Docker

Zwavejs2Mqtt version

519dee8 and later

ZwaveJS version

9.0.1

Describe the bug

zwavejs2mqtt docker container that was fully working under docker tags 6.6.2 and sha-15caab7 does not finish starting under tags latest or 519dee8. With both log settings to silly, no useful errors are produced beyond seeming not to pass the "Connecting to ..." step.

docker logs:

/bin/sh: git: not found
2022-04-04 14:07:23.209 INFO APP: Version: 6.6.2
2022-04-04 14:07:23.214 INFO APP: Application path:/usr/src/app

 ______                       _     ___                  _   _   
|___  /                      (_)   |__ \                | | | |  
   / /_      ____ ___   _____ _ ___   ) |_ __ ___   __ _| |_| |_ 
  / /\ \ /\ / / _` \ \ / / _ \ / __| / /| '_ ` _ \ / _` | __| __|
 / /__\ V  V / (_| |\ V /  __/ \__ \/ /_| | | | | | (_| | |_| |_ 
/_____|\_/\_/ \__,_| \_/ \___| |___/____|_| |_| |_|\__, |\__|\__|
                            _/ |                      | |        
                           |__/                       |_|        

2022-04-04 14:07:23.278 WARN STORE: scenes.json not found
2022-04-04 14:07:23.357 INFO APP: Listening on port 8091 host 0.0.0.0 protocol HTTP
2022-04-04 14:07:23.417 INFO MQTT: MQTT is disabled
2022-04-04 14:07:23.450 INFO ZWAVE: Connecting to /dev/serial/by-id/usb-0658_0200-if00
Logging to file:
	/usr/src/app/store/zwavejs_2022-04-04.log

(message repeats when docker restarts)

zwavejs logs:

2022-04-04T17:44:54.519Z DRIVER   ███████╗ ██╗    ██╗  █████╗  ██╗   ██╗ ███████╗             ██╗ ███████╗
                                  ╚══███╔╝ ██║    ██║ ██╔══██╗ ██║   ██║ ██╔════╝             ██║ ██╔════╝
                                    ███╔╝  ██║ █╗ ██║ ███████║ ██║   ██║ █████╗   █████╗      ██║ ███████╗
                                   ███╔╝   ██║███╗██║ ██╔══██║ ╚██╗ ██╔╝ ██╔══╝   ╚════╝ ██   ██║ ╚════██║
                                  ███████╗ ╚███╔███╔╝ ██║  ██║  ╚████╔╝  ███████╗        ╚█████╔╝ ███████║
                                  ╚══════╝  ╚══╝╚══╝  ╚═╝  ╚═╝   ╚═══╝   ╚══════╝         ╚════╝  ╚══════╝
2022-04-04T17:44:54.521Z DRIVER   version 9.0.1
2022-04-04T17:44:54.521Z DRIVER   
2022-04-04T17:44:54.522Z DRIVER   starting driver...
2022-04-04T17:44:54.546Z DRIVER   opening serial port /dev/serial/by-id/usb-0658_0200-if00

(message repeats when docker restarts)

To Reproduce

Set up a rootless docker container for zwavejs/zwavejs2mqtt:6.6.2.
Change tag to zwavejs/zwavejs2mqtt:latest or zwavejs/zwavejs2mqtt:519dee8 and rerun docker-compose.

Expected behavior

Expected container to start as before, or log an actionable error if my configuration is incompatible with ZWaveJS 9+.

Additional context

I am using rootless docker, and hanging while attempting to connect to the mounted device suggested an issue with the dialout group and permissions for the mounted zwave device file. Since others have commented that they have the same problem in standard docker, it seems like a wider issue.

@rmcginty
Copy link

rmcginty commented Apr 4, 2022

I'm not sure what a "rootless" docker container is, but I am running a Pi with docker and zwavejs2mqtt installed via the default instructions for doing so. I just did a pull as I normally do to update and my docker-compose is set to zwavejs/zwavejs2mqtt:latest. I get the same result as @phipolis but mine exits with code 139 after trying to connect to device for a few seconds. Logging reveals no details as to what is failing.

Reverting to build 6.6.2 results in it loading all the way and working correctly.

@wallenium
Copy link

I'm not sure what a "rootless" docker container is, but I am running a Pi with docker and zwavejs2mqtt installed via the default instructions for doing so. I just did a pull as I normally do to update and my docker-compose is set to zwavejs/zwavejs2mqtt:latest. I get the same result as @phipolis but mine exits with code 139 after trying to connect to device for a few seconds. Logging reveals no details as to what is failing.

Reverting to build 6.6.2 results in it loading all the way and working correctly.

rootless is w/o root permissions.
Same problem here, I am running docker with a special docker user. Same behavior, is definitely broken.

@phipolis phipolis changed the title [Bug]: Rootless Docker container not starting since 519dee8 / ZwaveJS 9 [Bug]: Docker container not starting since 519dee8 / ZwaveJS 9 Apr 5, 2022
@firefly2442
Copy link

Seeing similar problems with Pi 4. When I use the latest Docker tag it continuously loops trying to restart. When I manually specify an older tag sha-15caab7 it loads correctly.

/bin/sh: git: not found
2022-04-04 20:36:13.475 INFO APP: Version: 6.6.2
2022-04-04 20:36:13.496 INFO APP: Application path:/usr/src/app

 ______                       _     ___                  _   _   
|___  /                      (_)   |__ \                | | | |  
   / /_      ____ ___   _____ _ ___   ) |_ __ ___   __ _| |_| |_ 
  / /\ \ /\ / / _` \ \ / / _ \ / __| / /| '_ ` _ \ / _` | __| __|
 / /__\ V  V / (_| |\ V /  __/ \__ \/ /_| | | | | | (_| | |_| |_ 
/_____|\_/\_/ \__,_| \_/ \___| |___/____|_| |_| |_|\__, |\__|\__|
                            _/ |                      | |        
                           |__/                       |_|        

2022-04-04 20:36:13.768 WARN STORE: scenes.json not found
2022-04-04 20:36:13.939 INFO APP: Listening on port 8091 host 0.0.0.0 protocol HTTP
2022-04-04 20:36:14.239 INFO MQTT: Connecting to mqtt://mosquitto:1883
2022-04-04 20:36:14.797 INFO ZWAVE: Connecting to /dev/zwave

And my service in docker-compose.yml:

zwavejs2mqtt:
    image: zwavejs/zwavejs2mqtt
    restart: unless-stopped
    container_name: zwavejs2mqtt
    hostname: zwavejs2mqtt
    environment:
      TZ: "America/Denver"
    ports:
      - 8091:8091/tcp # port for web interface
      - 3000:3000/tcp # port for zwave-js websocket server
    volumes:
      - ${ZWAVE_PATH}:/usr/src/app/store
    depends_on:
      - homeassistant
    devices:
      # usb Nortek device forwarded to the docker image
      - /dev/serial/by-id/usb-Silicon_Labs_HubZ_Smart_Home_Controller_C1300092-if00-port0:/dev/zwave

@kpine
Copy link
Contributor

kpine commented Apr 5, 2022

Looks like a problem with Alpine Linux, arm64 (arm7?) platforms, and pre-built binaries, with the upstream node-serialport library: serialport/node-serialport#2438.

z2m with v9 works fine on my amd64 system, but crashes on my 64-bit Pi. The scenario occurs on my own build using zwave-js-server.

There's a workaround in the comments, which is to build the module from source (as was required with Alpine prior to zwave-js v9).

@robertsLando
Copy link
Member

I think that by adding that line to Dockerfile it should work @kpine

@AlCalzone
Copy link
Member

You can try this (I hope that's the equivalent of the mentioned workaround for yarn v3, only rebuilding what's necessary)

# AFTER install:
npm_config_build_from_source=true yarn rebuild @serialport/bindings-cpp

It does rebuild it on my system, but I don't see how exactly

@robertsLando
Copy link
Member

Once this ends try using master tag to see if it's working

@robertsLando
Copy link
Member

@kpine did you give it a try?

@matjoker
Copy link

matjoker commented Apr 5, 2022

Just upgraded my docker with the master version and everything looks good.
Thanks!

Matthieu

@kpine
Copy link
Contributor

kpine commented Apr 5, 2022

LGTM

@wallenium
Copy link

fixed it for me, too

@robertsLando
Copy link
Member

Nice, thanks everyone

@rice1204
Copy link

rice1204 commented Jul 19, 2023

Not sure if this is related to the same cause as above, but just ran into something similar on startup when trying to setup a secondary zwavejs instance (RPI 2). First encountered with :latest build, but changing to :master doesn't resolve the issue.

urllib3.connectionpool._make_request: http://localhost:None "GET /v1.38/containers/24b6e54b015c281ebbd9e3ec9a7107e302b09311094d97524e152c084c9250ac/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {'AppArmorProfile': '',
'Args': ['node', 'server/bin/www'],
'Config': {'AttachStderr': False,
'AttachStdin': False,
'AttachStdout': False,
'Cmd': ['node', 'server/bin/www'],
'Domainname': '',
'Entrypoint': ['docker-entrypoint.sh'],
'Env': ['SESSION_SECRET=mysupersecretkey',
'ZWAVEJS_EXTERNAL_CONFIG=/usr/src/app/store/.config-db',
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- ('24b6e54b015c281ebbd9e3ec9a7107e302b09311094d97524e152c084c9250ac')
compose.cli.verbose_proxy.proxy_callable: docker wait -> {'Error': None, 'StatusCode': 139}
zwavejs exited with code 139

@robertsLando
Copy link
Member

That's not a log output from zui, must be an error related to docker

@rice1204
Copy link

Pardon me, you're totally right (was too late in the evening)!
Docker on rpi 2 may be asking too much. I'll try bare metal.

Thanks!

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.

9 participants