homebridge / homebridge-config-ui-x

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

Plugins Inaccessible via UI. Plugins all work #657

Closed TransRapid closed 4 years ago

TransRapid commented 4 years ago

UI suddenly begins to have an error with no changes in system updates, plugins, config, or network changes. Nothing has changed at all, yet suddenly plugins cannot be viewed, searched, or updated. The homepage in the browser shows all up to date, which is entirely wrong. Since have updated plugins manually. Command line shows everything fine. Everything was manually updated today to see if this resolved any issues, which it did not. All the features work fine as well; but the UI can't do anything related to plugins, even though it displays them fine in the devices list.

localhost:8080

Below are the errors I receive on their respective pages.

Home: > allModules.push is not iterable (cannot read property Symbol(Symbol.iterator)

Plugins: > Error Failed to load plugins: Http failure response for http://localhost:8080/api/plugins: 500 Internal Server Error

[4/30/2020, 9:53:49 PM] [Config] Homebridge restart request received
[4/30/2020, 9:53:49 PM] [Config] No restart command defined, killing process...
[4/30/2020, 9:53:49 PM] Got SIGTERM, shutting down Homebridge...
[4/30/2020, 9:53:55 PM] Loaded config.json with 1 accessories and 4 platforms.
[4/30/2020, 9:53:55 PM] ---
[4/30/2020, 9:53:56 PM] Loaded plugin: homebridge-chamberlain
[4/30/2020, 9:53:56 PM] Registering accessory 'homebridge-chamberlain.Chamberlain'
[4/30/2020, 9:53:56 PM] ---
[4/30/2020, 9:53:56 PM] Loaded plugin: homebridge-config-ui-x
[4/30/2020, 9:53:56 PM] Registering platform 'homebridge-config-ui-x.config'
[4/30/2020, 9:53:56 PM] ---
[4/30/2020, 9:54:01 PM] Loaded plugin: homebridge-dafang
[4/30/2020, 9:54:01 PM] Registering platform 'homebridge-dafang.Dafang'
[4/30/2020, 9:54:01 PM] ---
[4/30/2020, 9:54:02 PM] Loaded plugin: homebridge-gsh
[4/30/2020, 9:54:02 PM] Registering platform 'homebridge-gsh.google-smarthome'
[4/30/2020, 9:54:02 PM] ---
[4/30/2020, 9:54:04 PM] Loaded plugin: homebridge-ifttt
[4/30/2020, 9:54:04 PM] Registering platform 'homebridge-ifttt.IFTTT'
[4/30/2020, 9:54:04 PM] ---
[4/30/2020, 9:54:04 PM] Loading 4 platforms...
[4/30/2020, 9:54:04 PM] [Config] Initializing config platform...
[4/30/2020, 9:54:04 PM] [Config] Spawning homebridge-config-ui-x with PID 6528
[4/30/2020, 9:54:04 PM] [Dafang] Initializing Dafang platform...
[4/30/2020, 9:54:04 PM] [Dafang] MQTT Disabled.
[4/30/2020, 9:54:04 PM] [Dafang] MQTT Service Initialised
[4/30/2020, 9:54:04 PM] [Dafang] Configuring Dafang Accessory : Reset FFMPEG Switch
[4/30/2020, 9:54:04 PM] [Dafang] Configuring Dafang Accessory : Reset FFMPEG Switch
[4/30/2020, 9:54:04 PM] [IFTTT] Initializing IFTTT platform...
[4/30/2020, 9:54:04 PM] [IFTTT] Loading accessories...
[4/30/2020, 9:54:04 PM] [IFTTT] Found: FBIM
[4/30/2020, 9:54:04 PM] [IFTTT] Loading service: Battery Alert, subtype: HB-Battery-AlertHB-Battery-Dismiss, RestoredState: false
[4/30/2020, 9:54:04 PM] [IFTTT] Found: GV-Call
[4/30/2020, 9:54:04 PM] [IFTTT] Loading service: GV-Call, subtype: undefinedGV-Call-Dismiss, RestoredState: false
[4/30/2020, 9:54:04 PM] Initializing platform accessory 'FBIM'...
[4/30/2020, 9:54:04 PM] Initializing platform accessory 'GV-Call'...
[4/30/2020, 9:54:04 PM] [Google Smart Home] Initializing google-smarthome platform...
[4/30/2020, 9:54:04 PM] Loading 1 accessories...
[4/30/2020, 9:54:04 PM] [Garage Gate] Initializing Chamberlain accessory...
[4/30/2020, 9:54:04 PM] One of your plugins incorrectly registered an external accessory using the platform name (Dafang) and not the plugin identifier. Please report this to the developer!
[4/30/2020, 9:54:04 PM] Sully is running on port 52206.
[4/30/2020, 9:54:04 PM] Please add [Sully] manually in Home app. Setup Code: 140-11-040
[4/30/2020, 9:54:04 PM] Driveway is running on port 52207.
[4/30/2020, 9:54:04 PM] Please add [Driveway] manually in Home app. Setup Code: 140-11-040
[4/30/2020, 9:54:13 PM] Initializing platform accessory 'Reset Sully'...
[4/30/2020, 9:54:13 PM] Initializing platform accessory 'Reset Driveway'...
Setup Payload:
X-HM://OMITTED
Scan this code with your HomeKit app on your iOS device to pair with Homebridge:
CODE OMITTED
    └────────────┘     

[4/30/2020, 9:54:13 PM] Homebridge is running on port 51822.
[4/30/2020, 9:54:13 PM] [Google Smart Home] Connected (1) - wss://homebridge-gsh.iot.oz.nu
[4/30/2020, 9:54:21 PM] [Config] [HapClient] Discovery :: Started
[4/30/2020, 9:54:22 PM] [Config] Homebridge Config UI X v4.17.1 is listening on :: port 8080
[4/30/2020, 9:54:23 PM] [Config] [HapClient] Discovery :: Found HAP device with username 7C:6D:62:8B:F5:3A
[4/30/2020, 9:54:23 PM] [Config] [HapClient] Discovery :: Testing 7C:6D:62:8B:F5:3A via http://10.0.1.10:51822/accessories
[4/30/2020, 9:54:23 PM] [Config] [HapClient] Discovery :: Found HAP device with username 8D:28:76:62:4B:1F
[4/30/2020, 9:54:23 PM] [Config] [HapClient] Discovery :: Testing 8D:28:76:62:4B:1F via http://10.0.1.10:52207/accessories
[4/30/2020, 9:54:23 PM] [Config] [HapClient] Discovery :: Found HAP device with username 71:71:82:4D:F7:93
[4/30/2020, 9:54:23 PM] [Config] [HapClient] Discovery :: Testing 71:71:82:4D:F7:93 via http://10.0.1.10:52206/accessories
[4/30/2020, 9:54:23 PM] [Config] [HapClient] Discovery :: Found HAP device with username BE:3A:4A:FB:4F:06
[4/30/2020, 9:54:23 PM] [Config] [HapClient] Discovery :: Testing BE:3A:4A:FB:4F:06 via http://10.0.1.4:8080/accessories
[4/30/2020, 9:54:23 PM] [Config] [HapClient] Discovery :: Found HAP device with username 8B:B5:15:B0:35:27
[4/30/2020, 9:54:23 PM] [Config] [HapClient] Discovery :: Testing 8B:B5:15:B0:35:27 via http://10.0.1.16:37538/accessories
[4/30/2020, 9:54:23 PM] [Config] [HapClient] Discovery :: Found HAP device with username EE:CA:EF:A4:5F:0E
[4/30/2020, 9:54:23 PM] [Config] [HapClient] Discovery :: Testing EE:CA:EF:A4:5F:0E via http://10.0.1.104:57350/accessories
[4/30/2020, 9:54:23 PM] [Config] [HapClient] Discovery :: Found HAP device with username 45:CA:F1:E0:89:DA
[4/30/2020, 9:54:23 PM] [Config] [HapClient] Discovery :: Testing 45:CA:F1:E0:89:DA via http://10.0.1.15:33655/accessories
[4/30/2020, 9:54:23 PM] [Config] [HapClient] Discovery :: Found HAP device with username C1:FD:B8:B2:24:DB
[4/30/2020, 9:54:23 PM] [Config] [HapClient] Discovery :: Testing C1:FD:B8:B2:24:DB via http://10.0.1.12:57806/accessories
[4/30/2020, 9:54:23 PM] [Config] [HapClient] Discovery :: Found HAP device with username 48:CF:D3:CE:EB:23
[4/30/2020, 9:54:23 PM] [Config] [HapClient] Discovery :: Testing 48:CF:D3:CE:EB:23 via http://10.0.1.94:1200/accessories
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Found HAP device with username 25:FE:8F:AA:75:AD
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Testing 25:FE:8F:AA:75:AD via http://10.0.1.11:41055/accessories
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Found HAP device with username ED:F9:2B:4C:02:4D
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Testing ED:F9:2B:4C:02:4D via http://10.0.1.8:6517/accessories
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Found HAP device with username 1A:9E:8E:EF:1C:43
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Testing 1A:9E:8E:EF:1C:43 via http://10.0.1.103:38316/accessories
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Success 7C:6D:62:8B:F5:3A via http://10.0.1.10:51822/accessories
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Failed BE:3A:4A:FB:4F:06 via http://10.0.1.4:8080/accessories
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Could not register to device with username BE:3A:4A:FB:4F:06
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Success 8D:28:76:62:4B:1F via http://10.0.1.10:52207/accessories
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Success 71:71:82:4D:F7:93 via http://10.0.1.10:52206/accessories
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Failed 45:CA:F1:E0:89:DA via http://10.0.1.15:33655/accessories
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Could not register to device with username 45:CA:F1:E0:89:DA
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Failed 8B:B5:15:B0:35:27 via http://10.0.1.16:37538/accessories
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Could not register to device with username 8B:B5:15:B0:35:27
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: [10.0.1.10:51822 (7C:6D:62:8B:F5:3A)] Instance Registered
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: [10.0.1.10:52207 (8D:28:76:62:4B:1F)] Instance Registered
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: [10.0.1.10:52206 (71:71:82:4D:F7:93)] Instance Registered
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Failed 25:FE:8F:AA:75:AD via http://10.0.1.11:41055/accessories
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Could not register to device with username 25:FE:8F:AA:75:AD
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Failed EE:CA:EF:A4:5F:0E via http://10.0.1.104:57350/accessories
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Could not register to device with username EE:CA:EF:A4:5F:0E
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Failed 1A:9E:8E:EF:1C:43 via http://10.0.1.103:38316/accessories
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Could not register to device with username 1A:9E:8E:EF:1C:43
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Failed C1:FD:B8:B2:24:DB via http://10.0.1.12:57806/accessories
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Could not register to device with username C1:FD:B8:B2:24:DB
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Failed ED:F9:2B:4C:02:4D via http://10.0.1.8:6517/accessories
[4/30/2020, 9:54:24 PM] [Config] [HapClient] Discovery :: Could not register to device with username ED:F9:2B:4C:02:4D
[4/30/2020, 9:54:25 PM] [Config] [HapClient] Discovery :: Found HAP device with username 1D:6D:F0:2D:F6:5C
[4/30/2020, 9:54:25 PM] [Config] [HapClient] Discovery :: Testing 1D:6D:F0:2D:F6:5C via http://10.0.1.90:39748/accessories
[4/30/2020, 9:54:25 PM] [Config] [HapClient] Discovery :: Failed 48:CF:D3:CE:EB:23 via http://10.0.1.94:1200/accessories
[4/30/2020, 9:54:25 PM] [Config] [HapClient] Discovery :: Could not register to device with username 48:CF:D3:CE:EB:23
[4/30/2020, 9:54:25 PM] [Config] [HapClient] Discovery :: Failed 1D:6D:F0:2D:F6:5C via http://10.0.1.90:39748/accessories
[4/30/2020, 9:54:25 PM] [Config] [HapClient] Discovery :: Could not register to device with username 1D:6D:F0:2D:F6:5C
[4/30/2020, 9:54:38 PM] [Google Smart Home] Finished instance discovery

Homebridge Config:

Config has been left out for privacy reasons. Lot's of info to omit otherwise, config has not changed since this error began occurring, and seems to be an issue only with the UI

Environment: Config-UI-X Node.js Version: 12.16.3 NPM Version: 6.14.4 Homebridge Version: 1.0.4 Homebridge Config UI X Version: 4.17.1 macOS 10.13.6 launchctl

oznu commented 4 years ago

This seems odd.

Can you install @test and show me the debug logs this will now display when attempting to go to the plugins page? I've made a small change to add some very verbose logging into this section to see what is wrong.

https://github.com/oznu/homebridge-config-ui-x/wiki/How-To-Test-Upcoming-Changes

TransRapid commented 4 years ago

Sorry for the delay in reply. Updating to test version resolved it entirely. I’m wondering if there was some permission issue... I went through 24 hours of logs prior to updating, and the only thing I could find that was unordinary was a comment an access error to AccessoryInfo JSON in my persist folder. My only guess is that a plug-in or even the GUI here was updated, needed a newer version of node, but then using some cache that allowed the issue to go unnoticed until it wrote something weird not being on the right version.

I didn’t update my NPM or Node until after I noticed the issue, but first updated all HomeBridge plugins including yours. Maybe the reinstall now corrected outdated files in a way it couldn’t with the older version of Node? If you want I can revert it to the latest stable and see if that causes it to happen again, otherwise going to leave it here for now as it’s working.

TransRapid commented 4 years ago

Figured it was worth it for your development, and now also got a more detailed error message. Error wasn’t showing initially. Looks like it is reading my node_modules folder.

Plugins Page

MODULE: .DS_Store
MODULE: .bin
MODULE: @hoobs.zip
TypeError: allModules.push is not iterable (cannot read property Symbol(Symbol.iterator))
    at PluginsService.<anonymous> (/usr/local/lib/node_modules/homebridge-config-ui-x/dist/main.js:1585:40)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/lib/node_modules/homebridge-config-ui-x/dist/main.js:1177:58)
