crypto-chassis/ccapi

Cannot establish connection with api.binance.com:443

Closed this issue · 1 comments

I have tried to downgrade urlib3 but the error persists. I have tried curl https://api.binance.com/api/v3/time, the servertime is returned successfully.

2023-05-15 10:58:16,811: loading name: lvtu, exchange name: binance, pair name: ETHBUSD
2023-05-15 10:58:16,811: loading name: lvtu, exchange name: binance, pair name: ETHUSDT
2023-05-15 10:58:16,811: loading name: lvtu, exchange name: binance, pair name: BTCUSDT
2023-05-15 10:58:16,811: name: lvtu, exchange: binance
/home/ic/Desktop/worldbreak-dev514
2023-05-15 10:58:16,811: GET https://api.binance.com/sapi/v1/capital/config/getall?timestamp=1684119496811&recvWindow=10000&signature=8002e37cb1ec87f06e5b5d59a4686421d2ae26dd6c0a086fc79934004bfb1d9f, Request: {'X-MBX-APIKEY': '', 'User-Agent': 'python-requests/2.29.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '/', 'Connection': 'keep-alive'} None
2023-05-15 10:58:16,812: Starting new HTTPS connection (1): api.binance.com:443
Traceback (most recent call last):
File "/home/ic/anaconda3/envs/trading/lib/python3.11/site-packages/urllib3/connection.py", line 174, in _new_conn
conn = connection.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ic/anaconda3/envs/trading/lib/python3.11/site-packages/urllib3/util/connection.py", line 95, in create_connection
raise err
File "/home/ic/anaconda3/envs/trading/lib/python3.11/site-packages/urllib3/util/connection.py", line 85, 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 "/home/ic/anaconda3/envs/trading/lib/python3.11/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "/home/ic/anaconda3/envs/trading/lib/python3.11/site-packages/urllib3/connectionpool.py", line 386, in _make_request
self._validate_conn(conn)
File "/home/ic/anaconda3/envs/trading/lib/python3.11/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn
conn.connect()
File "/home/ic/anaconda3/envs/trading/lib/python3.11/site-packages/urllib3/connection.py", line 363, in connect
self.sock = conn = self._new_conn()
^^^^^^^^^^^^^^^^
File "/home/ic/anaconda3/envs/trading/lib/python3.11/site-packages/urllib3/connection.py", line 186, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7fdef6726f10>: 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/ic/anaconda3/envs/trading/lib/python3.11/site-packages/requests/adapters.py", line 487, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File "/home/ic/anaconda3/envs/trading/lib/python3.11/site-packages/urllib3/connectionpool.py", line 787, in urlopen
retries = retries.increment(
^^^^^^^^^^^^^^^^^^
File "/home/ic/anaconda3/envs/trading/lib/python3.11/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.binance.com', port=443): Max retries exceeded with url: /sapi/v1/capital/config/getall?timestamp=1684119496811&recvWindow=10000&signature=8002e37cb1ec87f06e5b5d59a4686421d2ae26dd6c0a086fc79934004bfb1d9f (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fdef6726f10>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

During handling of the above exception, another exception occurred:

The problem that is described here doesn't involve any usage of our library. Therefore we'd close this issue. Please consult either binance or the urlib3's author for your issue. Thank you.