Skip to content

[Bug] telegram轮询和报错占满日志 #10027

Description

@MidoriDaisuki

问题描述

间隔很短的时间就会出现报错

如何复现?

正常使用telegram适配器

AstrBot 版本

4.28.0

操作系统

Windows

部署方式

launcher_astrbot.bat

使用的消息平台适配器

telegram

错误日志

[19:35:09.444] [Core] [INFO] [httpx._client:1740]: HTTP Request: POST https://bot.qninq.cn/bot8939804757:AAH6_9nTBCqYoTyrmuLdoq8r5jc_xO_8GFw/getUpdates "HTTP/1.1 409 Conflict"
[19:35:09.444] [Core] [ERRO] [v4.28.0] [telegram.tg_adapter:293]: Telegram polling request failed: Conflict: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running
Traceback (most recent call last):

  File "C:\Users\32582\Desktop\jmbot\AstrBotLauncher-0.1.5.6\AstrBot\main.py", line 155, in <module>
    asyncio.run(main_async(args.webui_dir))
    │       │   │          │    └ None
    │       │   │          └ Namespace(webui_dir=None, reset_password=False)
    │       │   └ <function main_async at 0x000002700F9FD300>
    │       └ <function run at 0x000002700BD23EC0>
    └ <module 'asyncio' from 'C:\\PATH\\Python312\\Lib\\asyncio\\__init__.py'>

  File "C:\PATH\Python312\Lib\asyncio\runners.py", line 194, in run
    return runner.run(main)
           │      │   └ <coroutine object main_async at 0x0000027014F6E7A0>
           │      └ <function Runner.run at 0x000002700C1E3920>
           └ <asyncio.runners.Runner object at 0x0000027015A5EA80>
  File "C:\PATH\Python312\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           │    │     │                  └ <Task pending name='Task-1' coro=<main_async() running at C:\Users\32582\Desktop\jmbot\AstrBotLauncher-0.1.5.6\AstrBot\main.p...
           │    │     └ <function BaseEventLoop.run_until_complete at 0x000002700C1E1580>
           │    └ <ProactorEventLoop running=True closed=False debug=False>
           └ <asyncio.runners.Runner object at 0x0000027015A5EA80>
  File "C:\PATH\Python312\Lib\asyncio\base_events.py", line 674, in run_until_complete
    self.run_forever()
    │    └ <function ProactorEventLoop.run_forever at 0x000002700C2D0CC0>
    └ <ProactorEventLoop running=True closed=False debug=False>
  File "C:\PATH\Python312\Lib\asyncio\windows_events.py", line 322, in run_forever
    super().run_forever()
  File "C:\PATH\Python312\Lib\asyncio\base_events.py", line 641, in run_forever
    self._run_once()
    │    └ <function BaseEventLoop._run_once at 0x000002700C1E32E0>
    └ <ProactorEventLoop running=True closed=False debug=False>
  File "C:\PATH\Python312\Lib\asyncio\base_events.py", line 1986, in _run_once
    handle._run()
    │      └ <function Handle._run at 0x000002700BD11800>
    └ <Handle Task.task_wakeup(<Future finished result=None>)>
  File "C:\PATH\Python312\Lib\asyncio\events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
    │    │            │    │           │    └ <member '_args' of 'Handle' objects>
    │    │            │    │           └ <Handle Task.task_wakeup(<Future finished result=None>)>
    │    │            │    └ <member '_callback' of 'Handle' objects>
    │    │            └ <Handle Task.task_wakeup(<Future finished result=None>)>
    │    └ <member '_context' of 'Handle' objects>
    └ <Handle Task.task_wakeup(<Future finished result=None>)>
