eternnoir / pyTelegramBotAPI

Python Telegram bot api.
GNU General Public License v2.0
8.11k stars 2.03k forks source link

('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) how to fix? #1001

Closed madein713 closed 3 years ago

madein713 commented 4 years ago

Please answer these questions before submitting your issue. Thanks!

  1. What version of pyTelegramBotAPI are you using? pyTelegramBotAPI==3.7.3

  2. What OS are you using? Ubuntu 20.04 LTS

  3. What version of python are you using? Python 3.8.5

Good day! I've been writing this bot for 6 months and now I get this error, what's the problem? i used an 'while true' loop to run, but i only get this error.

Badiboy commented 4 years ago
while(True):
    try:
        bot.infinity_polling()
    except:
        pass
coder2020official commented 4 years ago

for vps u can use systemd to check if bot fails but it can also be: telegram issues wifi network issues

icecore2 commented 4 years ago

Same to me, the polling seems like to be limited in the telegrams side so I made a systemd with restart on fail, but some say that webhook solves this issue with the connectivity...

coder2020official commented 3 years ago

The exception is from requests package. Perhaps need to replace requests package. There is a network problem between your server and telegram's api.

and: Can you try adding this line before polling()?

apihelper.RETRY_ON_ERROR = True bot.polling()

if u r on ubuntu vps, use service files

icecore2 commented 3 years ago

I started to use a service file to start the bot on fail but, if it crashes on bot command running, it misses the command and the message if it fails on it.

Mahmoud245 commented 4 months ago

I have same issues did you find how to fix that?