mamoe / mirai

高效率 QQ 机器人支持库
https://mirai.mamoe.net
GNU Affero General Public License v3.0
14.37k stars 2.53k forks source link

CIRCULAR REFERENCE: java.io.EOFException: Premature end of stream: expected 1 bytes #2689

Open ghost opened 1 year ago

ghost commented 1 year ago

问题描述

我用的号是可以MACOS扫码登陆的。扫码登录成功后,我又用MACOS密码登录,经过滑块验证码验证,又被要求手机短信验证,手机短信验证码输入后就遇到了下面的错误。

复现

  1. 使用一个可以扫码登陆上MACOS的账号,扫码登录。
  2. 退出mcl,然后使用密码登录。此时会首先出现滑块验证码验证,输入ticket后,又让手机短信验证,输入短信验证码后就会报错。

mirai-core 版本

2.15.0-dev-98

bot-protocol

MACOS

其他组件版本

No response

系统日志

2023-06-08 17:47:30 I/main: Starting mirai-console...
2023-06-08 17:47:30 I/main: 

===============================[ Mirai console 2.15.0-dev-98 ]================================
 __       __ __                   __  ______                                      __
|  \     /  \  \                 |  \/      \                                    |  \
| ▓▓\   /  ▓▓\▓▓ ______   ______  \▓▓  ▓▓▓▓▓▓\ ______  _______   _______  ______ | ▓▓ ______
| ▓▓▓\ /  ▓▓▓  \/      \ |      \|  \ ▓▓   \▓▓/      \|       \ /       \/      \| ▓▓/      \
| ▓▓▓▓\  ▓▓▓▓ ▓▓  ▓▓▓▓▓▓\ \▓▓▓▓▓▓\ ▓▓ ▓▓     |  ▓▓▓▓▓▓\ ▓▓▓▓▓▓▓\  ▓▓▓▓▓▓▓  ▓▓▓▓▓▓\ ▓▓  ▓▓▓▓▓▓\
| ▓▓\▓▓ ▓▓ ▓▓ ▓▓ ▓▓   \▓▓/      ▓▓ ▓▓ ▓▓   __| ▓▓  | ▓▓ ▓▓  | ▓▓\▓▓    \| ▓▓  | ▓▓ ▓▓ ▓▓    ▓▓
| ▓▓ \▓▓▓| ▓▓ ▓▓ ▓▓     |  ▓▓▓▓▓▓▓ ▓▓ ▓▓__/  \ ▓▓__/ ▓▓ ▓▓  | ▓▓_\▓▓▓▓▓▓\ ▓▓__/ ▓▓ ▓▓ ▓▓▓▓▓▓▓▓
| ▓▓  \▓ | ▓▓ ▓▓ ▓▓      \▓▓    ▓▓ ▓▓\▓▓    ▓▓\▓▓    ▓▓ ▓▓  | ▓▓       ▓▓\▓▓    ▓▓ ▓▓\▓▓     \
 \▓▓      \▓▓\▓▓\▓▓       \▓▓▓▓▓▓▓\▓▓ \▓▓▓▓▓▓  \▓▓▓▓▓▓ \▓▓   \▓▓\▓▓▓▓▓▓▓  \▓▓▓▓▓▓ \▓▓ \▓▓▓▓▓▓▓

