tsightler / ring-mqtt

Ring devices to MQTT Bridge
MIT License
603 stars 106 forks source link

Bug: v5.7.1 Keeps crashing due to Uncaught Exception #914

Closed labodj closed 1 month ago

labodj commented 1 month ago

Is there an existing issue for this?

Is this really a bug or just a usage/support question?

Have you read and followed any recommendations in the Support and Troubleshooting section of the wiki?

Did this issue start after an upgrade?

Are you prepared to respond and provide all relevant information (logs, screenshots, etc)

Describe the Bug

Keeps crashing due to Uncaught Exception, v5.6.7 and v5.7.0 work as expected

Steps to Reproduce

Just start the docker container

Expected Behavior

It should not crash on start

Log Output

-------------------------------------------------------
ring-mqtt.js version: 5.7.1
Node version v20.15.1
NPM version 10.8.0
git version 2.45.2
-------------------------------------------------------
Running ring-mqtt...
2024-09-30T09:02:25.328Z ring-mqtt Detected runmode: docker
2024-09-30T09:02:25.333Z ring-mqtt Configuration file: /data/config.json
2024-09-30T09:02:25.960Z ring-mqtt ERROR - Uncaught Exception
2024-09-30T09:02:25.960Z ring-mqtt /app/ring-mqtt/node_modules/mime-db/db.json: Unexpected token '�', "��  �  �!"... is not valid JSON
2024-09-30T09:02:25.960Z ring-mqtt SyntaxError: /app/ring-mqtt/node_modules/mime-db/db.json: Unexpected token '�', "��  �  �!"... is not valid JSON
    at parse (<anonymous>)
    at Module._extensions..json (node:internal/modules/cjs/loader:1434:39)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/app/ring-mqtt/node_modules/mime-db/index.js:12:18)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
2024-09-30T09:02:25.962Z ring-mqtt WARNING - Unhandled Promise Rejection
2024-09-30T09:02:25.962Z ring-mqtt /app/ring-mqtt/node_modules/mime-db/db.json: Unexpected token '�', "��  �  �!"... is not valid JSON
2024-09-30T09:02:25.962Z ring-mqtt SyntaxError: /app/ring-mqtt/node_modules/mime-db/db.json: Unexpected token '�', "��  �  �!"... is not valid JSON
    at parse (<anonymous>)
    at Module._extensions..json (node:internal/modules/cjs/loader:1434:39)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/app/ring-mqtt/node_modules/mime-db/index.js:12:18)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
2024-09-30T09:02:25.962Z ring-mqtt MQTT URL: mqtt://ring:********@192.168.21.20:1883
2024-09-30T09:02:26.963Z ring-mqtt The ring-mqtt process is shutting down...
2024-09-30T09:02:28.966Z ring-mqtt Exit code: 2

Screenshots

No response

Config File

docker-compose:

services:
  ring-mqtt:
    container_name: ring-mqtt
    restart: unless-stopped
    image: tsightler/ring-mqtt
    networks:
      - bridge_personal
    volumes:
      - /home/user/docker/ring-mqtt:/data

networks:
  bridge_personal:
    external: true

config.json:

{
    "mqtt_url": "mqtt://ring:redacted@192.168.21.20:1883",
    "mqtt_options": "",
    "livestream_user": "",
    "livestream_pass": "",
    "disarm_code": "",
    "enable_cameras": true,
    "enable_modes": false,
    "enable_panic": false,
    "hass_topic": "homeassistant/status",
    "ring_topic": "ring",
    "location_ids": ["RRRRRRRR-EEEE-DDDD-AAAA-AAAAAAAACTED"]
}

ring-state.json:

{"systemId":"REDACTED","ring_token":"REDACTED"}

Install Type

Docker 25.0.2

Version

v5.7.1

Operating System

Manjaro Linux ARM, kernel 6.6.33-2-MANJARO-RPI5

Architecture

arm64

Machine Details

Raspberry Pi 5 8GB

tsightler commented 1 month ago

As this is not a code error, but an error importing a dependent module, I have to assume that it is a corrupted image pull, otherwise, thousands of other people would have the same issue. Please remove the image from your local system, including any cached images, and repull.

labodj commented 1 month ago

Thanks @tsightler , it was indeed a corrupted image pull, thanks for the hint.