Giter Site home page Giter Site logo

Comments (12)

WitherVictor avatar WitherVictor commented on June 11, 2024

我这边也差不多一样, mirai-core 2.16.0,协议用的 ANDROID_PHONE 8.9.90,但是在主机下挂同一个账号的 QQNT 就能一直挂住,挺神奇的

from mirai.

kkgg0521 avatar kkgg0521 commented on June 11, 2024

有解决办法了么 搞得我很头疼

from mirai.

kkgg0521 avatar kkgg0521 commented on June 11, 2024

我这边也差不多一样, mirai-core 2.16.0,协议用的 ANDROID_PHONE 8.9.90,但是在主机下挂同一个账号的 QQNT 就能一直挂住,挺神奇的

可以想办法 解决么

from mirai.

kkgg0521 avatar kkgg0521 commented on June 11, 2024

急求急求

from mirai.

kkgg0521 avatar kkgg0521 commented on June 11, 2024

问题描述

二维码登录后不到1分钟,报错Timeout waiting for ConfigPush.然后退出登录!

复现

日志如下 2023-12-20 11:38:03 I/Net 1342081703: Successfully loaded group list: 71 in total. 2023-12-20 11:38:03 I/Net 1342081703: Scheduled refresh login session in 19d 23h 55min 0.0s. 2023-12-20 11:38:03 I/Net 1342081703: Scheduled key refresh in 23h 55min 0.0s. 2023-12-20 11:38:03 V/Bot 1342081703: Event: BotOnlineEvent(bot=Bot(1342081703)) 2023-12-20 11:38:03 I/Bot 1342081703: Bot login successful. 2023-12-20 11:38:04 I/Net 1342081703: Syncing friend message history: Success. 2023-12-20 11:39:03 W/Net 1342081703: Missing ConfigPush. Switching server... 2023-12-20 11:39:03 V/Bot 1342081703: Event: BotOfflineEvent.RequireReconnect(bot=Bot(1342081703), cause=java.lang.IllegalStateException: Timeout waiting for ConfigPush., reconnect=true) 2023-12-20 11:39:03 W/Bot 1342081703: Connection lost, reconnecting... (java.lang.IllegalStateException: Timeout waiting for ConfigPush.) 2023-12-20 11:39:03 V/Bot 1342081703: Event: BotOfflineEvent.Active(bot=Bot(1342081703), cause=java.lang.IllegalStateException: Timeout waiting for ConfigPush., reconnect=false) 2023-12-20 11:39:03 I/Bot 1342081703: Bot is closed manually with exception: java.lang.IllegalStateException: Timeout waiting for ConfigPush. java.lang.IllegalStateException: Timeout waiting for ConfigPush. at net.mamoe.mirai.internal.network.components.ConfigPushProcessorImpl.syncConfigPush(ConfigPushProcessor.kt:45) at net.mamoe.mirai.internal.network.components.ConfigPushProcessorImpl$syncConfigPush$1.invokeSuspend(ConfigPushProcessor.kt) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:33) at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:33) at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

mirai-core 版本

2.16.0

bot-protocol

ANDROID_WATCH

其他组件版本

No response

系统日志

No response

网络日志

No response

补充信息

No response

大佬有方案了么

from mirai.

cjalchange avatar cjalchange commented on June 11, 2024

我这也碰到了, mirai-core 2.16.0,协议是 ANDROID_PAD 8.9.83,而且出现的概率还挺高的。

from mirai.

zhaodice avatar zhaodice commented on June 11, 2024

我提交了个补丁也许可以修复

from mirai.

kkgg0521 avatar kkgg0521 commented on June 11, 2024

我提交了个补丁也许可以修复

在哪里可能看到你的补丁

from mirai.

OOO-li-ooo avatar OOO-li-ooo commented on June 11, 2024

我提交了个补丁也许可以修复

可能会导致不停反复登陆

from mirai.

zhaodice avatar zhaodice commented on June 11, 2024

我提交了个补丁也许可以修复

可能会导致不停反复登陆

所以自己改吧!我把timeout改成了小时级

from mirai.

rrrxxxvvv avatar rrrxxxvvv commented on June 11, 2024

我提交了个补丁也许可以修复

可能会导致不停反复登陆

所以自己改吧!我把timeout改成了小时级

请问timeout在哪里设置呢?在mirai-core的开发中

from mirai.

zhaodice avatar zhaodice commented on June 11, 2024

我提交了个补丁也许可以修复

可能会导致不停反复登陆

所以自己改吧!我把timeout改成了小时级

请问timeout在哪里设置呢?在mirai-core的开发中

/*
 * Copyright 2019-2022 Mamoe Technologies and contributors.
 *
 * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
 * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
 *
 * https://github.com/mamoe/mirai/blob/dev/LICENSE
 */

package net.mamoe.mirai.internal.network.components

import kotlinx.coroutines.withTimeoutOrNull
import net.mamoe.mirai.event.EventPriority
import net.mamoe.mirai.event.events.BotOfflineEvent
import net.mamoe.mirai.event.globalEventChannel
import net.mamoe.mirai.event.nextEvent
import net.mamoe.mirai.internal.network.component.ComponentKey
import net.mamoe.mirai.internal.network.handler.NetworkHandler
import net.mamoe.mirai.internal.network.handler.selector.NetworkException
import net.mamoe.mirai.internal.network.protocol.packet.login.ConfigPushSvc
import net.mamoe.mirai.utils.MiraiLogger
import net.mamoe.mirai.utils.warning

/**
 * Job: Switch server if ConfigPush not received.
 */
internal interface ConfigPushProcessor {
    suspend fun syncConfigPush(network: NetworkHandler)

    companion object : ComponentKey<ConfigPushProcessor>
}

internal class ConfigPushProcessorImpl(
    private val logger: MiraiLogger,
) : ConfigPushProcessor {
    override suspend fun syncConfigPush(network: NetworkHandler) {
        val resp = withTimeoutOrNull(60_000 * 30) {
            globalEventChannel().nextEvent<ConfigPushSvc.PushReq.PushReqResponse>(
                EventPriority.MONITOR
            ) { it.bot == network.context.bot }
        }

        if (resp == null) {
            val bdhSyncer = network.context[BdhSessionSyncer]
            if (!bdhSyncer.hasSession) {
                //val e = IllegalStateException("Timeout waiting for ConfigPush.")
                /*
                val e = NetworkException("Timeout waiting for ConfigPush.",true)
                bdhSyncer.bdhSession.completeExceptionally(e)
                logger.warning { "Missing ConfigPush. Switching server..." }
                network.context[SsoProcessor].casFirstLoginResult(null, FirstLoginResult.CHANGE_SERVER)
                network.context.bot.components[EventDispatcher].broadcastAsync(
                    BotOfflineEvent.RequireReconnect(
                        network.context.bot,
                        e
                    )
                )*/
                logger.warning { "Missing ConfigPush. 丢失BDH通道,可能无法正常上传媒体数据,重启可能会解决问题" }
            }
        }
    }

}

from mirai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.