MODULE: bufferutil
MODULE: homebridge
MODULE: homebridge-chamberlain
MODULE: homebridge-config-ui-x
MODULE: homebridge-dafang
MODULE: homebridge-gsh
MODULE: homebridge-ifttt
MODULE: n
MODULE: npm
MODULE: utf-8-validate
MODULE: .DS_Store
MODULE: .bin
MODULE: @hoobs.zip
TypeError: allModules.push is not iterable (cannot read property Symbol(Symbol.iterator))
    at PluginsService.<anonymous> (/usr/local/lib/node_modules/homebridge-config-ui-x/dist/main.js:1585:40)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/lib/node_modules/homebridge-config-ui-x/dist/main.js:1177:58)
MODULE: bufferutil
MODULE: homebridge
MODULE: homebridge-chamberlain
MODULE: homebridge-config-ui-x
MODULE: homebridge-dafang
MODULE: homebridge-gsh
MODULE: homebridge-ifttt
MODULE: n
MODULE: npm
MODULE: utf-8-validate
MODULE: .DS_Store
MODULE: .bin
MODULE: @hoobs.zip
TypeError: allModules.push is not iterable (cannot read property Symbol(Symbol.iterator))
    at PluginsService.<anonymous> (/usr/local/lib/node_modules/homebridge-config-ui-x/dist/main.js:1585:40)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/lib/node_modules/homebridge-config-ui-x/dist/main.js:1177:58)
MODULE: bufferutil
MODULE: homebridge
MODULE: homebridge-chamberlain
MODULE: homebridge-config-ui-x
MODULE: homebridge-dafang
MODULE: homebridge-gsh
MODULE: homebridge-ifttt
MODULE: n
MODULE: npm
MODULE: utf-8-validate
oznu commented 4 years ago

Delete this:

/usr/local/lib/node_modules/@hoobs.zip
TransRapid commented 4 years ago

I actually did cleanup that folder, hasn’t been an issue in there. Looking into the message below, I am thinking it is a simple fix via chown as it only appears when running Homebridge as local user, but not as root:

Error: EACCES: permission denied, open '/Users/Michael/.homebridge/persist/AccessoryInfo.7171824DF793.json'
    at Object.openSync (fs.js:458:3)
    at Object.writeFileSync (fs.js:1279:35)
    at LocalStorage.persistKeySync (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/node-persist/src/local-storage.js:476:16)
    at LocalStorage.setItemSync (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/node-persist/src/local-storage.js:277:14)
    at AccessoryInfo.save (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/model/AccessoryInfo.ts:223:26)
    at Accessory._this.publish (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:909:25)
    at /usr/local/lib/node_modules/homebridge/src/server.ts:588:20
    at Array.forEach (<anonymous>)
    at Server.handlePublishExternalAccessories (/usr/local/lib/node_modules/homebridge/src/server.ts:547:17)
    at HomebridgeAPI.emit (events.js:310:20)
oznu commented 4 years ago

Yeah., something like this should fix it:

sudo chown -R michael: /Users/Michael/.homebridge
TransRapid commented 4 years ago

Exactly what I did, seemed to fix it. Going to close this as the initial issue here seems to be resolved. Thanks for the help, going to keep running this version with extensive logs for now.

oznu commented 4 years ago

The UI will now handle bad files like @hoobs.zip in the node_modules folder.