Here are the error logs, Note this was streaming fine until I check my container instance logs with several of this error logs with no change to the source code. Please help.
TypeError: BaseEventLoop.create_connection() got an unexpected keyword argument 'extra_headers'
error during websocket communication: BaseEventLoop.create_connection() got an unexpected keyword argument 'extra_headers'
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/alpaca/data/live/websocket.py", line 342, in _run_forever
await self._start_ws()
File "/usr/local/lib/python3.11/site-packages/alpaca/data/live/websocket.py", line 133, in _start_ws
await self._connect()
File "/usr/local/lib/python3.11/site-packages/alpaca/data/live/websocket.py", line 97, in _connect
self._ws = await websockets.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/websockets/asyncio/client.py", line 441, in __await_impl__
self.connection = await self.create_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/websockets/asyncio/client.py", line 367, in create_connection
_, connection = await loop.create_connection(factory, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: BaseEventLoop.create_connection() got an unexpected keyword argument 'extra_headers' ```
### Expected Behavior
Data streaming according to the docs
```PYTHON
from alpaca.trading.stream import TradingStream
trading_stream = TradingStream('api-key', 'secret-key', paper=True)
async def update_handler(data):
# trade updates will arrive in our async handler
print(data)
# subscribe to trade updates and supply the handler as a parameter
trading_stream.subscribe_trade_updates(update_handler)
# start our websocket streaming
trading_stream.run()```
### SDK Version I encountered this issue in
latest version
### Steps To Reproduce
```markdown
from alpaca.trading.stream import TradingStream
trading_stream = TradingStream('api-key', 'secret-key', paper=True)
async def update_handler(data):
# trade updates will arrive in our async handler
print(data)
# subscribe to trade updates and supply the handler as a parameter
trading_stream.subscribe_trade_updates(update_handler)
# start our websocket streaming
trading_stream.run()
Filled out the Steps to Reproduce section?
[X] I have entered valid steps to reproduce my issue or have attached a minimally reproducible case in code that shows my issue happening; and understand that without this my issue will be flagged as invalid and closed after 30 days.
Is there an existing issue for this?
Current Behavior
Here are the error logs, Note this was streaming fine until I check my container instance logs with several of this error logs with no change to the source code. Please help.
Filled out the Steps to Reproduce section?
Anything else?
No response