homebridge-mqttthing: Homebridge Crash when using plugin

Hi, I like the idea of integrating almost any accessory via MQTT. I installed the plugin and now Homebridge (v1.3.9) is constantly crashing on startup.

[12/30/2021, 3:02:15 PM] [ShellyTemp] Initializing mqttthing accessory... [12/30/2021, 3:02:15 PM] RangeError: Maximum call stack size exceeded at Function.Array.from (/homebridge/node_modules/homebridge-mqttthing/node_modules/collections/shim-array.js:35:22) at Function.Array.from (/homebridge/node_modules/homebridge-mqttthing/node_modules/collections/shim-array.js:35:22) at Function.Array.from (/homebridge/node_modules/homebridge-mqttthing/node_modules/collections/shim-array.js:35:22) at Function.Array.from (/homebridge/node_modules/homebridge-mqttthing/node_modules/collections/shim-array.js:35:22) at Function.Array.from (/homebridge/node_modules/homebridge-mqttthing/node_modules/collections/shim-array.js:35:22) at Function.Array.from (/homebridge/node_modules/homebridge-mqttthing/node_modules/collections/shim-array.js:35:22) at Function.Array.from (/homebridge/node_modules/homebridge-mqttthing/node_modules/collections/shim-array.js:35:22) at Function.Array.from (/homebridge/node_modules/homebridge-mqttthing/node_modules/collections/shim-array.js:35:22) at Function.Array.from (/homebridge/node_modules/homebridge-mqttthing/node_modules/collections/shim-array.js:35:22) at Function.Array.from (/homebridge/node_modules/homebridge-mqttthing/node_modules/collections/shim-array.js:35:22) [12/30/2021, 3:02:15 PM] Got SIGTERM, shutting down Homebridge...

I have a configured a simple shelly as temperature sensor. { "type": "temperatureSensor", "name": "ShellyTemp", "url": "mqtt://mosquitto.XXXXXX.com:1883", "username": "XX", "password": "XX", "mqttOptions": { "keepalive": 60 }, "logMqtt": false, "topics": { "getCurrentTemperature": "shellies/shellyswitch25-98F4ABF2XXXX/temperature" }, "startPub": [ { "topic": "homebridge", "message": "online" } ], "accessory": "mqttthing" }

The log output of my mosquito server shows no anomalies except, the last will of the MQTT thing when it dies. It tried to narrow down the reason by choosing different servers or accessories - no luck. Even when I disabled the plugin Homebridge crashes. As a last test I installed the oldest plugin version which - luckily - worked without any issues. I could update and use the plugin until v1.1.29 - this was the first version which showed the symptoms. All older versions worked like expected. All newer versions crash my Homebridge. I took a closer look at the diff on Github, the only changes I found were Update of the Homebridge lib and the MQTT package.

As I want to use the latest plugin version I would like to find out what is causing the issue. Do you have an idea what I can check to find the root cause? I started Homebridge with DEBUG enabled but there was no helpful information logged…The error message looks like an infinite call of “Function.Array.from”…

Thank you for your help smhex

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

@arachnetech - If you can update the mqtt dependency to version 4.3.2 or greater this should be resolved.

We had this hit a number of plugins this week

https://github.com/mqttjs/MQTT.js/pull/1388

Thank you, both. Delighted you’ve got to the bottom of this.

Happy New Year!

David