Netflix/curator — Issue #19: IPv6 problems with ServiceInstanceBuilder
Author: ntolia
Created: 2012-01-19 19:19:04+00:00
State: open

We ran into this exception today with ```ServiceInstanceBuilder```

```
Caused by: java.net.SocketException: No such device
at java.net.NetworkInterface.isP2P0(Native Method)
at java.net.NetworkInterface.isPointToPoint(NetworkInterface.java:354)
at com.netflix.curator.x.discovery.ServiceInstanceBuilder.getAllLocalIPs(ServiceInstanceBuilder.java:139)
at com.netflix.curator.x.discovery.ServiceInstance.builder(ServiceInstance.java:49)
```

Seeing native code in your stacktrace is always scary but it turned out the ```getAllLocalIPs()``` function was coming across an interface with an address of ```/fe80:0:0:0:5a55:caff:fe24:b9a``` and that had problems with NetworkInterface.isPointToPoint().

Disabling IPv6 on this machine helped fixed the issue but I wanted to point this out in case others ran into it and if you guys wanted to tweak the code to sidestep this issue.