CMHopeSunshine / LittlePaimon

小派蒙!基于Nonebot2的原神机器人,包括但不限于UID面板查询、抽卡记录分析、游戏攻略图鉴、实时便签、原石札记、群聊学习、群管等功能。/ LittlePamon! Genshin Impact multifunctional bot based on Nonebot2.
https://docs.paimon.cherishmoon.top
GNU Affero General Public License v3.0
1.15k stars 130 forks source link

Bot启动失败 #338

Closed RoundedOrange closed 1 year ago

RoundedOrange commented 1 year ago

执行poetry run nb run时出现以下报错

/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.12) or chardet (3.0.4) doesn't match a supported version!
  warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
12-07 00:38:46 [SUCCESS] nonebot | NoneBot is initializing...
12-07 00:38:46 [INFO] nonebot | Current Env: prod
12-07 00:38:46 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_couplets"
12-07 00:38:46 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_apscheduler"
12-07 00:38:46 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_myb_exchange"
12-07 00:38:48 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_gocqhttp"
12-07 00:38:50 [SUCCESS] nonebot | Succeeded to import "Paimon_Autobbs"
12-07 00:38:50 [SUCCESS] nonebot | Succeeded to import "NoticeAndRequest"
12-07 00:38:50 [SUCCESS] nonebot | Succeeded to import "Paimon_DailyNote"
12-07 00:38:50 [SUCCESS] nonebot | Succeeded to import "Genshin_Calendar"
12-07 00:38:50 [SUCCESS] nonebot | Succeeded to import "Paimon_Gacha_Log"
12-07 00:38:52 [SUCCESS] nonebot | Succeeded to import "Learning_Chat"
12-07 00:38:52 [SUCCESS] nonebot | Succeeded to import "Paimon_Gacha"
12-07 00:38:52 [SUCCESS] nonebot | Succeeded to import "tools"
12-07 00:38:52 [SUCCESS] nonebot | Succeeded to import "plugin_manager"
12-07 00:38:52 [SUCCESS] nonebot | Succeeded to import "Genshin_Voice"
12-07 00:38:52 [SUCCESS] nonebot | Succeeded to import "Mihoyo_bbs"
12-07 00:38:52 [SUCCESS] nonebot | Succeeded to import "Paimon_MonthInfo"
12-07 00:38:52 [SUCCESS] nonebot | Succeeded to import "Paimon_CloudGenshin"
12-07 00:38:53 [SUCCESS] nonebot | Succeeded to import "Paimon_Bind"
12-07 00:38:55 [SUCCESS] nonebot | Succeeded to import "Paimon_Wiki"
12-07 00:38:55 [SUCCESS] nonebot | Succeeded to import "bot_manager"
12-07 00:38:55 [SUCCESS] nonebot | Succeeded to import "news60s"
12-07 00:38:55 [SUCCESS] nonebot | Succeeded to import "Paimon_Abyss"
12-07 00:38:56 [SUCCESS] nonebot | Succeeded to import "Paimon_Info"
12-07 00:38:56 [SUCCESS] nonebot | Succeeded to import "LittlePaimon"
12-07 00:38:56 [SUCCESS] nonebot | Running NoneBot...
12-07 00:38:56 [INFO] uvicorn | Started server process [2480]
12-07 00:38:56 [INFO] uvicorn | Waiting for application startup.
12-07 00:38:56 [INFO] nonebot_plugin_apscheduler | Scheduler Started
12-07 00:39:02 [INFO] nonebot_plugin_gocqhttp | Begin to Download binary from https://download.fastgit.org/Mrs4s/go-cqhttp/releases/latest/download/go-cqhttp_linux_amd64.tar.gz
12-07 00:39:04 [ERROR] nonebot_plugin_gocqhttp | An error has been caught in function 'startup', process 'MainProcess' (2480), thread 'MainThread' (140552661722944):
Traceback (most recent call last):
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpcore/_exceptions.py", line 8, in map_exceptions
    yield
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpcore/_async/http11.py", line 174, in _receive_event
    event = self._h11_state.next_event()
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/h11/_connection.py", line 425, in next_event
    event = self._extract_next_receive_event()
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/h11/_connection.py", line 375, in _extract_next_receive_event
    event = self._reader.read_eof()
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/h11/_readers.py", line 117, in read_eof
    raise RemoteProtocolError(
h11._util.RemoteProtocolError: peer closed connection without sending complete message body (received 130258 bytes, expected 4818100)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions
    yield
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpx/_transports/default.py", line 239, in __aiter__
    async for part in self._httpcore_stream:
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpcore/_async/connection_pool.py", line 346, in __aiter__
    async for part in self._stream:
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpcore/_async/http11.py", line 300, in __aiter__
    raise exc
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpcore/_async/http11.py", line 293, in __aiter__
    async for chunk in self._connection._receive_response_body(**kwargs):
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpcore/_async/http11.py", line 165, in _receive_response_body
    event = await self._receive_event(timeout=timeout)
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpcore/_async/http11.py", line 174, in _receive_event
    event = self._h11_state.next_event()
  File "/usr/lib/python3.8/contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpcore/_exceptions.py", line 12, in map_exceptions
    raise to_exc(exc)
httpcore.RemoteProtocolError: peer closed connection without sending complete message body (received 130258 bytes, expected 4818100)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/bin/nb", line 8, in <module>
    sys.exit(main())
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/nb_cli/commands/main.py", line 30, in run
    run_bot(file, app)
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/nb_cli/handlers/deploy.py", line 25, in run_bot
    nonebot.run(app=f"{module_name}:{app}")
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/nonebot/__init__.py", line 273, in run
    get_driver().run(*args, **kwargs)
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/nonebot/drivers/fastapi.py", line 172, in run
    uvicorn.run(
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/uvicorn/main.py", line 576, in run
    server.run()
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/uvicorn/server.py", line 60, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/uvicorn/lifespan/on.py", line 86, in main
    await app(scope, self.receive, self.send)
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/fastapi/applications.py", line 269, in __call__
    await super().__call__(scope, receive, send)
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/starlette/applications.py", line 124, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/starlette/middleware/errors.py", line 149, in __call__
    await self.app(scope, receive, send)
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/starlette/exceptions.py", line 69, in __call__
    await self.app(scope, receive, send)
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/starlette/routing.py", line 659, in __call__
    await self.lifespan(scope, receive, send)
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/starlette/routing.py", line 635, in lifespan
    async with self.lifespan_context(app):
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/starlette/routing.py", line 530, in __aenter__
    await self._router.startup()
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/starlette/routing.py", line 612, in startup
    await handler()
> File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/nonebot_plugin_gocqhttp/__init__.py", line 40, in startup
    await download_gocq()
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/nonebot_plugin_gocqhttp/process/download.py", line 118, in download_gocq
    async for chunk in response.aiter_bytes():
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpx/_models.py", line 914, in aiter_bytes
    async for raw_bytes in self.aiter_raw():
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpx/_models.py", line 972, in aiter_raw
    async for raw_stream_bytes in self.stream:
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpx/_client.py", line 146, in __aiter__
    async for chunk in self._stream:
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpx/_transports/default.py", line 240, in __aiter__
    yield part
  File "/usr/lib/python3.8/contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.RemoteProtocolError: peer closed connection without sending complete message body (received 130258 bytes, expected 4818100)
12-07 00:39:04 [ERROR] uvicorn | Traceback (most recent call last):
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpcore/_exceptions.py", line 8, in map_exceptions
    yield
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpcore/_async/http11.py", line 174, in _receive_event
    event = self._h11_state.next_event()
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/h11/_connection.py", line 425, in next_event
    event = self._extract_next_receive_event()
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/h11/_connection.py", line 375, in _extract_next_receive_event
    event = self._reader.read_eof()
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/h11/_readers.py", line 117, in read_eof
    raise RemoteProtocolError(
h11._util.RemoteProtocolError: peer closed connection without sending complete message body (received 130258 bytes, expected 4818100)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions
    yield
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpx/_transports/default.py", line 239, in __aiter__
    async for part in self._httpcore_stream:
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpcore/_async/connection_pool.py", line 346, in __aiter__
    async for part in self._stream:
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpcore/_async/http11.py", line 300, in __aiter__
    raise exc
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpcore/_async/http11.py", line 293, in __aiter__
    async for chunk in self._connection._receive_response_body(**kwargs):
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpcore/_async/http11.py", line 165, in _receive_response_body
    event = await self._receive_event(timeout=timeout)
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpcore/_async/http11.py", line 174, in _receive_event
    event = self._h11_state.next_event()
  File "/usr/lib/python3.8/contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpcore/_exceptions.py", line 12, in map_exceptions
    raise to_exc(exc)
httpcore.RemoteProtocolError: peer closed connection without sending complete message body (received 130258 bytes, expected 4818100)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/starlette/routing.py", line 635, in lifespan
    async with self.lifespan_context(app):
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/starlette/routing.py", line 530, in __aenter__
    await self._router.startup()
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/starlette/routing.py", line 612, in startup
    await handler()
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/nonebot_plugin_gocqhttp/__init__.py", line 40, in startup
    await download_gocq()
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/loguru/_logger.py", line 1212, in catch_wrapper
    return await function(*args, **kwargs)
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/nonebot_plugin_gocqhttp/process/download.py", line 118, in download_gocq
    async for chunk in response.aiter_bytes():
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpx/_models.py", line 914, in aiter_bytes
    async for raw_bytes in self.aiter_raw():
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpx/_models.py", line 972, in aiter_raw
    async for raw_stream_bytes in self.stream:
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpx/_client.py", line 146, in __aiter__
    async for chunk in self._stream:
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpx/_transports/default.py", line 240, in __aiter__
    yield part
  File "/usr/lib/python3.8/contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.RemoteProtocolError: peer closed connection without sending complete message body (received 130258 bytes, expected 4818100)

12-07 00:39:04 [ERROR] uvicorn | Application startup failed. Exiting.

感觉是下载一个二进制文件时网络的问题,我试了好多次,每次都下载失败。是网络问题吗?该怎么解决?

CMHopeSunshine commented 1 year ago

更新一下这个插件再重启:poetry run pip install --upgrade nonebot-plugin-gocqhttp

RoundedOrange commented 1 year ago

''' 12-07 00:52:05 [SUCCESS] nonebot | Succeeded to import "Genshin_Voice" 12-07 00:52:06 [SUCCESS] nonebot | Succeeded to import "NoticeAndRequest" 12-07 00:52:06 [SUCCESS] nonebot | Succeeded to import "tools" 12-07 00:52:06 [SUCCESS] nonebot | Succeeded to import "LittlePaimon" 12-07 00:52:06 [SUCCESS] nonebot | Running NoneBot... 12-07 00:52:06 [INFO] uvicorn | Started server process [2666] 12-07 00:52:06 [INFO] uvicorn | Waiting for application startup. 12-07 00:52:06 [INFO] nonebot_plugin_apscheduler | Scheduler Started 12-07 00:52:08 [ERROR] uvicorn | Traceback (most recent call last): File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/starlette/routing.py", line 635, in lifespan async with self.lifespan_context(app): File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/starlette/routing.py", line 530, in aenter await self._router.startup() File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/starlette/routing.py", line 612, in startup await handler() File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/nonebot_plugin_gocqhttp/init.py", line 40, in startup await download_gocq() File "/root/.cache/pypoetry/virtualenvs/littlepaimon-Yl79Fm97-py3.8/lib/python3.8/site-packages/nonebot_plugin_gocqhttp/process/download.py", line 120, in download_gocq raise RuntimeError("No available download mirror found.") RuntimeError: No available download mirror found.

12-07 00:52:08 [ERROR] uvicorn | Application startup failed. Exiting. '''

CMHopeSunshine commented 1 year ago

啊这,没有可用的下载镜像,试试开个代理吧,或者不用插件版,手动下载gocq

RoundedOrange commented 1 year ago

我用的服务器,我先试试手动下载吧

CMHopeSunshine commented 1 year ago

更新到最新版本即可,之前的资源检查api已经弃用,所以报错

RoundedOrange commented 1 year ago

通过更新解决了上述问题

git pull更新版本后可以了。

又碰到新的问题

然后碰到了https://127.0.0.1/go-cqhttp 使用得了,但小派蒙登不上QQ账号的问题(总是出现“网络不稳定请使用常用设备或同一网络什么什么的”或“密码错误或账号被冻结什么什么的”),不知道是不是算被风控了。又查了一大堆资料解决了小派蒙登陆不了QQ账号的问题。 不知道有没有其他人遇到上述情况,我把我的解决方法说一下。

解决启动小派蒙后插件导入正常但是登不了QQ账号的问题(要你换成同一wifi或常用设备这类Error)

  1. 在go-cqhttp的代码仓(https://github.com/Mrs4s/go-cqhttp/releases )下载适合你电脑版本的exe文件。
  2. 用powershell在exe文件目录下执行./go-cqhttp.exe,注意命令行里面填的是下载exe文件的全名。
  3. 程序输出“请选择需要的通信方式”然后列出四个选项,我们输入02,也就是第0号和第2号选项。
  4. 程序自动退出并生成config.yml文件。
  5. 修该config.yml里面的uin和password,分别换成qq号和密码。
  6. 再次在powershell执行./go-cqhttp.exe,go-cqhttp.exe依然换成你exe文件的全名。仍然失败,但注意到生成device.json文件。
  7. 打开device.json,把“protocol”项从5改为2
  8. 再次在powershell执行./go-cqhttp.exe,这时应该能成功。(这里我的情况是需要Enter键向手机发送验证码才能成功)
  9. 同目录下的device.json和session.token就可以取代默认的配置文件了,在https://127.0.0.1/go-cqhttp的修改设置(进程配置和设备信息)修改。我是只修改了device.json也就是设备信息就可以登录了。

新的问题

执行第9点要注意的是,把所有device.json粘贴到设备信息里面貌似不行,后端会返回422报错,我就一个配置项一个配置项粘贴,把id啊mac地址啊这类的都粘贴上,其他看不懂的就不管了。结果最后居然可以登上。

还有一个问题是修改完配置后初次启动同样要求按Enter发送手机验证码,在我的电脑可以按Enter,但服务器按不了Enter,所以第一次启动要发验证码时我按不了,失败了;第二次启动就不要验证码了,我也不用按Enter了。感觉优化一下可以解决在服务器也能按Enter从而可以给手机发验证码的情况。不知道这是小派蒙负责管这些还是go-cqhttp管这些事。

以上。