1006 (connection closed abnormally [internal]), no reason
See original GitHub issueHi, I am using pylivetrader to run my trade algo on a cloud VM. However, after running a while, I keep getting this error message: 1006 (connection closed abnormally [internal]), no reason
. I guess the cloud infra have some TCP timeout mechanism to trigger this websocket closed abnormally.
I guess the reason I got this error is that the code around here:
def _get_stream(self, context):
set_context(context)
asyncio.set_event_loop(asyncio.new_event_loop())
conn = tradeapi.StreamConn(self._key_id, self._secret, self._base_url)
channels = ['trade_updates']
Can you help to identify and fix the issue?
Thank you.
Issue Analytics
- State:
- Created 4 years ago
- Comments:51 (28 by maintainers)
Top Results From Across the Web
1006 Connection closed abnormally error with python 3.7 ...
it means that the TCP connection was lost. As a consequence, the WebSocket connection was closed without receiving a close frame, which is ......
Read more >websockets.exceptions.ConnectionClosedError: code = 1006 ...
I am implementing a websocket connection between a client and a server with a webrtс connection established. The server receives the data, processes...
Read more >1006 connection closed code but stream never restarts
WARNING [stream.py:224] websocket error, restarting connection: code = 1006 (connection closed abnormally [internal]), no reason.
Read more >FAQ — websockets 8.1 documentation
it means that the TCP connection was lost. As a consequence, the WebSocket connection was closed without receiving a close frame, which is...
Read more >What Is Meant By Channels Error 1006? - Pusher
When a WebSocket connection is closed without a "close frame", the pusher-js library emits an error with code 1006. Usually this is caused ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, thanks for your reply.
I’ve updated the packages as per your instructions and am currently testing it. I’ll let you know the results tomorrow.
Regards
you could try running the proxy-agent locally and use a debugger to see what’s wrong. or give me a code sample to execute locally