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

Reached illegal state! IPV4 address change from defined to undefined #50

Open
n0rt0nthec4t opened this issue Jul 28, 2024 · 13 comments
Open
Labels
question Further information is requested

Comments

@n0rt0nthec4t
Copy link

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

@n0rt0nthec4t n0rt0nthec4t added the question Further information is requested label Jul 28, 2024
Copy link

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.

@github-actions github-actions bot added the stale label Aug 27, 2024
@n0rt0nthec4t
Copy link
Author

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)

Copy link

github-actions bot commented Oct 2, 2024

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.

@github-actions github-actions bot added the stale label Oct 2, 2024
@hjdhjd
Copy link
Contributor

hjdhjd commented Oct 2, 2024

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. 😄

@github-actions github-actions bot removed the stale label Oct 3, 2024
@n0rt0nthec4t
Copy link
Author

n0rt0nthec4t commented Oct 29, 2024

@hjdhjd

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)

@hjdhjd
Copy link
Contributor

hjdhjd commented Oct 29, 2024

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.

@n0rt0nthec4t
Copy link
Author

Some other observations, this only starting occurring in like a recent version of CIAO. maybe 1.2 or later? Doesnt seem to happen with bonjour or AVAHI, but thats just conjecture

@hjdhjd
Copy link
Contributor

hjdhjd commented Oct 29, 2024

I’m aware - don’t need more data at this time. Will get back to you when more info or testing is needed. Thanks. 😄

@mishakim
Copy link

mishakim commented Nov 9, 2024

I'm having the same error on a new Raspberry Pi 5, standard Homebridge image with a setup restored from a long-term install on a Mac Mini that finally failed. It intermittently loses connectivity, and seems to also restart Homebridge on its own at least some of the times that the network resets.

Reviewing the logs after the most recent night of frequent restarts, one of the restarts was preceded by the same error as in the original report, which came after repeated lines of:
Warning: no IPv4 address available on eth0

I get those no IPv4 address errors a lot - not always accompanied by restarts.
I think the network loss is unrelated to Homebridge - I also lose ssh and pi-hole, then everything comes back a bit later. But home bridge doesn't seem to like it. So I'm trying to fix that problem, but thought I should chime in on this thread to report that it's not limited to n0rt0nthec4t's config.

Environment
OS: Debian Bookworm (12)
Node: 20.18.0
npm: 10.8.2
Raspberry Pi 5, 4GB, no accessories except the fan connected, also running pi-hole and wireguard, nothing else

@hjdhjd
Copy link
Contributor

hjdhjd commented Nov 9, 2024

While I appreciate the earnestness, I don’t need any additional feedback at this time on this issue. It’ll be resolved in an upcoming update. Thanks!

I should also add: please keep Homebridge reports in the Homebridge issue log, and ciao reports here. Ciao is an underlying capability and ciao is not Homebridge, and Homebridge is not ciao. 😄 Ciao is a network support library, not an end user product. We keep things separated so we can focus appropriately. Thanks!

@mishakim I should also add: nobody using Linux should be using ciao for Homebridge. Read the Homebridge wiki or other sources for details…but again, none of that belongs here. 😄 Thanks!

Copy link

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.

@github-actions github-actions bot added the stale label Dec 10, 2024
Copy link

This issue has been closed as no further activity has occurred.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 15, 2024
@n0rt0nthec4t
Copy link
Author

Why is this closed? It still an issue waiting to be addressed

@Supereg Supereg reopened this Jan 3, 2025
@github-actions github-actions bot removed the stale label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants