Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polkadex - error requesting exchange info. #6387

Closed
nikspz opened this issue Jun 19, 2023 · 7 comments
Closed

Polkadex - error requesting exchange info. #6387

nikspz opened this issue Jun 19, 2023 · 7 comments

Comments

@nikspz
Copy link
Contributor

nikspz commented Jun 19, 2023

Polkadex - error requesting exchange info.

Steps To Reproduce
Setup latest development branch for client
Start the client and observe the log panel

Screenshots
image

Release version
dev-1.17.0, staging 1.17.0

2023-06-20 02:40:24,127 - 314 - hummingbot.connector.exchange.polkadex.polkadex_exchange.PolkadexExchange - ERROR - There was an error requesting exchange info.
Traceback (most recent call last):
  File "/home/comp1/miniconda3/envs/hummingbot/lib/python3.8/site-packages/aiohttp/connector.py", line 1152, in _create_direct_connection
    hosts = await asyncio.shield(host_resolved)
  File "/home/comp1/miniconda3/envs/hummingbot/lib/python3.8/site-packages/aiohttp/connector.py", line 874, in _resolve_host
    addrs = await self._resolver.resolve(host, port, family=self._family)
  File "/home/comp1/miniconda3/envs/hummingbot/lib/python3.8/site-packages/aiohttp/resolver.py", line 33, in resolve
    infos = await self._loop.getaddrinfo(
  File "/home/comp1/miniconda3/envs/hummingbot/lib/python3.8/asyncio/base_events.py", line 825, in getaddrinfo
    return await self.run_in_executor(
  File "/home/comp1/miniconda3/envs/hummingbot/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/comp1/miniconda3/envs/hummingbot/lib/python3.8/socket.py", line 918, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/comp1/development/hummingbot/connector/exchange/polkadex/polkadex_exchange.py", line 265, in _initialize_trading_pair_symbol_map
    mapping = await self._data_source.symbols_map()
  File "/home/comp1/development/hummingbot/connector/exchange/polkadex/polkadex_data_source.py", line 170, in symbols_map
    assets_map = await self.assets_map()
  File "/home/comp1/development/hummingbot/connector/exchange/polkadex/polkadex_data_source.py", line 153, in assets_map
    all_assets = await self._query_executor.all_assets()
  File "/home/comp1/development/hummingbot/connector/exchange/polkadex/polkadex_query_executor.py", line 109, in all_assets
    result = await self._execute_query(query=query, parameters=parameters)
  File "/home/comp1/development/hummingbot/connector/exchange/polkadex/polkadex_query_executor.py", line 376, in _execute_query
    result = await session.execute(query, variable_values=parameters, parse_result=True)
  File "/home/comp1/miniconda3/envs/hummingbot/lib/python3.8/site-packages/gql/client.py", line 1220, in execute
    result = await self._execute(
  File "/home/comp1/miniconda3/envs/hummingbot/lib/python3.8/site-packages/gql/client.py", line 1126, in _execute
    result = await asyncio.wait_for(
  File "/home/comp1/miniconda3/envs/hummingbot/lib/python3.8/asyncio/tasks.py", line 483, in wait_for
    return fut.result()
  File "/home/comp1/miniconda3/envs/hummingbot/lib/python3.8/site-packages/gql/transport/aiohttp.py", line 296, in execute
    async with self.session.post(self.url, ssl=self.ssl, **post_args) as resp:
  File "/home/comp1/miniconda3/envs/hummingbot/lib/python3.8/site-packages/aiohttp/client.py", line 1141, in __aenter__
    self._resp = await self._coro
  File "/home/comp1/miniconda3/envs/hummingbot/lib/python3.8/site-packages/aiohttp/client.py", line 536, in _request
    conn = await self._connector.connect(
  File "/home/comp1/miniconda3/envs/hummingbot/lib/python3.8/site-packages/aiohttp/connector.py", line 540, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/home/comp1/miniconda3/envs/hummingbot/lib/python3.8/site-packages/aiohttp/connector.py", line 901, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/home/comp1/miniconda3/envs/hummingbot/lib/python3.8/site-packages/aiohttp/connector.py", line 1166, in _create_direct_connection
    raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host gu5xqmhhcnfeveotzwhe6ohfba.appsync-api.eu-central-1.amazonaws.com:443 ssl:False [Name or service not known]
@petioptrv
Copy link
Contributor

@nikspz, polkadex is currently down for order book upgrade. Please see their post.

@nikspz
Copy link
Contributor Author

nikspz commented Jun 21, 2023

Okay, got it, thanks Petio

@peterwilli
Copy link
Contributor

peterwilli commented Jul 1, 2023

Can I ask why the entire bot is offline when one exchange doesnt work? I assume we can fix that right?

I dont use pollkadex myself.

@nikspz
Copy link
Contributor Author

nikspz commented Jul 3, 2023

hi @peterwilli, other connectors not affected by Polkadex issue

@peterwilli
Copy link
Contributor

It seems all DEX (gateway) connectors are affected. When I try this script:

from hummingbot.strategy.script_strategy_base import ScriptStrategyBase

class EmeraldFundScript(ScriptStrategyBase):
    markets = {
        "pancakeswap": {
            "btc-usdt-perp"
        }
    }

    def on_tick(self):
        self.logger().info("test")

or

from hummingbot.strategy.script_strategy_base import ScriptStrategyBase

class EmeraldFundScript(ScriptStrategyBase):
    markets = {
        "injective_perpetual": {
            "btc-usdt-perp"
        }
    }

    def on_tick(self):
        self.logger().info("test")

Both result in unhandled error in the logs, with the Polkadot error appearing before the scripts are run. Replace injective_perpetual by binance_paper_trade and it runs fine.

Armed with this new info, I'll try to fix the bug right now (hopefully not making it too late in the night).

@peterwilli
Copy link
Contributor

I found my issue! It was super confusing and had nothing to do with polkadex!

Instead of injective_perpetual or injective, you have to name your connections injective_perpetual_injective_mainnet or injective_injective_mainnet. I was really confused because the scripts started failing right around the Polkadex issue, but htey are completely unrelated!

@nikspz
Copy link
Contributor Author

nikspz commented Feb 2, 2024

Polkadex updates PRs merged here:
#6558
#6650

Can't reproduce on latest development (dev-1.25.0), and latest release 1.24.0

@nikspz nikspz closed this as completed Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants