kordlib/Lavalink.kt

Error when loading track

mani1232 opened this issue · 4 comments

2024-01-19 18:47:33.142 [DefaultDispatcher-worker-15] TRACE i.k.client.plugins.HttpCallValidator - Processing exception io.ktor.serialization.JsonConvertException: Illegal input: Fields [pluginInfo, userData] are required for type with serial name 'dev.arbjerg.lavalink.protocol.v4.Track', but they were missing at path: $ for request http://82.67.2.160:2333/v4/loadtracks?identifier=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DQloMdg2bapw
2024-01-19 18:47:33.143 [DefaultDispatcher-worker-15] ERROR dev.kord.core.Kord - catching
io.ktor.serialization.JsonConvertException: Illegal input: Fields [pluginInfo, userData] are required for type with serial name 'dev.arbjerg.lavalink.protocol.v4.Track', but they were missing at path: $
	at io.ktor.serialization.kotlinx.KotlinxSerializationConverter.deserialize(KotlinxSerializationConverter.kt:90)
	at io.ktor.serialization.ContentConverterKt$deserialize$$inlined$map$1$2.emit(Emitters.kt:224)
	at kotlinx.coroutines.flow.FlowKt__BuildersKt$asFlow$$inlined$unsafeFlow$3.collect(SafeCollector.common.kt:118)
	at io.ktor.serialization.ContentConverterKt$deserialize$$inlined$map$1.collect(SafeCollector.common.kt:113)
	at kotlinx.coroutines.flow.FlowKt__ReduceKt.firstOrNull(Reduce.kt:243)
	at kotlinx.coroutines.flow.FlowKt.firstOrNull(Unknown Source)
	at io.ktor.serialization.ContentConverterKt.deserialize(ContentConverter.kt:123)
	at io.ktor.client.plugins.contentnegotiation.ContentNegotiation.convertResponse$ktor_client_content_negotiation(ContentNegotiation.kt:230)
	at io.ktor.client.plugins.contentnegotiation.ContentNegotiation$Plugin$install$2.invokeSuspend(ContentNegotiation.kt:262)
	at io.ktor.client.plugins.contentnegotiation.ContentNegotiation$Plugin$install$2.invoke(ContentNegotiation.kt)
	at io.ktor.client.plugins.contentnegotiation.ContentNegotiation$Plugin$install$2.invoke(ContentNegotiation.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:120)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:78)
	at io.ktor.client.HttpClient$4.invokeSuspend(HttpClient.kt:177)
	at io.ktor.client.HttpClient$4.invoke(HttpClient.kt)
	at io.ktor.client.HttpClient$4.invoke(HttpClient.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:120)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:78)
	at io.ktor.client.plugins.logging.Logging$setupResponseLogging$2.invokeSuspend(Logging.kt:201)
	at io.ktor.client.plugins.logging.Logging$setupResponseLogging$2.invoke(Logging.kt)
	at io.ktor.client.plugins.logging.Logging$setupResponseLogging$2.invoke(Logging.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:120)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:78)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceedWith(SuspendFunctionGun.kt:88)
	at io.ktor.client.plugins.HttpCallValidator$Companion$install$2.invokeSuspend(HttpCallValidator.kt:142)
	at io.ktor.client.plugins.HttpCallValidator$Companion$install$2.invoke(HttpCallValidator.kt)
	at io.ktor.client.plugins.HttpCallValidator$Companion$install$2.invoke(HttpCallValidator.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:120)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:78)
	at io.ktor.util.pipeline.SuspendFunctionGun.execute$ktor_utils(SuspendFunctionGun.kt:98)
	at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:77)
	at io.ktor.client.call.HttpClientCall.bodyNullable(HttpClientCall.kt:89)
	at dev.schlaubi.lavakord.rest.LinkTrackExtensionsKt.loadItem(LinkTrackExtensions.kt:80)
	at dev.schlaubi.lavakord.rest.LinkTrackExtensionsKt$loadItem$2.invokeSuspend(LinkTrackExtensions.kt)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:589)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:806)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:710)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:697)
Caused by: kotlinx.serialization.MissingFieldException: Fields [pluginInfo, userData] are required for type with serial name 'dev.arbjerg.lavalink.protocol.v4.Track', but they were missing at path: $
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:95)
	at kotlinx.serialization.json.Json.decodeFromString(Json.kt:107)
	at io.ktor.serialization.kotlinx.KotlinxSerializationConverter.deserialize(KotlinxSerializationConverter.kt:82)
	... 39 common frames omitted
Caused by: kotlinx.serialization.MissingFieldException: Fields [pluginInfo, userData] are required for type with serial name 'dev.arbjerg.lavalink.protocol.v4.Track', but they were missing
	at kotlinx.serialization.internal.PluginExceptionsKt.throwMissingFieldException(PluginExceptions.kt:20)
	at dev.arbjerg.lavalink.protocol.v4.Track.<init>(player.kt:30)
	at dev.arbjerg.lavalink.protocol.v4.Track$$serializer.deserialize(player.kt:30)
	at dev.arbjerg.lavalink.protocol.v4.Track$$serializer.deserialize(player.kt:30)
	at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:61)
	at kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.decodeSerializableValue(TreeJsonDecoder.kt:52)
	at kotlinx.serialization.internal.TaggedDecoder.decodeSerializableValue(Tagged.kt:207)
	at kotlinx.serialization.internal.TaggedDecoder$decodeSerializableElement$1.invoke(Tagged.kt:279)
	at kotlinx.serialization.internal.TaggedDecoder.tagBlock(Tagged.kt:294)
	at kotlinx.serialization.internal.TaggedDecoder.decodeSerializableElement(Tagged.kt:279)
	at dev.arbjerg.lavalink.protocol.v4.LoadResult$TrackLoaded$$serializer.deserialize(loadResult.kt:29)
	at dev.arbjerg.lavalink.protocol.v4.LoadResult$TrackLoaded$$serializer.deserialize(loadResult.kt:29)
	at dev.arbjerg.lavalink.protocol.v4.LoadResult$Serializer$selectDeserializer$$inlined$asPolymorphicDeserializer$1.deserialize(PolymorphicSerializer.kt:26)
	at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:61)
	at kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.decodeSerializableValue(TreeJsonDecoder.kt:52)
	at kotlinx.serialization.json.internal.TreeJsonDecoderKt.readJson(TreeJsonDecoder.kt:25)
	at kotlinx.serialization.json.Json.decodeFromJsonElement(Json.kt:127)
	at kotlinx.serialization.json.JsonContentPolymorphicSerializer.deserialize(JsonContentPolymorphicSerializer.kt:94)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:69)
	... 41 common frames omitted
2024-01-19 18:47:33.166 [DefaultDispatcher-worker-5] DEBUG d.s.lavakord.audio.internal.NodeImpl - RESPONSE: 200 OK

It looks like you're using lavalink v3 which is not supported by this client, please upgrade to Lavalink v4

It looks like you're using lavalink v3 which is not supported by this client, please upgrade to Lavalink v4

https://github.com/lavalink-devs/Lavalink/actions/runs/7486747422

What happens if you update lavalink to the latest version?

It DEV lavalink V4 version with updated lavaplayerV2.1.0

If use latest master lavalink it works fine