Websocket forcibly closed by remote host
Hi All,
Is anyone else receiving the following when using the websockets / have any recommended solutions?
[WinError 10054] An existing connection was forcibly closed by the remote host - data: None
My websocket connection seems to perform fine for about 20 seconds, and then this error occurs.
Thanks in advance!
Update - It looks like installing cbpro through pip does not provide the most up-to-date websocket_client.py. I copied and pasted the code available here in GitHub into package websocket_client.py file from pip; that appears to have resolved the issue.
Further update - while the current code available on GitHub stops the issue from occurring every couple minutes, I'm still encountering the issue every 30 minutes or so. I've added a auto-reconnect workaround when the error is encountered, but it's obviously not ideal. Anyone know what is causing the error in the first place?
Yes its an issue we encountered. Reconnecting didn't help because sometimes it disconnected very quickly (within seconds) without even telling you right ? Because this is my case. Did you try from scratch with the native coinbase WS api to get the data ?
Same issue re: disconnecting without telling you, although most of my disconnects are of the type in my prompt - forcibly closed. I added some additional checks in my code to confirm whether messages are being received. It can be a couple minutes before I'm able to re-establish a somewhat stable connection. I haven't tried from scratch yet. Any ideas as to what's causing the issues?
Are you still seeing this issue @simaster123 ?
Seeing a similar issue - created a new one before I noticed this
websocket_client.py
Which one is being used?
ls -al /usr/local/lib/python3.6/dist-packages/cbpro/websocket_client.py 4812 Dec 12 23:01 /usr/local/lib/python3.6/dist-packages/cbpro/websocket_client.py ls -al /usr/local/lib/python3.6/dist-packages/gdax/websocket_client.py 3187 Dec 12 23:01 /usr/local/lib/python3.6/dist-packages/gdax/websocket_client.py
I am also wrestling with this error. It didn't seem to be a problem when I was subscribed to the ticker channel, but every since I started using level 2 it has become a problem.
Is this the same as #341? If so, I too am experiencing the issue.
Connecting constantly is the only sure solution. And then it is simply necessary to build a technical solution that does not fail on an occasional missed message. Lets say you miss one message out of 1000. Should that interfere with your trading set-up? Lets hope not. The system must be robust enough to handle outages from time to time, because they do happen for a variety of reasons.
Also, there is no reason to use the cbpro websocket client. To me it seems clunky. Make your own connections using websocket for better control of the process. Its only a few lines of code to subscribe and resubscribe at will. Then find a way (hint, memcashe) to keep the feed running in its own window for monitoring so it can be restarted when problems arise. Thats all I can say about the feed. It seems silly to be connecting all the time, but thats how you ensure it works with these limited tools.