Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homebridge Crash when using plugin #518

Closed
smhex opened this issue Dec 30, 2021 · 15 comments
Closed

Homebridge Crash when using plugin #518

smhex opened this issue Dec 30, 2021 · 15 comments

Comments

@smhex
Copy link

smhex commented Dec 30, 2021

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

@NorthernMan54
Copy link
Contributor

NorthernMan54 commented Dec 30, 2021

@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

mqttjs/MQTT.js#1388

@arachnetech
Copy link
Owner

arachnetech commented Dec 30, 2021 via email

@arachnetech
Copy link
Owner

I've upgraded MQTT in version 1.1.37, as suggested by @NorthernMan54

@smhex, please let me know whether this solves your issue.

@smhex
Copy link
Author

smhex commented Dec 31, 2021

Thanks for your quick reply @arachnetech - unfortunately the error remains after updating to 1.1.37. I have only a few plugins installed. None of them complain if your plugin is not installed.

/homebridge # npm list homebridge@ /homebridge +-- homebridge-dummy@0.5.0 +-- homebridge-eveatmo@0.6.4 +-- homebridge-homeconnect@0.23.4 +-- homebridge-mqttthing@1.1.37 +-- homebridge-shelly@0.19.1 -- homebridge-unifi-protect@4.4.3

Is there anything I can do to dig deeper into this issue?

@NorthernMan54
Copy link
Contributor

Is the error identical ?

@smhex
Copy link
Author

smhex commented Dec 31, 2021 via email

@NorthernMan54
Copy link
Contributor

Are you available on homebridge discord in about an hour ? And are you comfortable with the Linux command line? Want to look and try somethings

@NorthernMan54
Copy link
Contributor

I looked thru your list of plugins and homebridge-unifi-protect also has the same issue and needs the same update.

I'm going to raise an issue there as well

As a workaround if your comfortable on the command line, you could edit the homebridge-unifi-protect package.json file, change the MQTT dependency version to 4.3.2, then run npm update from the homebridge-unifi-protect directory ( I can walk you thru this on discord )

@smhex
Copy link
Author

smhex commented Dec 31, 2021

Hi @NorthernMan54 , thanks for your effort with this issue - I am not on discord (yet) and our new year activities have already been started. I will quickly check your suggestion and report back here.

@smhex
Copy link
Author

smhex commented Dec 31, 2021

Perfect, everything works now! Happy new year to all of you! I assume the UniFi-protect plugin will be updated soon.

@smhex smhex closed this as completed Dec 31, 2021
@arachnetech
Copy link
Owner

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

Happy New Year!

David

@TimVerheul
Copy link

Hi, I'm on 1.1.38 and still got this issue

@NorthernMan54
Copy link
Contributor

@TimVerheul to resolve this issue all plugins that use mqtt need a similar update. See my workaround posted above

@TimVerheul
Copy link

@NorthernMan54 I saw your workaround, but I don't think I have any other plugin that uses mqtt. The issue started appearing after installing mqttthing

@TimVerheul
Copy link

@NorthernMan54 I saw your workaround, but I don't think I have any other plugin that uses mqtt. The issue started appearing after installing mqttthing

Solved, I checked the package.json of all my plugins manually and found a plugin that used an old version of mqtt, updating to the latest version fixed the issue for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants