Reached illegal state! IPV4 address change from defined to undefined
n0rt0nthec4t opened this issue · 12 comments
Current Situation
Since updating code based to HAP-Nodejs 1.10 and subsequently having ciao updated to 1.3.0, been seeing these errors below in my accessory logs
Thoughts on why now occurring?
AssertionError [ERR_ASSERTION]: Reached illegal state! IPV4 address change from defined to undefined!
at MDNSServer.handleUpdatedNetworkInterfaces (/opt/Nest_accfactory/node_modules/@homebridge/ciao/src/MDNSServer.ts:695:18)
at NetworkManager.emit (node:events:531:35)
at NetworkManager.checkForNewInterfaces (/opt/Nest_accfactory/node_modules/@homebridge/ciao/src/NetworkManager.ts:345:12)
Logs
AssertionError [ERR_ASSERTION]: Reached illegal state! IPV4 address change from defined to undefined!
at MDNSServer.handleUpdatedNetworkInterfaces (/opt/Nest_accfactory/node_modules/@homebridge/ciao/src/MDNSServer.ts:695:18)
at NetworkManager.emit (node:events:531:35)
at NetworkManager.checkForNewInterfaces (/opt/Nest_accfactory/node_modules/@homebridge/ciao/src/NetworkManager.ts:345:12)
Configuration
.
Environment
- OS: Docker NodeJS image, 20-Alpine3.20
- Software:
- Node: 20.15.1
- npm: 108.2
Process Supervisor
other (Explain in Additional Context
)
Additional Context
No response
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is not stale.. Still occuring
Aug 28 09:36:00 garagedoor node[11165]: AssertionError [ERR_ASSERTION]: Reached illegal state! IPV4 address change from defined to undefined!
Aug 28 09:36:00 garagedoor node[11165]: at MDNSServer.handleUpdatedNetworkInterfaces (/home/pi/node_modules/@homebridge/ciao/src/MDNSServer.ts:695:18)
Aug 28 09:36:00 garagedoor node[11165]: at NetworkManager.emit (node:events:526:35)
Aug 28 09:36:00 garagedoor node[11165]: at NetworkManager.checkForNewInterfaces (/home/pi/node_modules/@homebridge/ciao/src/NetworkManager.ts:345:12)
Aug 28 09:36:00 garagedoor node[11165]: at processTicksAndRejections (node:internal/process/task_queues:95:5)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If you can recreate this, at will, turn on debugging please. There should be network change messages around it like Detected network changes
that will provide a bit more context. I’ve struggled to recreate this one at will, unfortunately, and without that…I need data. 😄
Add the environment variable:
DEBUG=ciao:NetworkManager
And let’s see what comes up in/around the assertion error that’s generated and let’s get this one tracked down for everyone’s sake. 😄
Oct 28 18:17:21 irrigation node[19804]: 2024-10-28T07:17:21.037Z ciao:NetworkManager Detected network changes: added: [], removed: [], changes: [{ name: wlan0 , fd13:730d:c0d0:c945:509b:4bd2:3713:6503 -> undefined }]!
Oct 28 18:18:36 irrigation node[19804]: 2024-10-28T07:18:36.421Z ciao:NetworkManager Detected network changes: added: [], removed: [], changes: [{ name: wlan0 , undefined -> fd13:730d:c0d0:c945:509b:4bd2:3713:6503 }]!
Oct 29 10:02:04 irrigation node[19804]: 2024-10-28T23:02:04.385Z ciao:NetworkManager Detected network changes: added: [], removed: [], changes: [{ name: wlan0 , fd13:730d:c0d0:c945:509b:4bd2:3713:6503 -> undefined }]!
Oct 29 10:04:50 irrigation node[19804]: 2024-10-28T23:04:50.176Z ciao:NetworkManager Detected network changes: added: [], removed: [], changes: [{ name: wlan0 , undefined -> fd13:730d:c0d0:c945:509b:4bd2:3713:6503 }]!
Oct 29 10:49:33 irrigation node[19804]: 2024-10-28T23:49:33.131Z ciao:NetworkManager Detected network changes: added: [], removed: [], changes: [{ name: wlan0 , 10.0.1.136 -> undefined , fd13:730d:c0d0:c945:509b:4bd2:3713:6503 -> undefined }]!
Oct 29 10:49:33 irrigation node[19804]: AssertionError [ERR_ASSERTION]: Reached illegal state! IPV4 address change from defined to undefined!
Oct 29 10:49:33 irrigation node[19804]: at MDNSServer.handleUpdatedNetworkInterfaces (/home/pi/node_modules/@homebridge/ciao/src/MDNSServer.ts:695:18)
Oct 29 10:49:33 irrigation node[19804]: at NetworkManager.emit (node:events:526:35)
Oct 29 10:49:33 irrigation node[19804]: at NetworkManager.checkForNewInterfaces (/home/pi/node_modules/@homebridge/ciao/src/NetworkManager.ts:345:12)
Oct 29 10:49:33 irrigation node[19804]: at processTicksAndRejections (node:internal/process/task_queues:95:5)
Thanks, @n0rt0nthec4t I'll take a closer look this week. Offhand it looks like the WiFi interface is losing it's connectivity, and therefore it's IPs...and then reacquiring them a few moments to minutes later.
Appreciate your help capturing the data to this point. Will update with more as I track this down further.