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

Java API无法发图:timeout receiving response of ImgStore.GroupPicUp #175

Closed
iceBear67 opened this issue Mar 30, 2020 · 11 comments
Closed
Assignees
Labels
M 优先级: 主要 t:bug 类型: bug
Milestone

Comments

@iceBear67
Copy link
Contributor

iceBear67 commented Mar 30, 2020

问题

无法使用Java API发送图片.

00:21:12 [INFO] [ConsoleAddition] [BOT -] Received: GroupMessage(group=, senderName=, sender=-, permission=MEMBER, message=来点吃的)
 00:21:12 [INFO] [VexMirai] Sending: https://ali.xinshipu.cn/20180127_63/original/1517036352096.jpg
 00:21:15 [INFO] [ConsoleAddition] [NETWORK] Send done: ImgStore.GroupPicUp
 00:21:18 [INFO] [ConsoleAddition] [NETWORK] Exception in NetworkHandler
 00:21:18 [INFO] [ConsoleAddition] [NETWORK ERROR] net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler$TimeoutException: timeout receiving response of ImgStore.GroupPicUp
net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler$TimeoutException: timeout receiving response of ImgStore.GroupPicUp
        at net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler$sendAndExpect$6.invokeSuspend(QQAndroidBotNetworkHandler.kt:602)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:32)
        at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:113)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:55)
        at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:272)
        at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:79)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:54)
        at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:36)
        at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
        at net.mamoe.mirai.contact.ContactJavaFriendlyAPI.uploadImage(ContactJavaFriendlyAPI.kt:350)
        at com.github.icebear67.MessageHandler.onMessage(MessageHandler.java:37)
        at net.mamoe.mirai.event.internal.EventInternalJvmKt$_subscribeEventForJaptOnly$2.invokeSuspend(EventInternalJvm.kt:40)
        at net.mamoe.mirai.event.internal.EventInternalJvmKt$_subscribeEventForJaptOnly$2.invoke(EventInternalJvm.kt)
        at net.mamoe.mirai.event.internal.Handler$onEvent$2.invokeSuspend(InternalEventListeners.kt:76)
        at net.mamoe.mirai.event.internal.Handler$onEvent$2.invoke(InternalEventListeners.kt)
        at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:91)
        at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:154)
        at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
        at net.mamoe.mirai.event.internal.Handler.onEvent(InternalEventListeners.kt:76)
        at net.mamoe.mirai.event.internal.InternalEventListenersKt$callAndRemoveIfRequired$$inlined$forEachNode$lambda$1.invokeSuspend(InternalEventListeners.kt:169)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
 00:21:18 [INFO] [ConsoleAddition] [NETWORK] Received: FileExists(fileId=2849941547, fileInfo=ImgInfo(fileMd5=[74, 116, -43, -99, -65, -11, -101, 57, -115, 1, -100, -82, -119, 37, -118, -10], fileType=1000, fileSize=103679, fileWidth=1581, fileHeight=877))
 00:21:18 [INFO] [ConsoleAddition] [BOT -] Received: GroupMessage(group=, senderName=油盐盐, sender=2549279658, permission=MEMBER, message=无 趣)
 00:21:18 [INFO] [ConsoleAddition] [NETWORK] unknown shtype 528
 00:21:18 [INFO] [ConsoleAddition] [NETWORK] Received: MultiPacketBySequence
 00:21:18 [INFO] [ConsoleAddition] [NETWORK] Send: OnlinePush.RespPush
 00:21:22 [INFO] [ConsoleAddition] [BOT 3325273573] Received: GroupMessage(group=, senderName=梅友鸽, sender=, permission=MEMBER, message=ze)

如何复现

message.getGroup().sendMessage(message.getGroup().uploadImage(vex.getFoodImg()));
getFoodImg返回正确的URL对象
message: GroupMessage

@iceBear67 iceBear67 added the t:bug 类型: bug label Mar 30, 2020
@Him188
Copy link
Member

Him188 commented Mar 30, 2020

能否提供当时发送的原图?

@iceBear67
Copy link
Contributor Author

00:21:12 [INFO] [VexMirai] Sending: https://ali.xinshipu.cn/20180127_63/original/1517036352096.jpg

@Him188 Him188 self-assigned this Mar 30, 2020
@Him188 Him188 added the M 优先级: 主要 label Mar 30, 2020
@Him188
Copy link
Member

Him188 commented Mar 30, 2020

可能只是丢包或服务器异常,在下一般本将会允许重试

@Him188 Him188 added this to the mirai-core 1.0.0 milestone Mar 30, 2020
@LasmGratel
Copy link

看了一眼你们的代码,timeout 是 1s,这谁能上传的了啊

@Him188
Copy link
Member

Him188 commented Apr 7, 2020

看了一眼你们的代码,timeout 是 1s,这谁能上传的了啊

?
image

@undefined-moe
Copy link

10k一秒有问题吗...

@LasmGratel
Copy link

LasmGratel commented Apr 7, 2020 via email

@Him188
Copy link
Member

Him188 commented Apr 7, 2020

目前没有任何反馈说这个超时存在问题. 当前这个 issue 原因是查询图片是否存在的包超时(更大可能是内容错误), 而不是上传图片

@Him188
Copy link
Member

Him188 commented Apr 7, 2020

这个超时是总时间, 而不是每个分块的时间. 300kb的图都会有 30s 超时时间. 经考虑将限制超时至少为5秒

@LasmGratel
Copy link

LasmGratel commented Apr 7, 2020 via email

@Him188
Copy link
Member

Him188 commented Apr 9, 2020

增加了超时和重试

@Him188 Him188 closed this as completed Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M 优先级: 主要 t:bug 类型: bug
Projects
None yet
Development

No branches or pull requests

4 participants