homebridge / homebridge-config-ui-x

The Homebridge UI. Monitor, configure and backup Homebridge from a browser.
https://homebridge.io
MIT License
2.61k stars 373 forks source link

Homebridge crashing after UI update to 4.55.0 with node.js 20.10.0 #1973

Closed Tellicious closed 9 months ago

Tellicious commented 9 months ago

Describe The Bug

As soon as Homebridge-config-ui-x is updated to 4.55.0 with node 20.10.0, homebridge keeps restarting after showing the message below. UI V4.55.0 seems to work fine with node 18.19.0 and UI v4.54.1 works fine with node 20.10.0.

I tried rebuilding several times, re-installing homebridge, changing the update order (node-first or UI-first) without any luck.

Logs

TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at equalTxt (/opt/homebridge/lib/node_modules/homebridge-config-ui-x/node_modules/bonjour-service/src/lib/utils/equal-txt.ts:2:24)
    at Browser.updateService (/opt/homebridge/lib/node_modules/homebridge-config-ui-x/node_modules/bonjour-service/src/lib/browser.ts:145:21)
    at /opt/homebridge/lib/node_modules/homebridge-config-ui-x/node_modules/bonjour-service/src/lib/browser.ts:108:30
    at Array.forEach (<anonymous>)
    at /opt/homebridge/lib/node_modules/homebridge-config-ui-x/node_modules/bonjour-service/src/lib/browser.ts:106:25
    at Array.forEach (<anonymous>)
    at EventEmitter.onresponse (/opt/homebridge/lib/node_modules/homebridge-config-ui-x/node_modules/bonjour-service/src/lib/browser.ts:98:34)
    at EventEmitter.emit (node:events:514:28)
    at Socket.<anonymous> (/opt/homebridge/lib/node_modules/homebridge-config-ui-x/node_modules/multicast-dns/index.js:49:43)
    at Socket.emit (node:events:514:28)
    at UDP.onMessage (node:dgram:941:8)

Config

No response

Homebridge UI Version

4.55.0

Homebridge Version

1.7.0

Node.js Version

20.10.0

Operating System

Raspberry Pi OS / Raspbian

Environment Info

Raspberry Pi Model

Raspberry Pi 4 B

donavanbecker commented 9 months ago

Are you able to get into Homebridge Settings, in the UI? Or can you access the config.json?

Can you update the mDNS Advertiser to something different? Looks like you are on bonjour, would be curious if you get the same thing with ciao?

Magna66 commented 9 months ago

Same thing with ciao here, tried v.4.55.1-alpha 1-alpha broke down totally homebridge on hyper V. Was forced to delete homebridge from hyper V manager, and reinstall it from the beginning, Now using homebridge UI V4.54.2 and everything is fine.

Tellicious commented 9 months ago

Actually I'm already using ciao

That's my config.json snippet:

"bridge": {
        "name": "Homebridge",
        "username": "xxx",
        "port": 51409,
        "pin": "xxx",
        "advertiser": "ciao",
        "bind": [
            "eth0"
        ]
    }
niwre2019 commented 9 months ago

Same problem here, I use Avahi as mDNS advertiser. I have manually entered ciao in config.json, then it works again. When I switch back to Avahi, it stops working again. For the time being I have to stay with ciao until the problem is solved.

kalety commented 9 months ago

Same here... I have to reinstall Homebridge completely. Back to UI ver 4.54.2

donavanbecker commented 9 months ago

Can someone test out a theory, go into Homebridge settings and turn off insecure mode (Control Accessories from Homebridge UI) and restart.

image

Magna66 commented 9 months ago

Yes it works with insecure mode off , the loop stops, but once insecure mode is enabled, the loop is back.

donavanbecker commented 9 months ago

Yes it works with insecure mode off , the loop stops, but once insecure mode is enabled, the loop is back.

Thanks! If we could get one more to test to verify.

Looks like this might be from an update of a dependency.

Richu75 commented 9 months ago

Same behaviour: Insecure mode turned off fixed the restart and homekit is stable. Insecure mode on introduces the UI restarts and homekit keeps polling homebridge devices.

donavanbecker commented 9 months ago

Thanks. For now please keep insecure mode off, until we can we can get the dependency to resolve the issue.

Tellicious commented 9 months ago

Confirm that with insecure mode off everything works fine

kalety commented 9 months ago

Work like a charm with insecure mode!

donavanbecker commented 9 months ago

Can you try the latest beta:

npm version

Click here to find out how to install Beta

Then after install please try insecure mode again and let us know if this beta resolves your issue and we will push out a new version.

bigrichwood commented 9 months ago

4.55.1-beta.2 seems to stop the endless restart cycle for me.

donavanbecker commented 9 months ago

4.55.1-beta.2 seems to stop the endless restart cycle for me.

And you have insecure mode enabled?

bigrichwood commented 9 months ago

Yes, re-enabled it after upgrading.

donavanbecker commented 9 months ago

If we can get feedback from one more that this resolve the issue. We will push out 4.55.1

bwp91 commented 9 months ago

update to beta fixed for me

DaphneINOPIA commented 9 months ago

How to turn off insecure mode if my UI is unresponsive/offline?

bwp91 commented 9 months ago

@DaphneINOPIA you can update via the command line if this is something you have ever done before?

bigrichwood commented 9 months ago

How to turn off insecure mode if my UI is unresponsive/offline?

In my case the UI stayed up long enough to change the setting and manually restart.

DaphneINOPIA commented 9 months ago

My UI was completely dead that's why I had asked but I see the new update fixes the whole issue so thank you everyone who replied. I updated to the newest versione via cli

donavanbecker commented 9 months ago

There was a fix that was implemented to the bonjour-service package. So we have reverted the quick fix to allow for the newer version of bonjour-service, so now we have a new beta.

Can someone try the latest beta and confirm that this fix resolves the issues we were having:

npm version

Click here to find out how to install Beta Versions

Tellicious commented 9 months ago

v4.55.2-beta.2 works for me also with insecure mode enabled

bigrichwood commented 9 months ago

Can someone try the latest beta and confirm that this fix resolves the issues we were having:

So far, so good.

Updated to beta.2, insecure mode still enabled, and it's not (yet) restarted itself.

donavanbecker commented 9 months ago

Thanks everyone! Going to close this comment as we will release this in the next version.