> File "C:\Users\32582\Desktop\jmbot\AstrBotLauncher-0.1.5.6\AstrBot\venv\Lib\site-packages\telegram\ext\_utils\networkloop.py", line 161, in network_retry_loop
    await do_action()
          └ <function network_retry_loop.<locals>.do_action at 0x000002703272A0C0>
  File "C:\Users\32582\Desktop\jmbot\AstrBotLauncher-0.1.5.6\AstrBot\venv\Lib\site-packages\telegram\ext\_utils\networkloop.py", line 154, in do_action
    action_cb_task.result()
    │              └ <method 'result' of '_asyncio.Task' objects>
    └ <Task finished name='Task-1374' coro=<Updater._start_polling.<locals>.polling_action_cb() done, defined at C:\Users\32582\Des...
  File "C:\Users\32582\Desktop\jmbot\AstrBotLauncher-0.1.5.6\AstrBot\venv\Lib\site-packages\telegram\ext\_updater.py", line 340, in polling_action_cb
    updates = await self.bot.get_updates(
                    │    └ <member 'bot' of 'Updater' objects>
                    └ Updater[bot=ExtBot[token=8939804757:AAH6_9nTBCqYoTyrmuLdoq8r5jc_xO_8GFw]]
  File "C:\Users\32582\Desktop\jmbot\AstrBotLauncher-0.1.5.6\AstrBot\venv\Lib\site-packages\telegram\ext\_extbot.py", line 672, in get_updates
    updates = await super().get_updates(
  File "C:\Users\32582\Desktop\jmbot\AstrBotLauncher-0.1.5.6\AstrBot\venv\Lib\site-packages\telegram\_bot.py", line 4865, in get_updates
    await self._post(
          │    └ <function Bot._post at 0x0000027016B127A0>
          └ ExtBot[token=8939804757:AAH6_9nTBCqYoTyrmuLdoq8r5jc_xO_8GFw]
  File "C:\Users\32582\Desktop\jmbot\AstrBotLauncher-0.1.5.6\AstrBot\venv\Lib\site-packages\telegram\_bot.py", line 704, in _post
    return await self._do_post(
                 │    └ <function ExtBot._do_post at 0x0000027016BD3A60>
                 └ ExtBot[token=8939804757:AAH6_9nTBCqYoTyrmuLdoq8r5jc_xO_8GFw]
  File "C:\Users\32582\Desktop\jmbot\AstrBotLauncher-0.1.5.6\AstrBot\venv\Lib\site-packages\telegram\ext\_extbot.py", line 370, in _do_post
    return await super()._do_post(
  File "C:\Users\32582\Desktop\jmbot\AstrBotLauncher-0.1.5.6\AstrBot\venv\Lib\site-packages\telegram\_bot.py", line 733, in _do_post
    result = await request.post(
                   │       └ <function BaseRequest.post at 0x0000027016A08A40>
                   └ <telegram.request._httpxrequest.HTTPXRequest object at 0x0000027031E66AD0>
  File "C:\Users\32582\Desktop\jmbot\AstrBotLauncher-0.1.5.6\AstrBot\venv\Lib\site-packages\telegram\request\_baserequest.py", line 198, in post
    result = await self._request_wrapper(
                   │    └ <function BaseRequest._request_wrapper at 0x0000027016A08B80>
                   └ <telegram.request._httpxrequest.HTTPXRequest object at 0x0000027031E66AD0>
  File "C:\Users\32582\Desktop\jmbot\AstrBotLauncher-0.1.5.6\AstrBot\venv\Lib\site-packages\telegram\request\_baserequest.py", line 375, in _request_wrapper
    raise exception
          └ Conflict('Conflict: terminated by other getUpdates request; make sure that only one bot instance is running')

telegram.error.Conflict: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running
[19:35:21.471] [Core] [INFO] [httpx._client:1740]: HTTP Request: POST https://bot.qninq.cn/bot8939804757:AAH6_9nTBCqYoTyrmuLdoq8r5jc_xO_8GFw/getUpdates "HTTP/1.1 200 OK"
[19:35:32.307] [Core] [INFO] [httpx._client:1740]: HTTP Request: POST https://bot.qninq.cn/bot8939804757:AAH6_9nTBCqYoTyrmuLdoq8r5jc_xO_8GFw/getUpdates "HTTP/1.1 200 OK"
[19:35:43.153] [Core] [INFO] [httpx._client:1740]: HTTP Request: POST https://bot.qninq.cn/bot8939804757:AAH6_9nTBCqYoTyrmuLdoq8r5jc_xO_8GFw/getUpdates "HTTP/1.1 200 OK"
[19:35:53.994] [Core] [INFO] [httpx._client:1740]: HTTP Request: POST https://bot.qninq.cn/bot8939804757:AAH6_9nTBCqYoTyrmuLdoq8r5jc_xO_8GFw/getUpdates "HTTP/1.1 200 OK"
[19:36:04.884] [Core] [INFO] [httpx._client:1740]: HTTP Request: POST https://bot.qninq.cn/bot8939804757:AAH6_9nTBCqYoTyrmuLdoq8r5jc_xO_8GFw/getUpdates "HTTP/1.1 200 OK"

辅助信息

No response

检查清单

  • 我已在 Issue 列表中搜索过相关问题仍无法解决,或该问题从未被报告过。
  • 我已尝试过禁用所有插件,排除了可能是因插件导致的问题。
  • 我报告的问题与 AstrBot 本体相关,而非在报告某一插件的问题。
  • 我已阅读并同意本项目的贡献者行为准则
  • (可选)我愿意提交 PR 以帮助修复该问题。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions