homebridge-alexa
homebridge-alexa copied to clipboard
Cannot read properties of undefined (reading 'forEach')
I get this error on startup. I don't think it's affecting anything I use, but I wanted to share it in case it affects anyone else and needs to be addressed.
TypeError: Cannot read properties of undefined (reading 'forEach')
at HAPNodeJSClient._reconnectServer (/usr/local/lib/node_modules/homebridge-alexa/node_modules/hap-node-client/HAPNodeJSClient.js:332:39)
at EventEmitter.emit (node:events:390:28)
at Socket.<anonymous> (/usr/local/lib/node_modules/homebridge-alexa/node_modules/hap-node-client/lib/eventedHttpClient.js:90:24)
at Socket.emit (node:events:402:35)
at endReadableNT (node:internal/streams/readable:1343:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Could you turn on debug logging, restart, and the information prior to the error.
This message is from the events/routines portion of the code so any potential issue would be with routines being triggered within Alexa.
Here are the only two additional log lines preceding the error.
2022-02-04T21:52:05.544Z hapHttpClient Disconnected from server 10.0.0.75:51012 0E:FC:C1:5D:09:B4
2022-02-04T21:52:05.546Z hapNodeJSClient HAPevent events Reregister { server: '10.0.0.75:51012', deviceID: '0E:FC:C1:5D:09:B4' }
[04/02/2022, 16:52:05] TypeError: Cannot read properties of undefined (reading 'forEach')
at HAPNodeJSClient._reconnectServer (/usr/local/lib/node_modules/homebridge-alexa/node_modules/hap-node-client/HAPNodeJSClient.js:332:39)
at EventEmitter.emit (node:events:390:28)
at Socket.<anonymous> (/usr/local/lib/node_modules/homebridge-alexa/node_modules/hap-node-client/lib/eventedHttpClient.js:90:24)
at Socket.emit (node:events:402:35)
at endReadableNT (node:internal/streams/readable:1343:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
I’ve been looking through the logs to see if anything stands out about this error. Nothing does, and there’s not much there, and it only happens at startup.
I did notice something that drew my curiosity in the logs though. It seems like the plugin is actually discovering all HomeKit devices on my network, not just my homebridge devices. Is there a functional reason for this?
The discovery of native HomeKit devices is expected, as I’m using the HomeKit api and interface. But as the interface is secured, I’m not able include them into the service.
@rcoletti116 Do you know what type of device this is ?
0E:FC:C1:5D:09:B4
Native HomeKit, Homebridge or ???
I just about went crazy looking for this on my network, but turns out it doesn't exist! It's a dummy sensor in Homebridge from the dummy-contact plugin.