Hi, a user of ours is getting the following except...
# ktor
o
Hi, a user of ours is getting the following exception when performing a HTTP request
Caused by java.nio.channels.UnresolvedAddressException
at <http://sun.nio.ch.Net|sun.nio.ch.Net>.checkAddress(Net.java:107)
at <http://sun.nio.ch|sun.nio.ch>.SocketChannelImpl.connect(SocketChannelImpl.java:663)
at io.ktor.network.sockets.SocketImpl.connect$ktor_network(SocketImpl.kt:32)
at io.ktor.network.sockets.ConnectUtilsJvmKt.connect(ConnectUtilsJvm.kt:19)
at io.ktor.network.sockets.TcpSocketBuilder.connect(TcpSocketBuilder.kt:38)
at io.ktor.client.engine.cio.ConnectionFactory.connect(ConnectionFactory.kt:24)
at io.ktor.client.engine.cio.Endpoint$connect$2$connect$1.invokeSuspend(Endpoint.kt:179)
at io.ktor.client.engine.cio.Endpoint$connect$2$connect$1.invoke(Endpoint.kt:8)
at io.ktor.client.engine.cio.Endpoint$connect$2$connect$1.invoke(Endpoint.kt:4)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturnIgnoreTimeout(UndispatchedKt.java:100)
at kotlinx.coroutines.TimeoutKt.setupTimeout(Timeout.kt:146)
at kotlinx.coroutines.TimeoutKt.withTimeoutOrNull(Timeout.kt:103)
at io.ktor.client.engine.cio.Endpoint.connect(Endpoint.kt:187)
at io.ktor.client.engine.cio.Endpoint.access$connect(Endpoint.kt:21)
at io.ktor.client.engine.cio.Endpoint$makeDedicatedRequest$1.invokeSuspend(Endpoint.kt:99)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
Anyone knows how to solve this?
d
It looks like they are not connected to the internet.
Copy code
UnresolvedAddressException
Unchecked exception thrown when an attempt is made to invoke a network operation upon an unresolved socket address.
o
Is there any other alternative cause?
d
I don't know
a
Proxy server or some firewall
r
Could be a DNS issue, you could try using the ip address directly instead of whatever host name it's trying to connect to.