2023-06-08 17:47:30 I/main: Backend: version 2.15.0-dev-98, built on 2023-06-04 07:47:48.
2023-06-08 17:47:30 I/main: Frontend Terminal: version 2.15.0-M1, provided by Mamoe Technologies
2023-06-08 17:47:30 I/main: Welcome to visit https://mirai.mamoe.net/
2023-06-08 17:47:31 I/QRLogin: Plugin version: 0.1.8
2023-06-08 17:47:31 W/QRLogin: 本插件仅在 2.15.0 或以上工作,且在正式版或先行发布版(RC)中可能无法使用
2023-06-08 17:47:31 I/plugin: Successfully loaded plugin QRLogin v0.1.8
2023-06-08 17:47:31 I/plugin: Successfully loaded plugin mirai-api-http v2.9.1
2023-06-08 17:47:31 I/plugin: Successfully loaded plugin MCL Addon v2.1.1
2023-06-08 17:47:32 I/main: Prepared built-in commands: autoLogin, help, login, logout, permission, status, stop
2023-06-08 17:47:32 I/Mirai HTTP API: ********************************************************
2023-06-08 17:47:32 I/MahKtorAdapter[http,ws]: Autoreload is disabled because the development mode is off.
2023-06-08 17:47:32 I/MahKtorAdapter[http,ws]: Application started in 0.198 seconds.
2023-06-08 17:47:32 I/MahKtorAdapter[http,ws]: Responding at http://localhost:18876
2023-06-08 17:47:32 I/http adapter: >>> [http adapter] is listening at http://localhost:18876
2023-06-08 17:47:32 I/ws adapter: >>> [ws adapter] is listening at ws://localhost:18876
2023-06-08 17:47:32 I/Mirai HTTP API: Http api server is running with verifyKey: kv2920h2bjkflj02
2023-06-08 17:47:32 I/Mirai HTTP API: adaptors: [http,ws]
2023-06-08 17:47:32 I/Mirai HTTP API: ********************************************************
2023-06-08 17:47:32 E/MCL Addon: Mirai Console 并未通过 iTXTech Mirai Console Loader 加载。
2023-06-08 17:47:32 E/MCL Addon: 请访问 https://github.com/iTXTech/mirai-console-loader
2023-06-08 17:47:32 I/main: 3 plugin(s) enabled.
2023-06-08 17:47:32 I/main: mirai-console started successfully.
> login 【QQ号】 【密码】 MACOS
2023-06-08 17:47:51 I/Bot.【QQ号】: [SliderCaptcha] 需要滑动验证码, 请按照以下链接的步骤完成滑动验证码, 然后输入获取到的 ticket
2023-06-08 17:47:51 I/Bot.【QQ号】: [SliderCaptcha] Slider captcha required. Please solve the captcha with following link. Type ticket here after completion.
2023-06-08 17:47:51 I/Bot.【QQ号】: [SliderCaptcha] @see https://github.com/project-mirai/mirai-login-solver-selenium
2023-06-08 17:47:51 I/Bot.【QQ号】: [SliderCaptcha] @see https://docs.mirai.mamoe.net/mirai-login-solver-selenium/
2023-06-08 17:47:51 I/Bot.【QQ号】: [SliderCaptcha] 或者输入 helper 来使用 TxCaptchaHelper 完成滑动验证码
2023-06-08 17:47:51 I/Bot.【QQ号】: [SliderCaptcha] Or type helper to resolve slider captcha with TxCaptchaHelper.apk
2023-06-08 17:47:51 W/Bot.【QQ号】: [SliderCaptcha] TxCaptchaHelper 的在线服务疑似被屏蔽,可能无法使用。TxCaptchaHelper 现已无法满足登录QQ机器人,请在以下链接下载全新的验证器
2023-06-08 17:47:51 W/Bot.【QQ号】: [SliderCaptcha] The service of TxCaptchaHelper might be blocked. We recommend you to download the new login solver plugin in below link.
2023-06-08 17:47:51 W/Bot.【QQ号】: [SliderCaptcha] @see https://github.com/KasukuSakura/mirai-login-solver-sakura
2023-06-08 17:47:51 I/Bot.【QQ号】: [SliderCaptcha] Captcha link: https://ssl.captcha.qq.com/template/wireless_mqq_captcha.html?style=simple&aid=16&uin=【QQ号】&sid=8476791076206781382&cap_cd=VG_jI-EIZQbsRirIVpRmMwAFn6HBVrbYlL8bmed-2aOjUhLJ8ot2MQ**&clientype=1&apptype=2
LOGIN> > 【ticket】
2023-06-08 17:48:14 I/Bot.【QQ号】: [SliderCaptcha] 正在提交中...
2023-06-08 17:48:14 I/Bot.【QQ号】: [SliderCaptcha] Submitting...
2023-06-08 17:48:14 I/Bot.【QQ号】: 一条短信验证码将发送到你的手机 【手机号】. 运营商可能会收取正常短信费用, 是否继续? 输入 yes 继续, 输入其他终止并尝试其他验证方式.
2023-06-08 17:48:14 I/Bot.【QQ号】: A verification code will be send to your phone 【手机号】, which may be charged normally, do you wish to continue? Type yes to continue, type others to cancel and try other methods.
LOGIN> > yes
2023-06-08 17:48:57 I/Bot.【QQ号】: Attempting SMS verification.
2023-06-08 17:48:57 I/Bot.【QQ号】: Please enter code: 
LOGIN> > 【短信验证码】
2023-06-08 17:49:27 I/Bot.【QQ号】: Continuing with code '【短信验证码】'.
2023-06-08 17:49:27 I/Bot.【QQ号】: Bot cancelled: Bot closed
Login failed: BotAuthorization(BotAuthorization.byPassword(<ERASED>)) threw an exception during authorization process. See cause below.
2023-06-08 17:49:27 E/console: net.mamoe.mirai.network.BotAuthorizationException: BotAuthorization(BotAuthorization.byPassword(<ERASED>)) threw an exception during authorization process. See cause below.
net.mamoe.mirai.network.BotAuthorizationException: BotAuthorization(BotAuthorization.byPassword(<ERASED>)) threw an exception during authorization process. See cause below.
    at net.mamoe.mirai.internal.network.components.SsoProcessorImpl.login(SsoProcessor.kt:242)
    at net.mamoe.mirai.internal.network.handler.CommonNetworkHandler$StateConnecting$startState$2.invokeSuspend(CommonNetworkHandler.kt:247)
    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: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)
    Suppressed: java.io.EOFException: Premature end of stream: expected 1 bytes
        at net.mamoe.mirai.internal.deps.io.ktor.utils.io.core.StringsKt.prematureEndOfStream(Strings.kt:453)
        at net.mamoe.mirai.internal.deps.io.ktor.utils.io.core.Input.readByteSlow(Input.kt:300)
        at net.mamoe.mirai.internal.deps.io.ktor.utils.io.core.Input.readByte(Input.kt:286)
        at net.mamoe.mirai.internal.network.protocol.packet.login.WtLogin$Login.onLoginSuccess(WtLogin.kt:440)
        at net.mamoe.mirai.internal.network.protocol.packet.login.WtLogin$Login.decode(WtLogin.kt:238)
        at net.mamoe.mirai.internal.network.components.PacketCodecImpl.processBody(PacketCodec.kt:496)
        at net.mamoe.mirai.internal.network.handler.CommonNetworkHandler$PacketDecodePipeline.processBody(CommonNetworkHandler.kt:158)
        at net.mamoe.mirai.internal.network.handler.CommonNetworkHandler$PacketDecodePipeline.access$processBody(CommonNetworkHandler.kt:103)
        at net.mamoe.mirai.internal.network.handler.CommonNetworkHandler$PacketDecodePipeline$1$3$1.invokeSuspend(CommonNetworkHandler.kt:127)
        at net.mamoe.mirai.internal.network.handler.CommonNetworkHandler$PacketDecodePipeline$1$3$1.invoke(CommonNetworkHandler.kt)
        at net.mamoe.mirai.internal.network.handler.CommonNetworkHandler$PacketDecodePipeline$1$3$1.invoke(CommonNetworkHandler.kt)
        at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(Undispatched.kt:55)
        at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:112)
        at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:126)
        at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
        at kotlinx.coroutines.BuildersKt.launch(Unknown Source)
        at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:47)
        at kotlinx.coroutines.BuildersKt.launch$default(Unknown Source)
        at net.mamoe.mirai.internal.network.handler.CommonNetworkHandler$PacketDecodePipeline$1.invokeSuspend(CommonNetworkHandler.kt:127)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:497)
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Unknown Source)
Caused by: [CIRCULAR REFERENCE: java.io.EOFException: Premature end of stream: expected 1 bytes]

网络日志

No response

补充信息

No response

ghost commented 1 year ago

这个错误好像并不容易复现。 我清空bots后又试了一遍,直接登陆上去了(滑块验证+手机短信验证)。

Him188 commented 1 year ago

@StageGuard any ideas, 没有可以先搁置等有更多人问

StageGuard commented 1 year ago

@StageGuard any ideas, 没有可以先搁置等有更多人问

在解析 login success 出现的问题,可能是有新的 tlv 或者某个 tlv 变了,不过 log 里也没有具体的包信息