limbang / mirai-console-mcmod-plugin

基于 Mirai Console 编写的MC百科搜索插件
GNU Affero General Public License v3.0
39 stars 3 forks source link

Bug: 搜索特定mod时报错 #18

Closed sxjeru closed 2 years ago

sxjeru commented 2 years ago

以“模组”类型搜索“龙之生存”时,无回复,后台报错:

2022-01-29 10:46:10 E/top.limbang.mirai-console-mcmod-plugin: Exception in coroutine Plugin top.limbang.mirai-console-mcmod-plugin of top.limbang.mirai-console-mcmod-plugin
java.lang.IllegalArgumentException: Unsupported image type (mirai) for ExternalResource net.mamoe.mirai.internal.utils.ExternalResourceImplByByteArray@65b55785, considering use gif/png/bmp/jpg format. image header: 3C 21 44 4F 43 54 59 50 45 20 68 74 6D 6C 3E 0A 3C 68 74 6D 6C 20 6C 61 6E 67 3D 22 7A 68
        at net.mamoe.mirai.internal.message.ImageDecoderKt.calculateImageInfo(ImageDecoder.kt:160)
        at net.mamoe.mirai.internal.contact.GroupImpl$uploadImage$lambda-19$$inlined$runBIO$1.invoke(CoroutineUtils.kt:164)
        at kotlinx.coroutines.InterruptibleKt.runInterruptibleInExpectedContext(Interruptible.kt:46)
        at kotlinx.coroutines.InterruptibleKt.access$runInterruptibleInExpectedContext(Interruptible.kt:1)
        at kotlinx.coroutines.InterruptibleKt$runInterruptible$2.invokeSuspend(Interruptible.kt:38)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

以其他方式搜得“龙之生存”mod,输序号后依旧报错,如上。

jie65535 commented 2 years ago

该问题与 #17 应该是相同的问题。 那段时间mcmod的图库貌似出现问题,获取图片会返回一个跳转页面。 现在应该好了。

sxjeru commented 2 years ago

不太对劲…… 刚刚试了下还是相同报错。 云服务器端试过直接访问百科,图片都是能正常显示的。

jie65535 commented 2 years ago

log里面的3C 21 44 4F 43 54 59 50 45 20 68 74 6D 6C 3E 0A 3C 68 74 6D 6C 20 6C 61 6E 67 3D 22 7A 68<!DOCTYPE html><html lang="zh,其实就是那个跳转到图片的html页面,跟上个issue是同一个问题。 为什么会出现跳转页面,那就是另一个问题了。暂时我还没什么好的解决办法。

502milk commented 2 years ago

不太对劲…… 刚刚试了下还是相同报错。 云服务器端试过直接访问百科,图片都是能正常显示的。

你把data/top.limbang.mirai-console-mcmod-plugin/image下的图片都删了再搜一次试试

sxjeru commented 2 years ago

@502milk 方法可行,感谢!

确实是由于图片没加载完,导致头文件错误发不出来。 image

或许可以加个自动删除此类已损坏图片。