Closed MR-XieXuan closed 1 year ago
有时甚至会出现图片混乱的问题, 原图: 实际发送效果: Bot上一条发送的图片为 在这里出现了发送图片携带上一条消息图片元素的问题。
@ryoii
mirai-api-http 的问题为什么不汇报到 https://github.com/project-mirai/mirai-api-http
mirai-api-http 的问题为什么不汇报到 https://github.com/project-mirai/mirai-api-http
因为我没有判断出这个是 mirai-api-http 的问题还是 mirai 的问题 :kissing:
看不出哪里有问题,你自己的代码是怎么写的,是不是重复把内容输出到同一个文件了
看不出哪里有问题,你自己的代码是怎么写的,是不是重复把内容输出到同一个文件了
我查了本地文件,本地文件是正常的。只有发送出去后出现了异常。
看不出哪里有问题,你自己的代码是怎么写的,是不是重复把内容输出到同一个文件了
是否需要获取其他地方的日志以进一步定位问题出现按的原因。
是不是重复把内容输出到同一个文件了
并没有
我查了s'yo所有的文件,都没有出错
mah 通过传入的 path 调用 File.uploadAsImage. core 判断一下是不是上传的时候内部 buffer 了什么东西
为什么会出现header都没读取到的情况呢?你是没等图片输出完毕再执行发送的吗?还是你的系统有高并发的错误呢
为什么会出现header都没读取到的情况呢?你是没等图片输出完毕再执行发送的吗?还是你的系统有高并发的错误呢
图片是输出完了才发送的。 操作系统是 Alma 8.5 (Arctic Sphynx) x86_64 。
我还是认为是你的系统 / 架构有问题,不然这没法解释为什么会出现读取不到 header (数据内容) 的错误
我还是认为是你的系统 / 架构有问题,不然这没法解释为什么会出现读取不到 header (数据内容) 的错误
我觉得是它异步写入没有堵塞等待的原因
我还是认为是你的系统 / 架构有问题,不然这没法解释为什么会出现读取不到 header (数据内容) 的错误
确实,这也让我很迷茫
问题描述
上传图片出现图片不完整 发送图片效果: 原图:
复现
网络质量差 高负载 使用mirai-api-http使用sendGroupMessage发送消息时附带本地图片
mirai-core 版本
2.14.0
bot-protocol
ANDROID_WATCH
其他组件版本
mirai-api-http
系统日志
No response
网络日志
补充信息
[91m2023-02-28 14:04:43 E/MAH Access: java.lang.IllegalArgumentException: Unsupported image type (mirai) for ExternalResource net.mamoe.mirai.internal.utils.ExternalResourceImplByFile@540f60ad, considering use gif/png/bmp/jpg format. image header: [m java.lang.IllegalArgumentException: Unsupported image type (mirai) for ExternalResource net.mamoe.mirai.internal.utils.ExternalResourceImplByFile@540f60ad, considering use gif/png/bmp/jpg format. image header: [m at net.mamoe.mirai.internal.message.image.ImageDecoderKt.calculateImageInfo(ImageDecoder.kt:159)[m at net.mamoe.mirai.internal.contact.CommonGroupImpl$uploadImage$lambda-16$$inlined$runBIO$1.invoke(CoroutineUtils.kt:23)[m at kotlinx.coroutines.InterruptibleKt.runInterruptibleInExpectedContext(Interruptible.kt:51)[m at kotlinx.coroutines.InterruptibleKt.access$runInterruptibleInExpectedContext(Interruptible.kt:1)[m at kotlinx.coroutines.InterruptibleKt$runInterruptible$2.invokeSuspend(Interruptible.kt:43)[m at kotlinx.coroutines.InterruptibleKt$runInterruptible$2.invoke(Interruptible.kt)[m at kotlinx.coroutines.InterruptibleKt$runInterruptible$2.invoke(Interruptible.kt)[m at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)[m at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:169)[m at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)[m at kotlinx.coroutines.InterruptibleKt.runInterruptible(Interruptible.kt:42)[m at net.mamoe.mirai.internal.contact.CommonGroupImpl.uploadImage$suspendImpl(GroupImpl.kt:454)[m at net.mamoe.mirai.internal.contact.CommonGroupImpl.uploadImage(GroupImpl.kt)[m at net.mamoe.mirai.utils.ExternalResource$Companion.uploadAsImage(ExternalResource.kt:434)[m at mirai-api-http-2.8.0.mirai2.jar//net.mamoe.mirai.api.http.adapter.internal.convertor.ConvertorKt.imageLikeToMessage(convertor.kt:125)[m at mirai-api-http-2.8.0.mirai2.jar//net.mamoe.mirai.api.http.adapter.internal.convertor.ConvertorKt.toMessage(convertor.kt:74)[m at mirai-api-http-2.8.0.mirai2.jar//net.mamoe.mirai.api.http.adapter.internal.convertor.ConvertorKt.toMessageChain(convertor.kt:57)[m at mirai-api-http-2.8.0.mirai2.jar//net.mamoe.mirai.api.http.adapter.internal.action.MessageKt.onSendGroupMessage(message.kt:126)[m at mirai-api-http-2.8.0.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.router.MessageKt$messageRouter$1$invoke$$inlined$respondDTOStrategy$3.invokeSuspend(dsl.kt:198)[m at mirai-api-http-2.8.0.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.router.MessageKt$messageRouter$1$invoke$$inlined$respondDTOStrategy$3.invoke(dsl.kt)[m at mirai-api-http-2.8.0.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.router.MessageKt$messageRouter$1$invoke$$inlined$respondDTOStrategy$3.invoke(dsl.kt)[m at mirai-api-http-2.8.0.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.router.MessageKt$messageRouter$1$invoke$$inlined$httpAuthedPost$2$1.invokeSuspend(dsl.kt:207)[m at mirai-api-http-2.8.0.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.router.MessageKt$messageRouter$1$invoke$$inlined$httpAuthedPost$2$1.invoke(dsl.kt)[m at mirai-api-http-2.8.0.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.router.MessageKt$messageRouter$1$invoke$$inlined$httpAuthedPost$2$1.invoke(dsl.kt)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.routing.Route$buildPipeline$1$1.invokeSuspend(Route.kt:116)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.routing.Route$buildPipeline$1$1.invoke(Route.kt)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.routing.Route$buildPipeline$1$1.invoke(Route.kt)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:123)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:81)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.execute$ktor_utils(SuspendFunctionGun.kt:101)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:77)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.routing.Routing$executeResult$$inlined$execute$1.invokeSuspend(Pipeline.kt:478)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.routing.Routing$executeResult$$inlined$execute$1.invoke(Pipeline.kt)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.routing.Routing$executeResult$$inlined$execute$1.invoke(Pipeline.kt)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.util.debug.ContextUtilsKt.initContextInDebugMode(ContextUtils.kt:17)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.routing.Routing.executeResult(Routing.kt:174)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.routing.Routing.interceptor(Routing.kt:49)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.routing.Routing$Plugin$install$1.invokeSuspend(Routing.kt:124)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.routing.Routing$Plugin$install$1.invoke(Routing.kt)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.routing.Routing$Plugin$install$1.invoke(Routing.kt)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:123)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:81)[m at mirai-api-http-2.8.0.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.auth.Authorization$install$1.invokeSuspend(Authorization.kt:41)[m at mirai-api-http-2.8.0.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.auth.Authorization$install$1.invoke(Authorization.kt)[m at mirai-api-http-2.8.0.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.auth.Authorization$install$1.invoke(Authorization.kt)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:123)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:81)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.engine.BaseApplicationEngineKt$installDefaultTransformationChecker$1.invokeSuspend(BaseApplicationEngine.kt:122)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.engine.BaseApplicationEngineKt$installDefaultTransformationChecker$1.invoke(BaseApplicationEngine.kt)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.engine.BaseApplicationEngineKt$installDefaultTransformationChecker$1.invoke(BaseApplicationEngine.kt)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:123)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:81)[m at mirai-api-http-2.8.0.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.handler.HttpRouterAccessHandler.intercept(HttpRouterAccessHandler.kt:35)[m at mirai-api-http-2.8.0.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.handler.HttpRouterAccessHandler.access$intercept(HttpRouterAccessHandler.kt:24)[m at mirai-api-http-2.8.0.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.handler.HttpRouterAccessHandler$Feature$install$1.invokeSuspend(HttpRouterAccessHandler.kt:90)[m at mirai-api-http-2.8.0.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.handler.HttpRouterAccessHandler$Feature$install$1.invoke(HttpRouterAccessHandler.kt)[m at mirai-api-http-2.8.0.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.handler.HttpRouterAccessHandler$Feature$install$1.invoke(HttpRouterAccessHandler.kt)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:123)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:81)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.execute$ktor_utils(SuspendFunctionGun.kt:101)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:77)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$1$invokeSuspend$$inlined$execute$1.invokeSuspend(Pipeline.kt:478)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$1$invokeSuspend$$inlined$execute$1.invoke(Pipeline.kt)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$1$invokeSuspend$$inlined$execute$1.invoke(Pipeline.kt)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.util.debug.ContextUtilsKt.initContextInDebugMode(ContextUtils.kt:17)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$1.invokeSuspend(DefaultEnginePipeline.kt:118)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$1.invoke(DefaultEnginePipeline.kt)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$1.invoke(DefaultEnginePipeline.kt)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:123)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:81)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.execute$ktor_utils(SuspendFunctionGun.kt:101)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:77)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.cio.CIOApplicationEngine$handleRequest$2$invokeSuspend$$inlined$execute$1.invokeSuspend(Pipeline.kt:478)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.cio.CIOApplicationEngine$handleRequest$2$invokeSuspend$$inlined$execute$1.invoke(Pipeline.kt)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.cio.CIOApplicationEngine$handleRequest$2$invokeSuspend$$inlined$execute$1.invoke(Pipeline.kt)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.util.debug.ContextUtilsKt.initContextInDebugMode(ContextUtils.kt:17)[m at mirai-api-http-2.8.0.mirai2.jar[shared]//io.ktor.server.cio.CIOApplicationEngine$handleRequest$2.invokeSuspend(CIOApplicationEngine.kt:189)[m at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)[m at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)[m at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)[m at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)[m at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)[m at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)[m at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)[m at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)[m [0m[m