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

Cannot read properties of undefined (reading 'forEach') #500

Open
rcoletti116 opened this issue Feb 4, 2022 · 6 comments
Open

Cannot read properties of undefined (reading 'forEach') #500

rcoletti116 opened this issue Feb 4, 2022 · 6 comments

Comments

@rcoletti116
Copy link

rcoletti116 commented Feb 4, 2022

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)
@NorthernMan54
Copy link
Owner

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.

@rcoletti116
Copy link
Author

rcoletti116 commented Feb 4, 2022

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)

@rcoletti116
Copy link
Author

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?

@NorthernMan54
Copy link
Owner

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.

@NorthernMan54
Copy link
Owner

@rcoletti116 Do you know what type of device this is ?

0E:FC:C1:5D:09:B4

Native HomeKit, Homebridge or ???

@rcoletti116
Copy link
Author

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.

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

2 participants