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

[hueemulation] IllegalArgumentException: IPv6 socket cannot join IPv4 multicast group #5589

Closed
kaikreuzer opened this issue May 11, 2019 · 4 comments
Assignees
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@kaikreuzer
Copy link
Member

Just updated to the latest distro 1589.
Directly on startup, I get this in my console:

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown openHAB.

openhab> Exception in thread "HueEmulation UPNP Server" java.lang.IllegalArgumentException: IPv6 socket cannot join IPv4 multicast group
        at sun.nio.ch.DatagramChannelImpl.innerJoin(DatagramChannelImpl.java:808)
        at sun.nio.ch.DatagramChannelImpl.join(DatagramChannelImpl.java:894)
        at org.openhab.io.hueemulation.internal.upnp.UpnpServer.accept(UpnpServer.java:439)
        at org.openhab.io.hueemulation.internal.upnp.UpnpServer.accept(UpnpServer.java:1)
        at org.openhab.io.hueemulation.internal.upnp.HueEmulationConfigWithRuntime.run(HueEmulationConfigWithRuntime.java:105)

Note that I did not even do a log:tail here, so this seems to go out to System.out...

@davidgraeff
Copy link
Member

davidgraeff commented May 11, 2019

https://github.com/openhab/openhab2-addons/blob/master/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/upnp/UpnpServer.java#L438

Looking at the code, there is already a case for IPv4 and IPv6, no idea what is misbehaving here.

Edit: Hm, maybe on Mac computers this line https://github.com/openhab/openhab2-addons/blob/master/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/upnp/UpnpServer.java#L432 behaves different. A new InetSocketAddress(UPNP_PORT) might only bind to IPv6 instead of both protocols. So I would need to check channels socket.

@martinvw martinvw added the bug An unexpected problem or unintended behavior of an add-on label Jun 14, 2019
@martinvw
Copy link
Member

This also breaks the build for me

@martinvw
Copy link
Member

@davidgraeff what is the intention of the code, should it bind to both ipv4 and ipv6 or pick one, because my machine is pretty strict in not mixing them in a single channel.

Should we have two or should we pick one as preference?

martinvw added a commit to martinvw/openhab2-addons that referenced this issue Jun 14, 2019
Resolves exception of combining ipv4 / ipv6 by getting to separate channels

Closes openhab#5589

Exception in thread "HueEmulation UPNP Server" java.lang.IllegalArgumentException: IPv6 socket cannot join IPv4 multicast group
        at sun.nio.ch.DatagramChannelImpl.innerJoin(DatagramChannelImpl.java:808)
        at sun.nio.ch.DatagramChannelImpl.join(DatagramChannelImpl.java:894)
        at org.openhab.io.hueemulation.internal.upnp.UpnpServer.accept(UpnpServer.java:439)
        at org.openhab.io.hueemulation.internal.upnp.UpnpServer.accept(UpnpServer.java:1)
        at org.openhab.io.hueemulation.internal.upnp.HueEmulationConfigWithRuntime.run(HueEmulationConfigWithRuntime.java:105)

Signed-off-by: Martin van Wingerden <martin@martinvw.nl>
@davidgraeff
Copy link
Member

what is the intention of the code, should it bind to both ipv4 and ipv6 or pick one

It's not exactly for binding. We could just bind to "::" and IPv4 and IPv6 would work. The code is for sending a upnp broadcast message to every interface. And IPv4 has of course a different multicast target IP than IPv6 for upnp.

Pshatsillo pushed a commit to Pshatsillo/openhab-addons that referenced this issue Jun 19, 2019
Resolves exception of combining ipv4 / ipv6 by getting to separate channels

Closes openhab#5589

Exception in thread "HueEmulation UPNP Server" java.lang.IllegalArgumentException: IPv6 socket cannot join IPv4 multicast group
        at sun.nio.ch.DatagramChannelImpl.innerJoin(DatagramChannelImpl.java:808)
        at sun.nio.ch.DatagramChannelImpl.join(DatagramChannelImpl.java:894)
        at org.openhab.io.hueemulation.internal.upnp.UpnpServer.accept(UpnpServer.java:439)
        at org.openhab.io.hueemulation.internal.upnp.UpnpServer.accept(UpnpServer.java:1)
        at org.openhab.io.hueemulation.internal.upnp.HueEmulationConfigWithRuntime.run(HueEmulationConfigWithRuntime.java:105)

Signed-off-by: Martin van Wingerden <martin@martinvw.nl>
Signed-off-by: Pshatsillo <pshatsillo@gmail.com>
knikhilwiz pushed a commit to knikhilwiz/openhab2-addons that referenced this issue Jul 3, 2019
Resolves exception of combining ipv4 / ipv6 by getting to separate channels

Closes openhab#5589

Exception in thread "HueEmulation UPNP Server" java.lang.IllegalArgumentException: IPv6 socket cannot join IPv4 multicast group
        at sun.nio.ch.DatagramChannelImpl.innerJoin(DatagramChannelImpl.java:808)
        at sun.nio.ch.DatagramChannelImpl.join(DatagramChannelImpl.java:894)
        at org.openhab.io.hueemulation.internal.upnp.UpnpServer.accept(UpnpServer.java:439)
        at org.openhab.io.hueemulation.internal.upnp.UpnpServer.accept(UpnpServer.java:1)
        at org.openhab.io.hueemulation.internal.upnp.HueEmulationConfigWithRuntime.run(HueEmulationConfigWithRuntime.java:105)

Signed-off-by: Martin van Wingerden <martin@martinvw.nl>
ne0h pushed a commit to ne0h/openhab-addons that referenced this issue Sep 15, 2019
Resolves exception of combining ipv4 / ipv6 by getting to separate channels

Closes openhab#5589

Exception in thread "HueEmulation UPNP Server" java.lang.IllegalArgumentException: IPv6 socket cannot join IPv4 multicast group
        at sun.nio.ch.DatagramChannelImpl.innerJoin(DatagramChannelImpl.java:808)
        at sun.nio.ch.DatagramChannelImpl.join(DatagramChannelImpl.java:894)
        at org.openhab.io.hueemulation.internal.upnp.UpnpServer.accept(UpnpServer.java:439)
        at org.openhab.io.hueemulation.internal.upnp.UpnpServer.accept(UpnpServer.java:1)
        at org.openhab.io.hueemulation.internal.upnp.HueEmulationConfigWithRuntime.run(HueEmulationConfigWithRuntime.java:105)

Signed-off-by: Martin van Wingerden <martin@martinvw.nl>
Signed-off-by: Maximilian Hess <mail@ne0h.de>
tmrobert8 pushed a commit to tmrobert8/openhab-addons that referenced this issue Jan 21, 2020
Resolves exception of combining ipv4 / ipv6 by getting to separate channels

Closes openhab#5589

Exception in thread "HueEmulation UPNP Server" java.lang.IllegalArgumentException: IPv6 socket cannot join IPv4 multicast group
        at sun.nio.ch.DatagramChannelImpl.innerJoin(DatagramChannelImpl.java:808)
        at sun.nio.ch.DatagramChannelImpl.join(DatagramChannelImpl.java:894)
        at org.openhab.io.hueemulation.internal.upnp.UpnpServer.accept(UpnpServer.java:439)
        at org.openhab.io.hueemulation.internal.upnp.UpnpServer.accept(UpnpServer.java:1)
        at org.openhab.io.hueemulation.internal.upnp.HueEmulationConfigWithRuntime.run(HueEmulationConfigWithRuntime.java:105)

Signed-off-by: Martin van Wingerden <martin@martinvw.nl>
Signed-off-by: Tim Roberts <timmarkroberts@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

No branches or pull requests

3 participants