Ошибка в aiogram TelegramAPIError: Bad Gateway

Залил бота на сервер и периодически пользователи жалуются, что бот у некоторых перестает работать, на log зашел, такие ошибки, помогите, пожалуйста, думаю добавить webhook, исправит это? Или есть другие решения?

  1. Ошибка Flood Control Exceeded:
2024-08-21 04:11:20,988 - aiogram.dispatcher.dispatcher - ERROR - Cause exception while getting updates.
Traceback (most recent call last):
  File "/home/evro_helper/main/venv/lib/python3.10/site-packages/aiogram/dispatcher/dispatcher.py", line 255, in start_polling
    updates = await self.bot.get_updates(limit=limit, offset=offset, timeout=timeout)
  File "/home/evro_helper/main/venv/lib/python3.10/site-packages/aiogram/bot/bot.py", line 93, in get_updates
    result = await self.request(api.Methods.GET_UPDATES, payload)
  File "/home/evro_helper/main/venv/lib/python3.10/site-packages/aiogram/bot/base.py", line 183, in request
    return await api.make_request(self.session, self.__token, method, data, files,
  File "/home/evro_helper/main/venv/lib/python3.10/site-packages/aiogram/bot/api.py", line 98, in make_request
    return check_result(method, response.content_type, response.status, await response.text())
  File "/home/evro_helper/main/venv/lib/python3.10/site-packages/aiogram/bot/api.py", line 68, in check_result
    raise exceptions.RetryAfter(parameters.retry_after)
aiogram.utils.exceptions.RetryAfter: Flood control exceeded. Retry in 5 seconds.
  1. Ошибка TelegramAPIError: Bad Gateway:
2024-08-21 04:11:26,039 - aiogram.dispatcher.dispatcher - ERROR - Cause exception while getting updates.
Traceback (most recent call last):
  File "/home/evro_helper/main/venv/lib/python3.10/site-packages/aiogram/dispatcher/dispatcher.py", line 255, in start_polling
    updates = await self.bot.get_updates(limit=limit, offset=offset, timeout=timeout)
  File "/home/evro_helper/main/venv/lib/python3.10/site-packages/aiogram/bot/bot.py", line 93, in get_updates
    result = await self.request(api.Methods.GET_UPDATES, payload)
  File "/home/evro_helper/main/venv/lib/python3.10/site-packages/aiogram/bot/base.py", line 183, in request
    return await api.make_request(self.session, self.__token, method, data, files,
  File "/home/evro_helper/main/venv/lib/python3.10/site-packages/aiogram/bot/api.py", line 98, in make_request
    return check_result(method, response.content_type, response.status, await response.text())
  File "/home/evro_helper/main/venv/lib/python3.10/site-packages/aiogram/bot/api.py", line 85, in check_result
    raise exceptions.TelegramAPIError(description)
aiogram.utils.exceptions.TelegramAPIError: Bad Gateway
  1. Ошибка Connection Reset by Peer
2024-08-21 06:05:55,386 - aiogram.dispatcher.dispatcher - ERROR - Cause exception while getting updates.
Traceback (most recent call last):
  File "/usr/lib/python3.10/asyncio/selector_events.py", line 862, in _read_ready__data_received
    data = self._sock.recv(self.max_size)
ConnectionResetError: [Errno 104] Connection reset by peer

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

Traceback (most recent call last):
  File "/home/evro_helper/main/venv/lib/python3.10/site-packages/aiogram/bot/api.py", line 97, in make_request
    async with session.post(url, data=req, **kwargs) as response:
  File "/home/evro_helper/main/venv/lib/python3.10/site-packages/aiohttp/client.py", line 1197, in __aenter__
    self._resp = await self._coro
  File "/home/evro_helper/main/venv/lib/python3.10/site-packages/aiohttp/client.py", line 608, in _request
    await resp.start(conn)
  File "/home/evro_helper/main/venv/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 976, in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
  File "/home/evro_helper/main/venv/lib/python3.10/site-packages/aiohttp/streams.py", line 640, in read
    await self._waiter
aiohttp.client_exceptions.ClientOSError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/evro_helper/main/venv/lib/python3.10/site-packages/aiogram/dispatcher/dispatcher.py", line 255, in start_polling
    updates = await self.bot.get_updates(limit=limit, offset=offset, timeout=timeout)
  File "/home/evro_helper/main/venv/lib/python3.10/site-packages/aiogram/bot/bot.py", line 93, in get_updates
    result = await self.request(api.Methods.GET_UPDATES, payload)
  File "/home/evro_helper/main/venv/lib/python3.10/site-packages/aiogram/bot/base.py", line 183, in request
    return await api.make_request(self.session, self.__token, method, data, files,
  File "/home/evro_helper/main/venv/lib/python3.10/site-packages/aiogram/bot/api.py", line 100, in make_request
    raise exceptions.NetworkError(f"aiohttp client throws an error: {e.__class__.__name__}: {e}")
aiogram.utils.exceptions.NetworkError: Aiohttp client throws an error: ClientOSError: [Errno 104] Connection reset by peer

Ответы (0 шт):