ring-mqtt: Bug: Uncaught Exception- Maximum call stack size exceeded

Is there an existing issue for this?

  • I have searched all existing open/closed issues

Is this really a bug? If you don’t have some way to confirm it is a bug, errors in the log, code that is clearly wrong, or at least a clear method to reproduce something that doesn’t work, then it’s not (yet) a bug.

  • I’m confident this is a bug and I have logs or other data to confirm it.

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

  • I have read the support wiki and followed any applicable steps.

Did this issue start after an upgrade?

  • This not an upgrade issue or I have read the release notes and performed any applicable steps that match my issue.

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

  • I am prepared to provide logs, answer questions, and respond in a reasonable timeframe.

Describe the Bug

Ring MQTT stopped working overnight. I have tried restarting and reauthenticating but there is a stack overflow error that crashes ring-mqtt and forces it to restart repeatedly

Steps to Reproduce

No steps. I did not change anything in my config or my ring set up, it just suddenly stopped working

Expected Behavior

Ring MQTT starts and runs as normal

Log Output

ring-mqtt.js version: 5.8.0
Node version v22.12.0
NPM version 10.9.0
git version 2.45.2
-------------------------------------------------------
Running ring-mqtt...
2025-05-06T11:47:37.604Z ring-mqtt Detected runmode: addon
2025-05-06T11:47:37.605Z ring-mqtt Configuration file: /data/options.json
2025-05-06T11:47:38.064Z ring-mqtt Reading latest data from state file: /data/ring-state.json
2025-05-06T11:47:38.071Z ring-mqtt Configured MQTT Host: REDACTED
2025-05-06T11:47:38.071Z ring-mqtt Configured MQTT Port: REDACTED
2025-05-06T11:47:38.071Z ring-mqtt Configured MQTT User: REDACTED
2025-05-06T11:47:38.071Z ring-mqtt Configured MQTT password: <hidden>
2025-05-06T11:47:38.071Z ring-mqtt MQTT URL: REDACTED
2025-05-06T11:47:38.082Z ring-mqtt Successfully started the ring-mqtt web UI
2025-05-06T11:47:38.096Z ring-mqtt Attempting connection to Ring API using saved refresh token...
2025-05-06T11:47:40.817Z ring-mqtt Successfully established connection to Ring API using saved token
2025-05-06T11:47:40.818Z ring-mqtt Received updated refresh token
2025-05-06T11:47:40.818Z ring-mqtt Saving updated refresh token to state file
2025-05-06T11:47:41.822Z ring-mqtt Successfully saved updated state file: /data/ring-state.json
2025-05-06T11:47:42.818Z ring-mqtt Attempting connection to MQTT broker...
2025-05-06T11:47:42.834Z ring-mqtt MQTT connection established, processing Ring locations...
2025-05-06T11:47:45.390Z ring-mqtt ------------------------------------------------------------------------------------------
2025-05-06T11:47:45.390Z ring-mqtt This account has access to the following locations:
2025-05-06T11:47:45.390Z ring-mqtt            REDACTED
2025-05-06T11:47:45.390Z ring-mqtt            REDACTED
2025-05-06T11:47:45.390Z ring-mqtt                                                                                           
2025-05-06T11:47:45.390Z ring-mqtt IMPORTANT: If any alarm or smart lighting hubs for a location are in any state other      
2025-05-06T11:47:45.390Z ring-mqtt            than *ONLINE*, including *OFFLINE* or *CELL BACKUP*, device discovery will     
2025-05-06T11:47:45.390Z ring-mqtt            hang and no devices will be published until the hub returns to *ONLINE* state. 
2025-05-06T11:47:45.390Z ring-mqtt                                                                                           
2025-05-06T11:47:45.390Z ring-mqtt            If desired, the "location_ids" config option can be used to restrict           
2025-05-06T11:47:45.390Z ring-mqtt            discovery to specific locations. See the documentation for details.            
2025-05-06T11:47:45.390Z ring-mqtt ------------------------------------------------------------------------------------------
2025-05-06T11:47:45.390Z ring-mqtt Starting Device Discovery...
2025-05-06T11:47:45.390Z ring-mqtt                                                                                           
2025-05-06T11:47:45.390Z ring-mqtt New location: REDACTED
2025-05-06T11:48:00.188Z ring-mqtt ERROR - Uncaught Exception
2025-05-06T11:48:00.188Z ring-mqtt Maximum call stack size exceeded
2025-05-06T11:48:00.189Z ring-mqtt RangeError: Maximum call stack size exceeded
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:835:9)
    at WebSocket.dispatchEvent (node:internal/event_target:762:26)
    at fireEvent (node:internal/deps/undici/undici:11637:14)
    at failWebsocketConnection (node:internal/deps/undici/undici:11718:9)
    at closeWebSocketConnection (node:internal/deps/undici/undici:11989:9)
    at WebSocket.close (node:internal/deps/undici/undici:12650:9)
    at WS.doClose (/app/ring-mqtt/node_modules/engine.io-client/lib/transports/websocket.js:248:13)
    at Transport.close (/app/ring-mqtt/node_modules/engine.io-client/lib/transport.js:98:10)
    at Socket.onClose (/app/ring-mqtt/node_modules/engine.io-client/lib/socket.js:713:20)
    at Socket.onError (/app/ring-mqtt/node_modules/engine.io-client/lib/socket.js:691:8)
2025-05-06T11:48:01.189Z ring-mqtt The ring-mqtt process is shutting down...
2025-05-06T11:48:03.189Z ring-mqtt Exit code: 2
-------------------------------------------------------

Screenshots

No response

Config File

mqtt_url: REDACTED
mqtt_options: ""
livestream_user: ""
livestream_pass: ""
disarm_code: ""
enable_cameras: enable
enable_modes: false
enable_panic: false
branch: addon
debug: ring-*
location_ids: []

Install Type

HA Addon

Version

5.8.0

Operating System

HA OS

Architecture

x86_64

Machine Details

Proxmox Virtual Machine

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 27
  • Comments: 27 (3 by maintainers)

Most upvoted comments

Providing an update here, the primary maintainer of ring-client-api has been able to track down the issue, a change to the Ring API with a more strict enforcement of the generated websocket URL. He is working on a fix and, once it is published, I will push a new version of ring-mqtt. Still might be a few days.

I have pushed ring-mqtt v5.8.1 that includes a fix for this issue. For those that have experienced this issue, please update to this version and report back as I was never actually able to reproduce the issue myself, but the version with the updated ring-client-api has passed all regression testing.

Had this yesterday, fixed itself after about half an hour, now it’s happening again.

https://github.com/dgreif/ring/issues/1605#issuecomment-2860940335

I’m sure this is already known, but wanted to point out this fix.

It’s very intermittent so sadly I have had to shut down the add-on until the issue is sorted out. Its just not reliable at the moment.

It’s also occurring with a single location configured. I have only a single location (never had more than one) and I was also affected by this issue yesterday. It came back yesterday at 21:34 UTC+2, it’s working again and I won’t try to reboot the addon for now.

I have this integration for a lot of my customers and they’re all complaining 😦. It’s not working for me.

I just checked and I am still getting the error