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
984 stars 201 forks source link

[Bug]: TypeError: Cannot read property 'toLocaleString' of null #2596

Closed Aephir closed 2 years ago

Aephir commented 2 years ago

Checklist

Deploy method

Docker

Zwavejs2Mqtt version

6.15.2

ZwaveJS version

?

Describe the bug

I noticed that the control-panel (http://local_ip:8091/control-panel) was down. Looking closer, I see hat the container keeps restarting. The docker logs zwave2mqtt is shown under "additional context", but it thows a TypeError.

What may or may not be important is that I:

  1. Had an unexpected power cut. Nodes did not interview properly after. I needed to power down the computer, remove and re-attach the zwave stick (Aeotec Gen 5), then boot. After that, everything worked as expected.
  2. Just ran an rsync backup of my docker persistent storage. Not sure how this would cause problems, but this is the last thing I did on my server before noticing that the zwave2mqtt was not working.

Since I don't know if it's related to any of those, I am not 100 % sure whether this should be a "bug" or a "question/help".

To Reproduce

  1. Set up zwave2mqtt in a docker-compose file with the following (copied almost verbatim from the docker-compose.yml in this repo):
  zwavejs2mqtt:
    container_name: zwavejs2mqtt
    image: zwavejs/zwavejs2mqtt:latest
    restart: always
    tty: true
    stop_signal: SIGINT
    environment:
      - SESSION_SECRET='REDACTED'
      - ZWAVEJS_EXTERNAL_CONFIG=/usr/src/app/store/.config-db
      - TZ=Europe/Copenhagen
    networks:
      - zwave
    devices:
      - '/dev/serial/by-id/usb-0658_0200-if00:/dev/zwave'
    volumes:
      - /mnt/data/docker/zwave-config:/usr/src/app/store
    ports:
      - '8091:8091' # port for web interface
      - '3000:3000' # port for Z-Wave JS websocket server
  1. [Maybe relevant?] Cut power while everything is running, when it never correctly interviews nodes, fix by powering down, removing and attaching the Z-wave stick, then powering up again.

  2. [Maybe relevant?] Run rsync, copying the persistent data to a remote storage (NFS mount).

Expected behavior

Additional context

2022-08-16 21:45:09.125 INFO APP: Version: 6.15.2
2022-08-16 21:45:09.128 INFO APP: Application path:/usr/src/app

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

2022-08-16 21:45:09.156 WARN STORE: scenes.json not found
TypeError: Cannot read property 'toLocaleString' of null
    at BackupManager.init (/usr/src/app/server/lib/BackupManager.js:68:114)
    at startGateway (/usr/src/app/server/app.js:283:29)
    at startServer (/usr/src/app/server/app.js:219:11)
robertsLando commented 2 years ago

Sorry for late replay but I was on vacation, issue solved on master, wait for next release

Aephir commented 2 years ago

Awesome, thanks a lot! In the meantime, re-creating the container and restoring settings also worked just fine.