orenlab / pytmbot

Flexible Telegram bot designed to manage Docker containers, monitor server status, and extend its functionality through a plugin system
https://orenlab.github.io/pytmbot/
MIT License
7 stars 2 forks source link

telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 502. Description: Bad Gateway #24

Closed AsdertyTreds closed 4 months ago

AsdertyTreds commented 4 months ago

2024-05-08 01:10:47,634 (init.py:1214 MainThread) ERROR - TeleBot: "Exception traceback: Traceback (most recent call last): File "/venv/lib/python3.12/site-packages/telebot/init.py", line 1205, in __threaded_polling polling_thread.raise_exceptions() File "/venv/lib/python3.12/site-packages/telebot/util.py", line 111, in raise_exceptions raise self.exception_info File "/venv/lib/python3.12/site-packages/telebot/util.py", line 93, in run task(*args, **kwargs) File "/venv/lib/python3.12/site-packages/telebot/init.py", line 675, in retrieve_updates updates = self.get_updates(offset=(self.last_update_id + 1), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/venv/lib/python3.12/site-packages/telebot/init__.py", line 647, in get_updates json_updates = apihelper.get_updates( ^^^^^^^^^^^^^^^^^^^^^^ File "/venv/lib/python3.12/site-packages/telebot/apihelper.py", line 327, in get_updates return _make_request(token, method_url, params=payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/venv/lib/python3.12/site-packages/telebot/apihelper.py", line 167, in _make_request json_result = _check_result(method_name, result) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/venv/lib/python3.12/site-packages/telebot/apihelper.py", line 194, in _check_result raise ApiTelegramException(method_name, result, result_json) telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 502. Description: Bad Gateway "

** reason An error occurs, possibly due to problems with the Internet.

it would be nice to add error handling

orenlab commented 4 months ago

Hi, @AsdertyTreds!

Can you please take a look at this version and tell me the result??

AsdertyTreds commented 4 months ago

I will be able to test and report the result after May 13

orenlab commented 4 months ago

I close this issue. If the issue persists after verification, please create a new issue.