Momentum-Trading-Example icon indicating copy to clipboard operation
Momentum-Trading-Example copied to clipboard

RuntimeWarning: coroutine 'StreamConn.close' was never awaited

Open stabless opened this issue 4 years ago • 4 comments

Interesting problem - any ideas what is causing this ?

354/354 Success. Watching 354 symbols. WARNING:root:code = 1000 (OK), no reason :375: RuntimeWarning: coroutine 'StreamConn.close' was never awaited conn.close() RuntimeWarning: Enable tracemalloc to get the object allocation traceback Cannot close a running event loop WARNING:root:code = 1000 (OK), no reason Cannot close a running event loop WARNING:root:code = 1000 (OK), no reason Cannot close a running event loop WARNING:root:code = 1000 (OK), no reason Cannot close a running event loop WARNING:root:code = 1000 (OK), no reason Cannot close a running event loop WARNING:root:code = 1000 (OK), no reason Cannot close a running event loop WARNING:root:code = 1000 (OK), no reason Cannot close a running event loop WARNING:root:code = 1000 (OK), no reason Cannot close a running event loop WARNING:root:code = 1000 (OK), no reason Cannot close a running event loop WARNING:root:code = 1000 (OK), no reason Cannot close a running event loop WARNING:root:code = 1000 (OK), no reason WARNING:root:server rejected WebSocket connection: HTTP 429 Cannot close a running event loop WARNING:root:code = 1000 (OK), no reason WARNING:root:server rejected WebSocket connection: HTTP 429 WARNING:root:server rejected WebSocket connection: HTTP 429 Cannot close a running event loop Cannot close a running event loop

stabless avatar Mar 31 '20 20:03 stabless

@stabless did you ever figure this out?

nhodges avatar May 22 '20 17:05 nhodges

@stabless did you ever figure this out?

thepetlyon avatar Jun 09 '20 22:06 thepetlyon

I am getting a similar message. Does anyone know how to debug this?

Getting current ticker data... Success. Tracking 226 symbols. Getting historical data... 1/226 . . . 226/226 Success. Watching 226 symbols. unknown channel A.BBAR (you may need to specify the right data_stream) algo.py:386: RuntimeWarning: coroutine 'StreamConn.close' was never awaited conn.close() RuntimeWarning: Enable tracemalloc to get the object allocation traceback Event loop is closed . . . Event loop is closed Fatal Python error: Cannot recover from stack overflow. Current thread 0x00007f681b498740 (most recent call first): File "/usr/lib/python3.7/asyncio/base_events.py", line 480 in _check_closed File "/usr/lib/python3.7/asyncio/base_events.py", line 560 in run_until_complete File "/usr/local/lib/python3.7/dist-packages/alpaca_trade_api/stream2.py", line 275 in run File "algo.py", line 383 in run_ws . . . File "algo.py", line 387 in run_ws ... Aborted

BlueMistTrekker avatar Jun 25 '20 14:06 BlueMistTrekker

BlueMistTrekker, I am getting the same error. Let me know if you find a solution.

sanzgiri avatar Jun 30 '20 00:06 sanzgiri