Closed skmanish closed 1 year ago
I am pretty sure that this is not a bug.
This is not an educated guess, but since you are using macOS, I assume this is not a server in a data center. Binance usually sends an ECONNRESET. I suspect your internet connection, power saving mode or something like that is the reason. Try using a small server in a data center.
You may be interested in this discussion: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/discussions/255
You could try a CX21 VM with Debian or another lean Linux: https://www.hetzner.com/cloud
I signed up for Hetzner's referral program so I can offer 20 EUR startup credit and also get a small benefit if the customer stays. I am a customer there myself and also some of my customers have servers there. We are very satisfied.
If the error remains, I need please a logfile and a whole script, I don't know your process_new_receives()
function, also here the error could be caused (not if only a print()
is done).
Thanks for your very elaborate reply Oliver - and awesome job maintaining this script!!
I already have a google compute engine instance, so I will run the script there and hope it works out fine - will let you know if this fixes
With pleasure! I would be happy to receive feedback!
Just an other question... the stream did restart after crashing oder did it break the execution?
Stream did not restart itself (atleast not until several hours)
Ok, then you should also look into the mentioned link from the error log: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/issues/299
And try this code structure: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/issues/299#issuecomment-1482809641
So here are 2 issues...
I think its all answered, if you still have problems, please reopen or post an update here. thx.
Version of this library.
unicorn-binance-websocket-api - version 1.46.0 websockets 10.4
Solution to Issue cannot be found in the documentation or other Issues and also occurs in the latest version of this library.
Hardware?
Local server/workstation
Operating System?
macOS
Python version?
Python3.7
Installed packages
No response
Logging output
No response
Processing method?
process_stream_data
Used endpoint?
binance.com
Issue
Here is the small code that I am using to get BTC/USDT and ETH/USDT prices - I want to run this script over days without crashing:
I am getting the following error
I understand that Binance websocket streams might not work after 24 hours, but the websocket is terminating after random periods - could be 40 minutes, 2 hours, 20 hours etc