zwave-js / zwave-js-ui

Full featured Z-Wave Control Panel UI and MQTT gateway. Built using Nodejs, and Vue/Vuetify
https://zwave-js.github.io/zwave-js-ui
MIT License
987 stars 201 forks source link

Zwavejs not starting after docker upgrade and reboot. #3860

Closed jaimevisser closed 3 months ago

jaimevisser commented 3 months ago

Did an apt-get upgrade to update my ubuntu machine running HA + zwave-js-ui and finished with a reboot to boot into the new kernel. image

There's nothing in both the docker logs and zwavejs logs after the reboot. I tried shutting down the container and moving the content of the store mount to a different location (in effect a first boot) and the error persists. Updating to zwavejs 9.17.0 also does not fix the problem.

Docker: Docker version 27.1.2, build d01f264 Ubuntu: Ubuntu 22.04.4 LTS

Relevant compose section (hostname redacted):

  zwavejs2mqtt:
    container_name: zwavejs2mqtt
    image: zwavejs/zwave-js-ui:9.12.0
    restart: unless-stopped
    tty: true
    privileged: true
    stop_signal: SIGINT
    environment:
      - SESSION_SECRET=QE4P2LOKxGrytZTRCXo8
    volumes:
      - ./zwavejs2mqtt:/usr/src/app/store
      - /dev:/dev
    ports:
      - '3000:3000' # port for zwave-js websocket server
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.zwave.entrypoints=websecure"
      - "traefik.http.routers.zwave.rule=Host(`zwave.***.**`)"
      - "traefik.http.routers.zwave.middlewares=auth@file"
      - "traefik.http.services.zwave.loadbalancer.server.port=8091"
jaimevisser commented 3 months ago

Addition: after another full shutdown/reboot my zwave devices are back up in HA. The zwave-js-ui still gives the same error and doesn't render at all.

robertsLando commented 3 months ago

Sorry for late reply but I was on vacation, could you try to open Chrome Dev tools and see the response on network requests please?

jaimevisser commented 3 months ago

No problem! Might it be related to this? image

robertsLando commented 3 months ago

That api doesn't have any authorization so if the return code is 401 means you have something between zui and frontend, are you using a proxy?

jaimevisser commented 3 months ago

Yeah, traefik with basic auth. I'll try bypassing that for a bit to see if that solves the issue.

jaimevisser commented 3 months ago

Yep, that was the issue. Still weird other apps work fine with auth enabled but zwavejs doesn't. I'll have to do some more testing to see what's going on. Thanks for pointing me in the right direction!

robertsLando commented 3 months ago

Maybe this issue could help? https://github.com/zwave-js/zwave-js-ui/issues/3427

jaimevisser commented 3 months ago

Yep, hard refresh did the trick.

ajacques commented 3 months ago

3825 is more relevant given the response code is 401.

Updating to zwavejs 9.17.0 also does not fix the problem.

What version were you on prior to upgrading? If it's 9.16.2 or lower, then your JS didn't have #3825 and you need to hard reload to get the JS in your service worker cache to handle the 401 correctly. I've noticed the SW cache is a bit flaky, but it should work.