ERROR - TeleBot: "ConnectionError occurred, args=(ProtocolError('Connection aborted.', TimeoutError(110, 'Connection timed out')),)
2018-01-29 08:32:07,077 (util.py:64 WorkerThread1) ERROR - TeleBot: "ConnectionError occurred, args=(ProtocolError('Connection aborted.', TimeoutError(110, 'Connection timed out')),) Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 560, in urlopen body=body, headers=headers) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 354, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/lib/python3.5/http/client.py", line 1106, in request self._send_request(method, url, body, headers) File "/usr/lib/python3.5/http/client.py", line 1151, in _send_request self.endheaders(body) File "/usr/lib/python3.5/http/client.py", line 1102, in endheaders self._send_output(message_body) File "/usr/lib/python3.5/http/client.py", line 936, in _send_output self.send(message_body) File "/usr/lib/python3.5/http/client.py", line 908, in send self.sock.sendall(data) File "/usr/lib/python3.5/ssl.py", line 891, in sendall v = self.send(data[count:]) File "/usr/lib/python3.5/ssl.py", line 861, in send return self._sslobj.write(data) File "/usr/lib/python3.5/ssl.py", line 586, in write return self._sslobj.write(data) TimeoutError: [Errno 110] Connection timed out
-
What version of pyTelegramBotAPI are you using? Name: pyTelegramBotAPI Version: 3.5.2
-
What OS are you using? Linux Mint 18.2
-
What version of python are you using? Python 3.5.2
Is it always happen? It seems network problem between your device and telegram bot api server.
Same here after like an 10 min bot gets disconnected help pls
@eternnoir hello man it happens all the time for me. If i leave the bot un attended like 10 min. I instantly get this error. I am using latest version of the bot, windows 10 pycharm and python version 3.5.2 waiting for your answer. I can send the code if you like mostly I am using
bot.register_next_step_handler(msg, trade_type_step)
Waiting for your reply.
@eatbas It seems like network problem not package problem. Try some vps to test it.
It's always happening on my side as well, I feel like polling method doesn't handle the network failure exception properly (as it only catches ApiException and KeyBoardInterrupt exception) , at least allow several retries is needed.
Had the same problem!!!
python 3.6 pyTrlrgramBotAPI - latest
webhook (flask) as in example: https://github.com/eternnoir/pyTelegramBotAPI/blob/master/examples/webhook_examples/webhook_flask_echo_bot.py
CentOS7 Host on - Google cloud service (Virtual Mashine)
If i don`t speak with my bot above 15min it 'sleep' and the first message give this error Mar 13 11:08:09 instance-1 python3.6[15983]: 2018-03-13 11:08:09,872 (util.py:65 WorkerThread1) ERROR - TeleBot: "ConnectionError occurred, args=(ProtocolError('Connect ion aborted.', ConnectionResetError(104, 'Connection reset by peer')),) ....... ConnectionError(err, request=request) Mar 13 11:08:09 instance-1 python3.6[15983]: requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) Mar 13 11:08:09 instance-1 python3.6[15983]: "
And wit the next messages - everything OK!
Mar 13 11:08:13 instance-1 python3.6[15983]: 149.154.167.226 - - [13/Mar/2018 11:08:13] "POST /TOKEN/ HTTP/1.1" 200 -
Same as above. Tested on GCE Ubuntu 18.04
+1, after 10-15 min: (util.py:65 WorkerThread2) ERROR - TeleBot: "ConnectionError occurred, args=(ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')),)
+1
+1
+1
+1
Hi same here but 104
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
no solution yet? I mean for me it working perfect while running on my private pc but on gcloud it just happen all the time this error
EDIT found that it was happen to me only on gcloud vm instance, moved to aws and everything is perfect. something wrong with google and requests lib take care
I have the issue too. I work on Google DataLab and use telebot lib. It happen just about after 10 minutes. I don't use requests lib
+1. This happens when I try to send a voice message.
Solved the problem by sending a smaller file)))).
Hello, the same problem for my bit in google cloud vm. Previously my bot was on hetzner and everything was good. Does anyone know how to automatically restart bot if i catch this error?
I solved the issue by following function:
def solver(text):
try:
msg = InvestingcomPythonEchoBot.send_message(chat_id=XXXXXXXXXXXXXXX, text=text)
except OSError:
msg = InvestingcomPythonEchoBot.send_message(chat_id=XXXXXXXXXXXXXXX, text=text)
solver('Problem solved')
I solved the issue by following function:
def solver(text): try: msg = InvestingcomPythonEchoBot.send_message(chat_id=XXXXXXXXXXXXXXX, text=text) except OSError: msg = InvestingcomPythonEchoBot.send_message(chat_id=XXXXXXXXXXXXXXX, text=text) solver('Problem solved')
well, as I understood you try to catch OSError every time during sending a message. Correct?
Maybe we can handle exception with callback? Idk, actually, I got no time nowOn Oct 7, 2019 9:34 PM, Tahir Jalilov [email protected] wrote: I solved the issue by following function: def solver(text): try: msg = InvestingcomPythonEchoBot.send_message(chat_id=XXXXXXXXXXXXXXX, text=text) except OSError: msg = InvestingcomPythonEchoBot.send_message(chat_id=XXXXXXXXXXXXXXX, text=text) solver('Problem solved')
well, as I understood you try to catch OSError every time during sending a message. Correct?
—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread.