@mintvizer

Почему Телеграм бот на python выключается?

пишу бота и использую pyTelegramBotApi на Python!

Проблема следующая:
Бот выключатся и имеется следующая ошибка:
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

Телеграм уже разблокирован в России! Значит не из-за блокировок, apihelper не помагает...

Гуглил, но никаких новых решений кроме apihelper не нашел

Полная ошибка
Traceback (most recent call last):
File "/home/panthera/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 677, in urlopen
chunked=chunked,
File "/home/panthera/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 426, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "/home/panthera/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 421, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.6/http/client.py", line 1356, in getresponse
response.begin()
File "/usr/lib/python3.6/http/client.py", line 307, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.6/http/client.py", line 268, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/lib/python3.6/socket.py", line 586, in readinto
return self._sock.recv_into(b)
File "/usr/lib/python3.6/ssl.py", line 1012, in recv_into
return self.read(nbytes, buffer)
File "/usr/lib/python3.6/ssl.py", line 874, in read
return self._sslobj.read(len, buffer)
File "/usr/lib/python3.6/ssl.py", line 631, in read
v = self._sslobj.read(len, buffer)
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/panthera/.local/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/home/panthera/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 727, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/home/panthera/.local/lib/python3.6/site-packages/urllib3/util/retry.py", line 403, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/home/panthera/.local/lib/python3.6/site-packages/urllib3/packages/six.py", line 734, in reraise
raise value.with_traceback(tb)
File "/home/panthera/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 677, in urlopen
chunked=chunked,
File "/home/panthera/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 426, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "/home/panthera/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 421, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.6/http/client.py", line 1356, in getresponse
response.begin()
File "/usr/lib/python3.6/http/client.py", line 307, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.6/http/client.py", line 268, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/lib/python3.6/socket.py", line 586, in readinto
return self._sock.recv_into(b)
File "/usr/lib/python3.6/ssl.py", line 1012, in recv_into
return self.read(nbytes, buffer)
File "/usr/lib/python3.6/ssl.py", line 874, in read
return self._sslobj.read(len, buffer)
File "/usr/lib/python3.6/ssl.py", line 631, in read
v = self._sslobj.read(len, buffer)
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "./bot.py", line 134, in
bot.polling(none_stop=True, timeout=0)
File "/home/panthera/.local/lib/python3.6/site-packages/telebot/__init__.py", line 427, in polling
self.__threaded_polling(none_stop, interval, timeout)
File "/home/panthera/.local/lib/python3.6/site-packages/telebot/__init__.py", line 451, in __threaded_polling
self.worker_pool.raise_exceptions()
File "/home/panthera/.local/lib/python3.6/site-packages/telebot/util.py", line 118, in raise_exceptions
six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2])
File "/home/panthera/.local/lib/python3.6/site-packages/six.py", line 703, in reraise
raise value
File "/home/panthera/.local/lib/python3.6/site-packages/telebot/util.py", line 69, in run
task(*args, **kwargs)
File "./bot.py", line 28, in handler_text
controll.handler_get_manufactured_order(message, bot, telebot.types)
File "/home/panthera/Программирование/Python/Бот Telegram/nuttela/controll.py", line 467, in handler_get_manufactured_order
config.admin_list['{}'.format(message.chat.id)].get_orders_all('Изготовлен', message, bot, types)
File "/home/panthera/Программирование/Python/Бот Telegram/nuttela/classes.py", line 509, in get_orders_all
bot.send_photo(message.chat.id, img, order_str, reply_markup=markup)
File "/home/panthera/.local/lib/python3.6/site-packages/telebot/__init__.py", line 700, in send_photo
parse_mode, disable_notification, timeout))
File "/home/panthera/.local/lib/python3.6/site-packages/telebot/apihelper.py", line 352, in send_photo
return _make_request(token, method_url, params=payload, files=files, method='post')
File "/home/panthera/.local/lib/python3.6/site-packages/telebot/apihelper.py", line 104, in _make_request
timeout=(connect_timeout, read_timeout), proxies=proxy)
File "/home/panthera/.local/lib/python3.6/site-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/home/panthera/.local/lib/python3.6/site-packages/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "/home/panthera/.local/lib/python3.6/site-packages/requests/adapters.py", line 498, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
  • Вопрос задан
  • 100 просмотров
Пригласить эксперта
Ответы на вопрос 1
@shadrin_ss
Junior
То что разблокировали не говорит о том что проблема не в этом
Все бонально ошибка в подключении значит думайте как исправить ее
Возможно очень медленный интернет
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы
SMIT Москва
от 50 000 до 80 000 ₽
HighTeam Москва
от 60 000 до 120 000 ₽
Бастион Москва
от 50 000 до 70 000 ₽