[Errno 101] Network is unreachable

python
telegram

#1

Hi.

I’m a Telegram’s Bot Developer and since a week or so I can’t work on C9. Suddenly my code was unable to reach Telegram’s Network. I’m using an API as bridge.

Some friends are in the same state I’m.

Why is this happening? Can I fix that?

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 138, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/util/connection.py", line 98, in create_connection
    raise err
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/util/connection.py", line 88, in create_connection
    sock.connect(sa)
OSError: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 594, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 350, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 835, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 281, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 147, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f13f10f1a58>: Failed to establish a new connection: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 423, in send
    timeout=timeout
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 643, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/util/retry.py", line 363, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /botToken/getUpdates?timeout=1 (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f13f10f1a58>: Failed to establish a new connection: [Errno 101] Network is unreachable',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/workspace/botpkmn.py", line 1048, in <module>
    bot.polling(none_stop=True)
  File "/usr/local/lib/python3.4/dist-packages/telebot/__init__.py", line 222, in polling
    self.__threaded_polling(none_stop, interval, timeout)
  File "/usr/local/lib/python3.4/dist-packages/telebot/__init__.py", line 245, in __threaded_polling
    polling_thread.raise_exceptions()
  File "/usr/local/lib/python3.4/dist-packages/telebot/util.py", line 73, in raise_exceptions
    six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2])
  File "/usr/local/lib/python3.4/dist-packages/six.py", line 686, in reraise
    raise value
  File "/usr/local/lib/python3.4/dist-packages/telebot/util.py", line 54, in run
    task(*args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/telebot/__init__.py", line 134, in __retrieve_updates
    logger.debug('Skipped {0} pending messages'.format(self.__skip_updates()))
  File "/usr/local/lib/python3.4/dist-packages/telebot/__init__.py", line 118, in __skip_updates
    updates = self.get_updates(offset=self.last_update_id, timeout=1)
  File "/usr/local/lib/python3.4/dist-packages/telebot/__init__.py", line 106, in get_updates
    json_updates = apihelper.get_updates(self.token, offset, limit, timeout, allowed_updates)
  File "/usr/local/lib/python3.4/dist-packages/telebot/apihelper.py", line 155, in get_updates
    return _make_request(token, method_url, params=payload)
  File "/usr/local/lib/python3.4/dist-packages/telebot/apihelper.py", line 34, in _make_request
    result = requests.request(method, request_url, params=params, files=files, timeout=(connect_timeout, read_timeout))
  File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 487, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /botToken/getUpdates?timeout=1 (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f13f10f1a58>: Failed to establish a new connection: [Errno 101] Network is unreachable',))

#2

I have been Witnessing a similar issue in my php bot :confused:
seems like they are blocking calls because people are running bots natively from the workspace :disappointed_relieved:


#3

Having same problem here. Have you figured out how to fix it?


#4

Bots are prohibited by the c9.io ToS. Due to this, we’ve blocked the API endpoints. You can develop these on AWS Cloud9 or through an SSH workspace (as you own the capacity in both scenarios), but c9.io blocks this as constantly-running applications put undue burden on our systems and affect other users.