Keep on seeing Connection reset by peer errors (lo...
# ktor
n
Keep on seeing Connection reset by peer errors (looks as though there is a issue on the client side) in the server logs which are caused by the Android client (but not Postman in testing). The server uses Ktor 1.1.2, Kotlin 1.3.20, Zulu JDK 11.0.2, and Netty as the web engine. Below is the server error:
Copy code
DEBUG Application:102 - I/O operation failed
java.io.IOException: Connection reset by peer
	at java.base/sun.nio.ch.FileDispatcherImpl.read0(Native Method)
	at java.base/sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
	at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276)
	at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:233)
	at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:223)
	at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:358)
	at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288)
	at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1108)
	at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:345)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:545)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:499)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:834)
On the Android client side it looks as though there is a issue on the server side with Socket Closed (https://stackoverflow.com/questions/24620953/android-error-java-net-socketexception-socket-closed) errors appearing in the logs. Encountering bi-directional issues here where it isn't clear which side is causing the issue 😕. How do I know if the issue is on the server side?
On the Android client side the issues only appear when fetching some logs via the HTTP REST API. Some API calls work without issue with the Android client.
Are there any Socket Closed related issues that have been fixed in a recent Ktor release?
130 Views