-
Notifications
You must be signed in to change notification settings - Fork 529
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
Websocket exception #64
Comments
Same issue here; it does not reconnect as no new messages come through the stream. Alpaca never passes the exception. Could it be that the websocket doesn't raise an exception so that alpaca api cannot catch it? |
Its an open bug: https://github.com/aaugustin/websockets/labels/bug Its added as a milestone for the 8.0(https://github.com/aaugustin/websockets/milestone/4) release |
Could the reconnect handling that was added to polygon streamconn also be added to the default streamconn? |
I believe the websocket connection handling has changed over time. Please open a new issue if you encounter new one. |
The websocket sometimes gives an exception but it is not clear if it reconnects...
Task exception was never retrieved
future: <Task finished coro=<StreamConn._consume_msg() done, defined at /opt/conda/lib/python3.6/site-packages/alpaca_trade_api/stream2.py:46> exception=ConnectionClosed('WebSocket connection is closed: code = 1006 (connection closed abnormally [internal]), no reason',)>
Traceback (most recent call last):
File "/opt/conda/lib/python3.6/site-packages/websockets/protocol.py", line 674, in transfer_data
message = yield from self.read_message()
File "/opt/conda/lib/python3.6/site-packages/websockets/protocol.py", line 742, in read_message
frame = yield from self.read_data_frame(max_size=self.max_size)
File "/opt/conda/lib/python3.6/site-packages/websockets/protocol.py", line 815, in read_data_frame
frame = yield from self.read_frame(max_size)
File "/opt/conda/lib/python3.6/site-packages/websockets/protocol.py", line 884, in read_frame
extensions=self.extensions,
File "/opt/conda/lib/python3.6/site-packages/websockets/framing.py", line 99, in read
data = yield from reader(2)
File "/opt/conda/lib/python3.6/asyncio/streams.py", line 674, in readexactly
yield from self._wait_for_data('readexactly')
File "/opt/conda/lib/python3.6/asyncio/streams.py", line 464, in _wait_for_data
yield from self._waiter
concurrent.futures._base.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/conda/lib/python3.6/site-packages/alpaca_trade_api/stream2.py", line 50, in _consume_msg
r = await ws.recv()
File "/opt/conda/lib/python3.6/site-packages/websockets/protocol.py", line 434, in recv
yield from self.ensure_open()
File "/opt/conda/lib/python3.6/site-packages/websockets/protocol.py", line 658, in ensure_open
) from self.transfer_data_exc
websockets.exceptions.ConnectionClosed: WebSocket connection is closed: code = 1006 (connection closed abnormally [internal]), no reason
The text was updated successfully, but these errors were encountered: