Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: Index file size too large for class FetchedIndex.fileSize #428

Open
tombeck opened this issue Dec 19, 2024 · 0 comments
Open

[bug]: Index file size too large for class FetchedIndex.fileSize #428

tombeck opened this issue Dec 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@tombeck
Copy link

tombeck commented Dec 19, 2024

Description

A request to SearchClient.listIndices fails if the file size of any index is larger than 2GB because the type of FetchedIndex.fileSize is Int.

Client

Search

Version

3.12.2

Relevant log output

Illegal input: Unexpected JSON token at offset 425: Failed to parse int for input '2166386628' at path: $.items[1].fileSize
JSON input: .....69070626,"fileSize":2166386628,"lastBuildTimeS":14,"numberOf.....: com.algolia.client.exception.AlgoliaClientException
com.algolia.client.exception.AlgoliaClientException: Illegal input: Unexpected JSON token at offset 425: Failed to parse int for input '2166386628' at path: $.items[1].fileSize
JSON input: .....69070626,"fileSize":2166386628,"lastBuildTimeS":14,"numberOf.....
	at com.algolia.client.exception.internal.ThrowableKt.asClientException(Throwable.kt:10)
	at com.algolia.client.transport.internal.KtorRequester.onError(KtorRequester.kt:109)
	at com.algolia.client.transport.internal.KtorRequester.execute(KtorRequester.kt:74)
	at com.algolia.client.transport.internal.KtorRequester$execute$1.invokeSuspend(KtorRequester.kt)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:263)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:95)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:69)
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:47)
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
	...
	<removed>
	...
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
Caused by: io.ktor.serialization.JsonConvertException: Illegal input: Unexpected JSON token at offset 425: Failed to parse int for input '2166386628' at path: $.items[1].fileSize
JSON input: .....69070626,"fileSize":2166386628,"lastBuildTimeS":14,"numberOf.....
	at io.ktor.serialization.kotlinx.KotlinxSerializationConverter.deserialize(KotlinxSerializationConverter.kt:77)
	at io.ktor.serialization.ContentConverterKt$deserialize$$inlined$map$1$2.emit(Emitters.kt:51)
	at kotlinx.coroutines.flow.FlowKt__BuildersKt$asFlow$$inlined$unsafeFlow$3.collect(SafeCollector.common.kt:111)
	at io.ktor.serialization.ContentConverterKt$deserialize$$inlined$map$1.collect(SafeCollector.common.kt:109)
	at kotlinx.coroutines.flow.FlowKt__ReduceKt.firstOrNull(Reduce.kt:239)
	at kotlinx.coroutines.flow.FlowKt.firstOrNull(Unknown Source)
	at io.ktor.serialization.ContentConverterKt.deserialize(ContentConverter.kt:97)
	at io.ktor.client.plugins.contentnegotiation.ContentNegotiationKt.ContentNegotiation$lambda$13$convertResponse(ContentNegotiation.kt:234)
	at io.ktor.client.plugins.contentnegotiation.ContentNegotiationKt.access$ContentNegotiation$lambda$13$convertResponse(ContentNegotiation.kt:1)
	at io.ktor.client.plugins.contentnegotiation.ContentNegotiationKt$ContentNegotiation$2$2.invokeSuspend(ContentNegotiation.kt:249)
	at io.ktor.client.plugins.contentnegotiation.ContentNegotiationKt$ContentNegotiation$2$2.invoke(ContentNegotiation.kt)
	at io.ktor.client.plugins.contentnegotiation.ContentNegotiationKt$ContentNegotiation$2$2.invoke(ContentNegotiation.kt)
	at io.ktor.client.plugins.api.TransformResponseBodyHook$install$1.invokeSuspend(KtorCallContexts.kt:104)
	at io.ktor.client.plugins.api.TransformResponseBodyHook$install$1.invoke(KtorCallContexts.kt)
	at io.ktor.client.plugins.api.TransformResponseBodyHook$install$1.invoke(KtorCallContexts.kt)
	at io.ktor.util.pipeline.DebugPipelineContext.proceedLoop(DebugPipelineContext.kt:79)
	at io.ktor.util.pipeline.DebugPipelineContext.proceed(DebugPipelineContext.kt:57)
	at io.ktor.client.HttpClient$4.invokeSuspend(HttpClient.kt:1379)
	at io.ktor.client.HttpClient$4.invoke(HttpClient.kt)
	at io.ktor.client.HttpClient$4.invoke(HttpClient.kt)
	at io.ktor.util.pipeline.DebugPipelineContext.proceedLoop(DebugPipelineContext.kt:79)
	at io.ktor.util.pipeline.DebugPipelineContext.proceed(DebugPipelineContext.kt:57)
	at io.ktor.client.plugins.ReceiveError$install$1.invokeSuspend(HttpCallValidator.kt:149)
	at io.ktor.client.plugins.ReceiveError$install$1.invoke(HttpCallValidator.kt)
	at io.ktor.client.plugins.ReceiveError$install$1.invoke(HttpCallValidator.kt)
	at io.ktor.util.pipeline.DebugPipelineContext.proceedLoop(DebugPipelineContext.kt:79)
	at io.ktor.util.pipeline.DebugPipelineContext.proceed(DebugPipelineContext.kt:57)
	at io.ktor.util.pipeline.DebugPipelineContext.execute$ktor_utils(DebugPipelineContext.kt:63)
	at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:86)
	at io.ktor.client.call.HttpClientCall.bodyNullable(HttpClientCall.kt:87)
	at io.ktor.client.call.HttpClientCallKt.body(HttpClientCall.kt:151)
	at com.algolia.client.transport.internal.KtorRequester.execute(KtorRequester.kt:70)
	... 15 more
Caused by: kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 425: Failed to parse int for input '2166386628' at path: $.items[1].fileSize
JSON input: .....69070626,"fileSize":2166386628,"lastBuildTimeS":14,"numberOf.....
	at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:24)
	at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:32)
	at kotlinx.serialization.json.internal.AbstractJsonLexer.fail(AbstractJsonLexer.kt:580)
	at kotlinx.serialization.json.internal.AbstractJsonLexer.fail$default(AbstractJsonLexer.kt:578)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeInt(StreamingJsonDecoder.kt:299)
	at kotlinx.serialization.encoding.AbstractDecoder.decodeIntElement(AbstractDecoder.kt:53)
	at com.algolia.client.model.search.FetchedIndex$$serializer.deserialize(FetchedIndex.kt:23)
	at com.algolia.client.model.search.FetchedIndex$$serializer.deserialize(FetchedIndex.kt:23)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:69)
	at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
	at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableElement(StreamingJsonDecoder.kt:168)
	at kotlinx.serialization.encoding.CompositeDecoder$DefaultImpls.decodeSerializableElement$default(Decoding.kt:538)
	at kotlinx.serialization.internal.CollectionLikeSerializer.readElement(CollectionSerializers.kt:80)
	at kotlinx.serialization.internal.AbstractCollectionSerializer.readElement$default(CollectionSerializers.kt:51)
	at kotlinx.serialization.internal.AbstractCollectionSerializer.merge(CollectionSerializers.kt:36)
	at kotlinx.serialization.internal.AbstractCollectionSerializer.deserialize(CollectionSerializers.kt:43)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:69)
	at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
	at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableElement(StreamingJsonDecoder.kt:168)
	at com.algolia.client.model.search.ListIndicesResponse$$serializer.deserialize(ListIndicesResponse.kt:13)
	at com.algolia.client.model.search.ListIndicesResponse$$serializer.deserialize(ListIndicesResponse.kt:13)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:69)
	at kotlinx.serialization.json.Json.decodeFromString(Json.kt:165)
	at io.ktor.serialization.kotlinx.KotlinxSerializationConverter.deserialize(KotlinxSerializationConverter.kt:69)
	... 46 more
@tombeck tombeck added the bug Something isn't working label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant