Forums

ClientConnectorError: Cannot connect to host

I am trying to run bot on digitex but getting this error. i have paid account.

Traceback (most recent call last):
  File "/home/****/.local/lib/python3.8/site-packages/aiohttp-4.0.0a1-py3.8-linux-x86_64.egg/aiohttp/connector.py", line 916, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore  # noqa
  File "/usr/lib/python3.8/asyncio/base_events.py", line 1017, in create_connection
    raise exceptions[0]
  File "/usr/lib/python3.8/asyncio/base_events.py", line 1002, in create_connection
    sock = await self._connect_sock(
  File "/usr/lib/python3.8/asyncio/base_events.py", line 916, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/lib/python3.8/asyncio/selector_events.py", line 485, in sock_connect
    return await fut
  File "/usr/lib/python3.8/asyncio/selector_events.py", line 517, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 111] Connect call failed ('54.229.253.152', 443)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "test_for.py", line 8, in <module>
    client.ping(market_id=1)
  File "/home/****/.local/lib/python3.8/site-packages/digitex_engine_client-4.139.0-py3.8.egg/digitex_engine_client/client.py", line 71, in make_and_send_message
  File "/home/****/.local/lib/python3.8/site-packages/digitex_engine_client-4.139.0-py3.8.egg/digitex_engine_client/client.py", line 49, in send_message
  File "/home/****/.local/lib/python3.8/site-packages/digitex_engine_client-4.139.0-py3.8.egg/digitex_engine_client/auto_async.py", line 56, in wrapper
  File "/home/****/.local/lib/python3.8/site-packages/digitex_engine_client-4.139.0-py3.8.egg/digitex_engine_client/auto_async.py", line 42, in run
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 439, in result
    return self.__get_result()
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result
    raise self._exception
  File "/home/****/.local/lib/python3.8/site-packages/digitex_engine_client-4.139.0-py3.8.egg/digitex_engine_client/ws_client.py", line 104, in send_encoded_message
  File "/home/****/.local/lib/python3.8/site-packages/digitex_engine_client-4.139.0-py3.8.egg/digitex_engine_client/auto_async.py", line 71, in wrapper
  File "/home/****/.local/lib/python3.8/site-packages/digitex_engine_client-4.139.0-py3.8.egg/digitex_engine_client/ws_client.py", line 58, in ensure_ws
  File "/home/****/.local/lib/python3.8/site-packages/aiohttp-4.0.0a1-py3.8-linux-x86_64.egg/aiohttp/client.py", line 700, in _ws_connect
    resp = await self.request(method, url,
  File "/home/****/.local/lib/python3.8/site-packages/aiohttp-4.0.0a1-py3.8-linux-x86_64.egg/aiohttp/client.py", line 442, in _request
    conn = await self._connector.connect(
  File "/home/****/.local/lib/python3.8/site-packages/aiohttp-4.0.0a1-py3.8-linux-x86_64.egg/aiohttp/connector.py", line 507, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/home/****/.local/lib/python3.8/site-packages/aiohttp-4.0.0a1-py3.8-linux-x86_64.egg/aiohttp/connector.py", line 838, in _create_connection
    _, proto = await self._create_direct_connection(
  File "/home/****/.local/lib/python3.8/site-packages/aiohttp-4.0.0a1-py3.8-linux-x86_64.egg/aiohttp/connector.py", line 983, in _create_direct_connection
    raise last_exc
  File "/home/****/.local/lib/python3.8/site-packages/aiohttp-4.0.0a1-py3.8-linux-x86_64.egg/aiohttp/connector.py", line 960, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/home/****/.local/lib/python3.8/site-packages/aiohttp-4.0.0a1-py3.8-linux-x86_64.egg/aiohttp/connector.py", line 923, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host ws.testnet.digitexfutures.com:443 ssl:default [Connect call failed ('54.229.253.152', 443)]
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f695b21d400>

[edit by admin: formatting]

It looks like you upgraded today. Are you running that code in a console that was created after you upgraded?

Thanks problem solved. i just close the console and start new one.

Great! Thanks for confirming.