S
S
Semyon2021-11-10 13:02:00
Python
Semyon, 2021-11-10 13:02:00

"HTTPSConnectionPool" error. What caused and how to fix?

Good day.
At irregular intervals (1-2 days), the program (a bot for Telegram written in Python) gives an error: "HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: ... /getUpdates ?offset=25629969&timeout=20 ..."
What caused this error?
1) If this error is caused by using Polling (the last line of code is bot.polling(none_stop=True)), suggest a good article on using Webhook. This code is not entirely clear to me - https://github.com/eternnoir/pyTelegramBotAPI/blob... ". I would be glad if you share a good article or video.
2) If the error is due to poor server stability, then which VPS would you recommend ? (I posted my code on the VPS platform REG.RU.
3) If one way or another this error occurs, tell me how to automatically re-run the code with the bot after it occurs.
I am using Python 3.8. The library for writing a bot is pyTelegramBotAPI 4.1.0.
Thanks in advance for your help and constructive dialogue.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Semyon, 2021-11-28
@GSimonX37

Solution: use the infinity_polling() function to get new data from the Telegram servers instead of polling().

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question