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

ccxt async support suddenly throwing error - attached to a different loop #23193

Open
ggree1 opened this issue Jul 23, 2024 · 3 comments
Open
Assignees

Comments

@ggree1
Copy link

ggree1 commented Jul 23, 2024

Operating System

MacOS

Programming Languages

Python

CCXT Version

^4.3.37 to latest

Description

Today when I start my application on local mac book, async error thrown that I've never seen before.
Please refer the attached trace log.

Code

  File "/work/.venv/lib/python3.11/site-packages/ccxt/async_support/binance.py", line 9332, in fetch_positions
    return await self.fetch_positions_risk(symbols, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/.venv/lib/python3.11/site-packages/ccxt/async_support/binance.py", line 9403, in fetch_positions_risk
    await self.load_markets()
  File "/work/.venv/lib/python3.11/site-packages/ccxt/async_support/base/exchange.py", line 276, in load_markets
    raise e
  File "/work/.venv/lib/python3.11/site-packages/ccxt/async_support/base/exchange.py", line 272, in load_markets
    result = await self.markets_loading
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Task <Task pending name='Task-15' coro=<check_account() running at /work/app/scheduler/account_monitor.py:96> cb=[Task.task_wakeup()]> got Future <Task pending name='Task-44' coro=<Exchange.load_markets_helper() running at /work/.venv/lib/python3.11/site-packages/ccxt/async_support/base/exchange.py:253>> attached to a different loop

@ggree1 ggree1 closed this as completed Jul 23, 2024
@ggree1
Copy link
Author

ggree1 commented Jul 23, 2024

I'm also running this application on a cloud VM. It works well now.
So I all changed libraries versions to the same with cloud's But still same error.
I think it's only happening on macOS.
Could it be a problem of latest MacOS?

@ggree1 ggree1 reopened this Jul 23, 2024
@sc0Vu
Copy link
Contributor

sc0Vu commented Jul 25, 2024

@ggree1

Could you provide code snippet that we can reproduce this locally?

@sc0Vu sc0Vu self-assigned this Jul 25, 2024
@ggree1
Copy link
Author

ggree1 commented Jul 25, 2024

@ggree1

Could you provide code snippet that we can reproduce this locally?

My code is not that special, just simply using ccxt async support code.
But after upgrading my macOS version to 14.5 (sonoma),
there is a crash with ccxt async support and fastapi-utils library which I use for scheduling job on async code with @repeat_every decorator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants