https://kotlinlang.org logo
#ktor
Title
# ktor
g

gabin

03/12/2020, 2:33 PM
Hi guys, I’m getting this exception from time to time . can you point what does it mean - “Bad position (limit 50): 51” ? I’m sure that response is not empty ktor 1.3.2 , ktor-client-android
Copy code
03-12 16:17:18.737 4006-4006/com.testapp.android D/NFApi: In validate response method. status: 404 Not Found
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err: java.lang.IllegalArgumentException: Bad position (limit 50): 51
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at java.nio.Buffer.positionImpl(Buffer.java:357)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at java.nio.Buffer.position(Buffer.java:351)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at <http://io.ktor.utils.io|io.ktor.utils.io>.charsets.UTFKt.decodeUTF8Line_array(UTF.kt:661)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at <http://io.ktor.utils.io|io.ktor.utils.io>.charsets.UTFKt.decodeUTF8Line(UTF.kt:36)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel$readUTF8LineToUtf8Suspend$2.invokeSuspend(ByteBufferChannel.kt:2120)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel$readUTF8LineToUtf8Suspend$2.invoke(ByteBufferChannel.kt)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel.lookAheadSuspend$suspendImpl(ByteBufferChannel.kt:1877)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel.lookAheadSuspend(ByteBufferChannel.kt)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel.readUTF8LineToUtf8Suspend(ByteBufferChannel.kt:2116)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel.readUTF8LineToAscii(ByteBufferChannel.kt:2056)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel.readUTF8LineTo$suspendImpl(ByteBufferChannel.kt:2144)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel.readUTF8LineTo(ByteBufferChannel.kt)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel.readUTF8Line$suspendImpl(ByteBufferChannel.kt:2148)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel.readUTF8Line(ByteBufferChannel.kt)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteReadChannelKt.readUTF8Line(ByteReadChannel.kt:223)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at com.testapp.lib.network.NFApi$client$2$1$4$1.invokeSuspend(NFApi.kt:57)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at com.testapp.lib.network.NFApi$client$2$1$4$1.invoke(NFApi.kt)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at io.ktor.client.features.HttpCallValidator.validateResponse(HttpCallValidator.kt:37)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at io.ktor.client.features.HttpCallValidator$Companion$install$2.invokeSuspend(HttpCallValidator.kt:99)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at io.ktor.client.features.HttpCallValidator$Companion$install$2.invoke(HttpCallValidator.kt)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:318)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:163)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:183)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:27)
03-12 16:17:18.757 4006-4006/com.testapp.android W/System.err:     at io.ktor.client.call.HttpClientCall.receive(HttpClientCall.kt:75)
e

e5l

03/13/2020, 4:55 AM
Hi @gabin, it looks like regression. Could you file an issue?
👍 1