eternnoir / pyTelegramBotAPI

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

requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.telegram.org', port=443): Read timed out. (read timeout=15) #2200

Closed mjsir911 closed 7 months ago

mjsir911 commented 7 months ago
  1. What version of pyTelegramBotAPI are you using?

The latest on HEAD:

$ pip install git+https://github.com/eternnoir/pyTelegramBotAPI
Collecting git+https://github.com/eternnoir/pyTelegramBotAPI
  Cloning https://github.com/eternnoir/pyTelegramBotAPI to /tmp/pip-req-build-phmzcu4t
  Running command git clone --filter=blob:none --quiet https://github.com/eternnoir/pyTelegramBotAPI /tmp/pip-req-build-phmzcu4t
  Resolved https://github.com/eternnoir/pyTelegramBotAPI to commit 7d7d5104bf726a19ec8a84af3c07ca6533083a1b
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done

(I'm seeing the same problems with pyTelegramBotAPI-4.16.1 also)

  1. What OS are you using? NixOS linux

  2. What version of python are you using?

$ python --version
Python 3.11.5

I'm using TeleServ and seeing failures:

Traceback (most recent call last):
  File "/home/msirabella/TeleServ/venv/lib/python3.11/site-packages/telebot/__init__.py", line 1016, in infinity_polling
    self.polling(non_stop=True, timeout=timeout, long_polling_timeout=long_polling_timeout,
  File "/home/msirabella/TeleServ/venv/lib/python3.11/site-packages/telebot/__init__.py", line 1101, in polling
    logger.info('Starting your bot with username: [@%s]', self.user.username)
                                                          ^^^^^^^^^
  File "/home/msirabella/TeleServ/venv/lib/python3.11/site-packages/telebot/__init__.py", line 279, in user
    self._user = self.get_me()
                 ^^^^^^^^^^^^^
  File "/home/msirabella/TeleServ/venv/lib/python3.11/site-packages/telebot/__init__.py", line 1288, in get_me
    apihelper.get_me(self.token)
  File "/home/msirabella/TeleServ/venv/lib/python3.11/site-packages/telebot/apihelper.py", line 198, in get_me
    return _make_request(token, method_url)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/msirabella/TeleServ/venv/lib/python3.11/site-packages/telebot/apihelper.py", line 158, in _make_request
    result = _get_req_session().request(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/msirabella/TeleServ/venv/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/msirabella/TeleServ/venv/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/msirabella/TeleServ/venv/lib/python3.11/site-packages/requests/adapters.py", line 532, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.telegram.org', port=443): Read timed out. (read timeout=15)
"
mjsir911 commented 7 months ago

Yeah I'm seeing the same with the writing your first bot instructions in the README

mjsir911 commented 7 months ago

This just seemed to be an ipv6 blocking issue