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

mirai-core1.0.1 在某些情况下,Bot登录的时候无限重连 #361

Closed
Donge-ying opened this issue Jun 1, 2020 · 0 comments
Closed
Labels
M 优先级: 主要 t:bug 类型: bug
Milestone

Comments

@Donge-ying
Copy link

一直重连,直到出现NoServerAvailableException还一直重连,已经设置了最大重连次数、而且捕获了登录错误并指定killbot。

已经出现了至少5次,每次日志文件都爆了,不得不手动重启,每天没事都要检查一次,就怕出现这个问题。

2020-06-01 00:01:04 W/: Init failed. Retrying in 3s...
2020-06-01 00:01:04 W/: Init failed. Retrying in 3s...
2020-06-01 00:01:04 W/: Init failed. Retrying in 3s...
2020-06-01 00:01:04 W/: Init failed. Retrying in 3s...
2020-06-01 00:01:04 E/: Cannot init. some features may be affected
kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 5000 ms
	at kotlinx.coroutines.TimeoutKt.TimeoutCancellationException(Timeout.kt:158)
	at kotlinx.coroutines.TimeoutCoroutine.run(Timeout.kt:128)
	at kotlinx.coroutines.EventLoopImplBase$DelayedRunnableTask.run(EventLoop.common.kt:497)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
	at kotlinx.coroutines.DefaultExecutor.run(DefaultExecutor.kt:68)
	at java.lang.Thread.run(Thread.java:748)
2020-06-01 00:01:04 I/: Bot cancelled
2020-06-01 00:01:04 I/: Connection dropped by server or lost, retrying login
2020-06-01 00:01:04 W/: java.net.UnknownHostException: msfwifi.3g.qq.com
java.net.UnknownHostException: msfwifi.3g.qq.com
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:606)
	at java.net.Socket.connect(Socket.java:555)
	at java.net.Socket.<init>(Socket.java:451)
	at java.net.Socket.<init>(Socket.java:228)
	at net.mamoe.mirai.qqandroid.utils.PlatformSocket$connect$3.invokeSuspend(PlatformSocket.kt:86)
	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)

2020-06-01 00:01:04 W/: kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 5000 ms
kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 5000 ms
	at kotlinx.coroutines.TimeoutKt.TimeoutCancellationException(Timeout.kt:158)
	at kotlinx.coroutines.TimeoutCoroutine.run(Timeout.kt:128)
	at kotlinx.coroutines.EventLoopImplBase$DelayedRunnableTask.run(EventLoop.common.kt:497)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
	at kotlinx.coroutines.DefaultExecutor.run(DefaultExecutor.kt:68)
	at java.lang.Thread.run(Thread.java:748)

2020-06-01 00:01:04 W/: kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 5000 ms
kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 5000 ms
	at kotlinx.coroutines.TimeoutKt.TimeoutCancellationException(Timeout.kt:158)
	at kotlinx.coroutines.TimeoutCoroutine.run(Timeout.kt:128)
	at kotlinx.coroutines.EventLoopImplBase$DelayedRunnableTask.run(EventLoop.common.kt:497)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
	at kotlinx.coroutines.DefaultExecutor.run(DefaultExecutor.kt:68)
	at java.lang.Thread.run(Thread.java:748)

2020-06-01 00:01:04 W/: kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 5000 ms
kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 5000 ms
	at kotlinx.coroutines.TimeoutKt.TimeoutCancellationException(Timeout.kt:158)
	at kotlinx.coroutines.TimeoutCoroutine.run(Timeout.kt:128)
	at kotlinx.coroutines.EventLoopImplBase$DelayedRunnableTask.run(EventLoop.common.kt:497)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
	at kotlinx.coroutines.DefaultExecutor.run(DefaultExecutor.kt:68)
	at java.lang.Thread.run(Thread.java:748)

2020-06-01 00:01:04 I/: Reconnected successfully in 1min 44.551s
2020-06-01 00:01:04 V/: Event: MessageSvcPbGetMsg.Response(syncFlagFromServer=CONTINUE, messages=<Iterable>))
2020-06-01 00:01:04 V/: Event: MemberJoinEvent.Active(member=3392715453)
2020-06-01 00:01:04 V/: Event: MemberJoinEvent.Active(member=848868123)
2020-06-01 00:01:04 V/: Event: MemberJoinEvent.Active(member=980993750)
2020-06-01 00:01:04 V/: Event: MemberJoinEvent.Active(member=3249045440)
2020-06-01 00:01:04 V/: Event: MemberJoinEvent.Active(member=645055266)
2020-06-01 00:01:04 V/: Event: MemberJoinEvent.Active(member=1844306809)
2020-06-01 00:01:04 V/: Event: MessageSvcPbGetMsg.Response(syncFlagFromServer=CONTINUE, messages=<Iterable>))
2020-06-01 00:01:04 I/: Connection dropped by server or lost, retrying login
2020-06-01 00:01:04 I/: Reconnected successfully in 6.097s
2020-06-01 00:01:04 V/: Event: MessageSvcPbGetMsg.Response(syncFlagFromServer=CONTINUE, messages=<Iterable>))
2020-06-01 00:01:04 V/: Event: MessageSvcPbGetMsg.Response(syncFlagFromServer=CONTINUE, messages=<Iterable>))
2020-06-01 00:01:04 V/: Event: MemberJoinEvent.Active(member=249097886)
2020-06-01 00:01:04 V/: Event: MemberJoinEvent.Active(member=1136205550)
2020-06-01 00:01:04 V/: Event: MessageSvcPbGetMsg.Response(syncFlagFromServer=CONTINUE, messages=<Iterable>))
2020-06-01 00:01:04 V/: Event: MessageSvcPbGetMsg.Response(syncFlagFromServer=CONTINUE, messages=<Iterable>))
2020-06-01 00:01:04 I/: Connection dropped by server or lost, retrying login
2020-06-01 00:01:04 W/: net.mamoe.mirai.network.WrongPasswordException: Error(title=帐号暂时无法登录, message=该帐号存在被盗风险,已被安全系统冻结保护,请选择“解除保护”完成改密操作,即可继续放心使用。, errorInfo=
at net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler.closeEverythingAndRelogin(QQAndroidBotNetworkHandler.kt:178)
	at net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler$closeEverythingAndRelogin$1.invokeSuspend(QQAndroidBotNetworkHandler.kt)
	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: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)

2020-06-01 00:01:04 I/: Cannot reconnect
2020-06-01 00:01:04 E/: An exception was thrown under a coroutine of Bot
net.mamoe.mirai.network.WrongPasswordException: Error(title=帐号暂时无法登录, message=该帐号存在被盗风险,已被安全系统冻结保护,请选择“解除保护”完成改密操作,即可继续放心使用。, errorInfo=
	at net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler.closeEverythingAndRelogin(QQAndroidBotNetworkHandler.kt:178)
	at net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler$closeEverythingAndRelogin$1.invokeSuspend(QQAndroidBotNetworkHandler.kt)
	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: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)

------------->重复很多次后------------------>

2020-06-01 00:01:04 I/: Connection dropped by server or lost, retrying login
2020-06-01 00:01:04 I/: Cannot reconnect
2020-06-01 00:01:04 W/: net.mamoe.mirai.network.NoServerAvailableException: no server available
net.mamoe.mirai.network.NoServerAvailableException: no server available
	at net.mamoe.mirai.qqandroid.QQAndroidBotBase.relogin$suspendImpl(QQAndroidBot.common.kt:913)
	at net.mamoe.mirai.qqandroid.QQAndroidBotBase.relogin(QQAndroidBot.common.kt)
	at net.mamoe.mirai.qqandroid.BotImpl$offlineListener$1$invokeSuspend$$inlined$measureTime$lambda$1.invokeSuspend(BotImpl.kt:96)
	at net.mamoe.mirai.qqandroid.BotImpl$offlineListener$1$invokeSuspend$$inlined$measureTime$lambda$1.invoke(BotImpl.kt)
	at net.mamoe.mirai.qqandroid.BotImpl$offlineListener$1.invokeSuspend(BotImpl.kt:113)
	at net.mamoe.mirai.qqandroid.BotImpl$offlineListener$1.invoke(BotImpl.kt)
	at net.mamoe.mirai.event.SubscriberKt__SubscriberKt$subscribeAlways$1.invokeSuspend(subscriber.kt:269)
	at net.mamoe.mirai.event.SubscriberKt__SubscriberKt$subscribeAlways$1.invoke(subscriber.kt)
	at net.mamoe.mirai.event.internal.Handler$onEvent$2.invokeSuspend(InternalEventListeners.kt:89)
	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:160)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
	at net.mamoe.mirai.event.internal.Handler.onEvent(InternalEventListeners.kt:89)
	at net.mamoe.mirai.event.EventKt.broadcast(Event.kt:255)
	at net.mamoe.mirai.event.EventKt$broadcast$1.invokeSuspend(Event.kt)
	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)

2020-06-01 00:01:04 I/: Retrying in 3s...
2020-06-01 00:01:04 I/: Cannot reconnect
2020-06-01 00:01:04 W/: net.mamoe.mirai.network.NoServerAvailableException: no server available
net.mamoe.mirai.network.NoServerAvailableException: no server available

------------------------------>一直出现这个错误,永无止境	

如何复现

这是小概率问题,我也不知道原因

版本

mirai: 1.0.1

@Donge-ying Donge-ying added the t:bug 类型: bug label Jun 1, 2020
@Him188 Him188 added the M 优先级: 主要 label Jun 1, 2020
@Him188 Him188 added this to the 1.1.0 milestone Jun 1, 2020
@Him188 Him188 closed this as completed in 2e8df63 Jun 1, 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

2 participants