@DRxxx

Выдается ошибка такого типа. Без понятия что делать. В чем проблема?

(впн не фиксит) Ошибка появляется почти сразу с запуском проекта, ошибка:

2020-04-12 18:35:30,705 (util.py:66 PollingThread) ERROR - TeleBot: "ConnectTimeout occurred, args=(MaxRetryError("HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /bot1151050518:AAEZjVO_hSPjVhW1eC9hUgWqpbdapTC1sr8/getUpdates?offset=1&timeout=20 (Caused by ConnectTimeoutError(, 'Connection to api.telegram.org timed out. (connect timeout=3.5)'))"),)
Traceback (most recent call last):
File "C:\Program Files (x86)\Python37-32\lib\site-packages\urllib3\connection.py", line 157, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "C:\Program Files (x86)\Python37-32\lib\site-packages\urllib3\util\connection.py", line 84, in create_connection
raise err
File "C:\Program Files (x86)\Python37-32\lib\site-packages\urllib3\util\connection.py", line 74, in create_connection
sock.connect(sa)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files (x86)\Python37-32\lib\site-packages\urllib3\connectionpool.py", line 672, in urlopen
chunked=chunked,
File "C:\Program Files (x86)\Python37-32\lib\site-packages\urllib3\connectionpool.py", line 376, in _make_request
self._validate_conn(conn)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\urllib3\connectionpool.py", line 994, in _validate_conn
conn.connect()
File "C:\Program Files (x86)\Python37-32\lib\site-packages\urllib3\connection.py", line 300, in connect
conn = self._new_conn()
File "C:\Program Files (x86)\Python37-32\lib\site-packages\urllib3\connection.py", line 164, in _new_conn
% (self.host, self.timeout),
urllib3.exceptions.ConnectTimeoutError: (, 'Connection to api.telegram.org timed out. (connect timeout=3.5)')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files (x86)\Python37-32\lib\site-packages\requests\adapters.py", line 449, in send
timeout=timeout
File "C:\Program Files (x86)\Python37-32\lib\site-packages\urllib3\connectionpool.py", line 720, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "C:\Program Files (x86)\Python37-32\lib\site-packages\urllib3\util\retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /bot1151050518:AAEZjVO_hSPjVhW1eC9hUgWqpbdapTC1sr8/getUpdates?offset=1&timeout=20 (Caused by ConnectTimeoutError(, 'Connection to api.telegram.org timed out. (connect timeout=3.5)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files (x86)\Python37-32\lib\site-packages\telebot\util.py", line 60, in run
task(*args, **kwargs)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\telebot\__init__.py", line 279, in __retrieve_updates
updates = self.get_updates(offset=(self.last_update_id + 1), timeout=timeout)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\telebot\__init__.py", line 249, in get_updates
json_updates = apihelper.get_updates(self.token, offset, limit, timeout, allowed_updates)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\telebot\apihelper.py", line 194, in get_updates
return _make_request(token, method_url, params=payload)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\telebot\apihelper.py", line 58, in _make_request
timeout=(connect_timeout, read_timeout), proxies=proxy)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\requests\sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\requests\sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\requests\adapters.py", line 504, in send
raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /bot1151050518:AAEZjVO_hSPjVhW1eC9hUgWqpbdapTC1sr8/getUpdates?offset=1&timeout=20 (Caused by ConnectTimeoutError(, 'Connection to api.telegram.org timed out. (connect timeout=3.5)'))
"
Traceback (most recent call last):
File "C:\Program Files (x86)\Python37-32\lib\site-packages\urllib3\connection.py", line 157, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "C:\Program Files (x86)\Python37-32\lib\site-packages\urllib3\util\connection.py", line 84, in create_connection
raise err
File "C:\Program Files (x86)\Python37-32\lib\site-packages\urllib3\util\connection.py", line 74, in create_connection
sock.connect(sa)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files (x86)\Python37-32\lib\site-packages\urllib3\connectionpool.py", line 672, in urlopen
chunked=chunked,
File "C:\Program Files (x86)\Python37-32\lib\site-packages\urllib3\connectionpool.py", line 376, in _make_request
self._validate_conn(conn)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\urllib3\connectionpool.py", line 994, in _validate_conn
conn.connect()
File "C:\Program Files (x86)\Python37-32\lib\site-packages\urllib3\connection.py", line 300, in connect
conn = self._new_conn()
File "C:\Program Files (x86)\Python37-32\lib\site-packages\urllib3\connection.py", line 164, in _new_conn
% (self.host, self.timeout),
urllib3.exceptions.ConnectTimeoutError: (, 'Connection to api.telegram.org timed out. (connect timeout=3.5)')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files (x86)\Python37-32\lib\site-packages\requests\adapters.py", line 449, in send
timeout=timeout
File "C:\Program Files (x86)\Python37-32\lib\site-packages\urllib3\connectionpool.py", line 720, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "C:\Program Files (x86)\Python37-32\lib\site-packages\urllib3\util\retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /bot1151050518:AAEZjVO_hSPjVhW1eC9hUgWqpbdapTC1sr8/getUpdates?offset=1&timeout=20 (Caused by ConnectTimeoutError(, 'Connection to api.telegram.org timed out. (connect timeout=3.5)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/Иван/PycharmProjects/untitled5/main.py", line 11, in
bot.polling(none_stop=True)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\telebot\__init__.py", line 392, in polling
self.__threaded_polling(none_stop, interval, timeout)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\telebot\__init__.py", line 415, in __threaded_polling
polling_thread.raise_exceptions()
File "C:\Program Files (x86)\Python37-32\lib\site-packages\telebot\util.py", line 79, in raise_exceptions
six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2])
File "C:\Program Files (x86)\Python37-32\lib\site-packages\six.py", line 703, in reraise
raise value
File "C:\Program Files (x86)\Python37-32\lib\site-packages\telebot\util.py", line 60, in run
task(*args, **kwargs)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\telebot\__init__.py", line 279, in __retrieve_updates
updates = self.get_updates(offset=(self.last_update_id + 1), timeout=timeout)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\telebot\__init__.py", line 249, in get_updates
json_updates = apihelper.get_updates(self.token, offset, limit, timeout, allowed_updates)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\telebot\apihelper.py", line 194, in get_updates
return _make_request(token, method_url, params=payload)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\telebot\apihelper.py", line 58, in _make_request
timeout=(connect_timeout, read_timeout), proxies=proxy)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\requests\sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\requests\sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\requests\adapters.py", line 504, in send
raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /bot1151050518:AAEZjVO_hSPjVhW1eC9hUgWqpbdapTC1sr8/getUpdates?offset=1&timeout=20 (Caused by ConnectTimeoutError(, 'Connection to api.telegram.org timed out. (connect timeout=3.5)'))
  • Вопрос задан
  • 270 просмотров
Пригласить эксперта
Ответы на вопрос 1
DKay7
@DKay7
Юный студент
Включите VPN на компьютере, с которого запускаете код. Тогда все заработает
Ответ написан
Комментировать
Ваш ответ на вопрос

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

Похожие вопросы
27 нояб. 2024, в 19:08
1500 руб./в час
27 нояб. 2024, в 18:19
2000 руб./за проект
27 нояб. 2024, в 17:41
2000 руб./за проект