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

Encountered invalid ipv6 with more than 8 sections! #5

Closed
ellisonpatterson opened this issue Sep 17, 2020 · 7 comments
Closed

Encountered invalid ipv6 with more than 8 sections! #5

ellisonpatterson opened this issue Sep 17, 2020 · 7 comments

Comments

@ellisonpatterson
Copy link

Describe The Bug:
It seems CIAO is not validating the IPV6 address assigned to the OS and homebridge crashes immediately on start.

Logs:

[Thu Sep 17 2020 09:29:04 GMT-0400 (EDT)] Homebridge is running on port 51826.
[Thu Sep 17 2020 09:29:04 GMT-0400 (EDT)] AssertionError [ERR_ASSERTION]: Encountered invalid ipv6 with more than 8 sections!
    at Object.enlargeIPv6 (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/util/domain-formatter.ts:140:9)
    at AAAARecord.encodeRData (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/coder/records/AAAARecord.ts:33:21)
    at AAAARecord.getRawData (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/coder/ResourceRecord.ts:101:31)
    at rrComparator (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/util/tiebreaking.ts:24:25)
    at Array.sort (<anonymous>)
    at Prober.doTiebreaking (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/responder/Prober.ts:268:62)
    at Prober.handleQuery (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/responder/Prober.ts:243:12)
    at Responder.handleQuery (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/Responder.ts:525:26)
    at MDNSServer.handleMessage (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/MDNSServer.ts:466:20)
    at Socket.emit (events.js:315:20)
[Thu Sep 17 2020 09:29:04 GMT-0400 (EDT)] AssertionError [ERR_ASSERTION]: Encountered invalid ipv6 with more than 8 sections!
    at Object.enlargeIPv6 (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/util/domain-formatter.ts:140:9)
    at AAAARecord.encodeRData (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/coder/records/AAAARecord.ts:33:21)
    at AAAARecord.getRawData (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/coder/ResourceRecord.ts:101:31)
    at rrComparator (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/util/tiebreaking.ts:24:25)
    at Array.sort (<anonymous>)
    at Prober.doTiebreaking (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/responder/Prober.ts:268:62)
    at Prober.handleQuery (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/responder/Prober.ts:243:12)
    at Responder.handleQuery (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/Responder.ts:525:26)
    at MDNSServer.handleMessage (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/MDNSServer.ts:466:20)
    at Socket.emit (events.js:315:20)
[Thu Sep 17 2020 09:29:04 GMT-0400 (EDT)] Got SIGTERM, shutting down Homebridge...
(node:2801) UnhandledPromiseRejectionWarning: cancelled
(node:2801) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:2801) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Homebridge Config:

{
    "bridge": {
        "name": "Home",
        "username": "CC:22:3D:E3:AA:31",
        "port": 51826,
        "pin": "999-01-999"
    },
    "ports": {
        "start": 52100,
        "end": 52150,
        "comment": "This section is used to control the range of ports that separate accessory (like camera or television) should be bind to."
    },
    "accessories": [
        {
            "accessory": "DummySwitch",
            "name": "Home Status",
            "stateful": true
        }
    ],
    "platforms": [
        {
            "name": "Config",
            "port": 9000,
            "auth": "form",
            "theme": "auto",
            "restart": "exec '/opt/etc/init.d/S60homebridge restart'",
            "tempUnits": "f",
            "lang": "auto",
            "sudo": false,
            "log": {
                "method": "custom",
                "command": "/opt/data/homebridge/watch-logs.sh"
            },
            "platform": "config"
        }
    ]
}

Environment:

  • Node.js Version: v12.18.3
  • NPM Version: 6.14.8
  • Homebridge Version: 1.2.2
  • Operating System: other
  • Process Supervisor: other
@Supereg
Copy link
Member

Supereg commented Sep 18, 2020

Could you please elaborate which operating system you are using.
Also can you provide the IPv6 address which ciao fails to parse? Can be censored in anyway when at least the structure is kept in the same way.
Can't guide you to any steps as I don't know your OS.

@Supereg Supereg transferred this issue from homebridge/homebridge Sep 21, 2020
@ellisonpatterson
Copy link
Author

Could you please elaborate which operating system you are using.
Also can you provide the IPv6 address which ciao fails to parse? Can be censored in anyway when at least the structure is kept in the same way.
Can't guide you to any steps as I don't know your OS.

It is dd-wrt and the IPv6 address is fe80::c314:60ff:ff37:2370/64

@ellisonpatterson
Copy link
Author

@Supereg Just updated and here is the new log output:

Sep 21 11:08:32 III-1 user.notice homebridge: Error occurred handling incoming (on lo) dns query packet: AssertionError [ERR_ASSERTION]: Encountered invalid ipv6 with more than 8 sections (2604:6000:xxxx:73c8:200:ff:fe00::)!
Sep 21 11:08:32 III-1 user.notice homebridge:     at Object.enlargeIPv6 (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/util/domain-formatter.ts:140:9)
Sep 21 11:08:32 III-1 user.notice homebridge:     at AAAARecord.encodeRData (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/coder/records/AAAARecord.ts:33:21)
Sep 21 11:08:32 III-1 user.notice homebridge:     at AAAARecord.getRawData (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/coder/ResourceRecord.ts:101:31)
Sep 21 11:08:32 III-1 user.notice homebridge:     at rrComparator (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/util/tiebreaking.ts:24:25)
Sep 21 11:08:32 III-1 user.notice homebridge:     at Array.sort (<anonymous>)
Sep 21 11:08:32 III-1 user.notice homebridge:     at Prober.doTiebreaking (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/responder/Prober.ts:268:62)
Sep 21 11:08:32 III-1 user.notice homebridge:     at Prober.handleQuery (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/responder/Prober.ts:243:12)
Sep 21 11:08:32 III-1 user.notice homebridge:     at Responder.handleQuery (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/Responder.ts:539:26)
Sep 21 11:08:32 III-1 user.notice homebridge:     at MDNSServer.handleMessage (/opt/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/MDNSServer.ts:467:22)
Sep 21 11:08:32 III-1 user.notice homebridge:     at Socket.emit (events.js:315:20)

@Supereg
Copy link
Member

Supereg commented Sep 22, 2020

I assume the xxxx is just you censoring your ipv6 address?

@Supereg
Copy link
Member

Supereg commented Sep 22, 2020

@ellisonpatterson thanks, the log output helped to identify and reproduce the issue. Will be fixed with the next version.

@Supereg
Copy link
Member

Supereg commented Sep 22, 2020

ciao was updated to v.1.0.11 including a fix for this problem. It will take some time until we release a new homebridge version. If you want to force update ciao, just reinstall homebridge npm package and it should pull in the update automatically.

Edit: depending on npm caches, you may need to wait a few minutes.

@ellisonpatterson
Copy link
Author

ciao was updated to v.1.0.11 including a fix for this problem. It will take some time until we release a new homebridge version. If you want to force update ciao, just reinstall homebridge npm package and it should pull in the update automatically.

Edit: depending on npm caches, you may need to wait a few minutes.

Sorry about my tardiness. Thank you so much for the prompt update!

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