Using IPV6 address in blaze client builder throws protocol exception in runtime. However using wildcard address "::" does not.
What are you using? I just started one on ::1 and it was fine.
My bad. This only occurs with building a static image with Graal.
java.net.SocketException: Protocol family unavailable
at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_ARRAY:Ljava_net_SocketException_2_0002e_0003cinit_0003e_00028Ljava_lang_String_2_00029V(JNIJavaCallWrappers.java:0)
at com.oracle.svm.jni.functions.JNIFunctions$NewObjectWithObjectArrayArgFunctionPointer.invoke(JNIFunctions.java)
at com.oracle.svm.jni.functions.JNIFunctions.ThrowNew(JNIFunctions.java:801)
at sun.nio.ch.Net.bind0(Net.java)
at sun.nio.ch.Net.bind(Net.java:455)
at sun.nio.ch.Net.bind(Net.java:447)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)
at java.nio.channels.ServerSocketChannel.bind(ServerSocketChannel.java:162)
at org.http4s.blaze.channel.nio1.NIO1SocketServerGroup.$anonfun$bind$1(NIO1SocketServerGroup.scala:217)
at scala.util.Try$.apply(Try.scala:210)
at org.http4s.blaze.channel.nio1.NIO1SocketServerGroup.bind(NIO1SocketServerGroup.scala:216)
at org.http4s.blaze.channel.nio1.NIO1SocketServerGroup$$anon$1.bind(NIO1SocketServerGroup.scala:79)
at org.http4s.server.blaze.BlazeServerBuilder.$anonfun$resource$5(BlazeServerBuilder.scala:341)
at scala.Function1.$anonfun$andThen$1(Function1.scala:85)
at scala.Function1.$anonfun$andThen$1(Function1.scala:85)
at cats.effect.IO$Map.apply(IO.scala:1504)
at cats.effect.IO$Map.apply(IO.scala:1502)
at cats.effect.internals.IORunLoop$.cats$effect$internals$IORunLoop$$loop(IORunLoop.scala:142)
at cats.effect.internals.IORunLoop$.startCancelable(IORunLoop.scala:41)
at cats.effect.internals.IOBracket$BracketStart.run(IOBracket.scala:88)
at cats.effect.internals.Trampoline.cats$effect$internals$Trampoline$$immediateLoop(Trampoline.scala:67)
at cats.effect.internals.Trampoline.startLoop(Trampoline.scala:35)
at cats.effect.internals.TrampolineEC$JVMTrampoline.super$startLoop(TrampolineEC.scala:89)
at cats.effect.internals.TrampolineEC$JVMTrampoline.$anonfun$startLoop$1(TrampolineEC.scala:89)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:94)
at cats.effect.internals.TrampolineEC$JVMTrampoline.startLoop(TrampolineEC.scala:89)
at cats.effect.internals.Trampoline.execute(Trampoline.scala:43)
at cats.effect.internals.TrampolineEC.execute(TrampolineEC.scala:42)
at cats.effect.internals.IOBracket$BracketStart.apply(IOBracket.scala:69)
at cats.effect.internals.IOBracket$BracketStart.apply(IOBracket.scala:49)
at cats.effect.internals.IORunLoop$.cats$effect$internals$IORunLoop$$loop(IORunLoop.scala:139)
at cats.effect.internals.IORunLoop$.start(IORunLoop.scala:34)
at cats.effect.internals.IOBracket$.$anonfun$apply$1(IOBracket.scala:42)
at cats.effect.internals.IOBracket$.$anonfun$apply$1$adapted(IOBracket.scala:32)
at cats.effect.internals.IORunLoop$RestartCallback.start(IORunLoop.scala:345)
at cats.effect.internals.IORunLoop$.cats$effect$internals$IORunLoop$$loop(IORunLoop.scala:122)
at cats.effect.internals.IORunLoop$RestartCallback.signal(IORunLoop.scala:359)
at cats.effect.internals.IORunLoop$RestartCallback.apply(IORunLoop.scala:380)
at cats.effect.internals.IORunLoop$RestartCallback.apply(IORunLoop.scala:323)
at cats.effect.internals.IOShift$Tick.run(IOShift.scala:35)
at cats.effect.internals.PoolUtils$$anon$2$$anon$3.run(PoolUtils.scala:52)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.lang.Thread.run(Thread.java:834)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:527)
at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)
I will follow up with Graal devs
Following up here : https://github.com/gradinac/musl-bundle-example/pull/1#issuecomment-615070966
As a follow up this is a bug reported in https://github.com/oracle/graal/issues/2373 . It appears that it might be fixed in the next graal release. Since it's not caused by http4s I will close the issue.
Thanks for hunting that down!