Futures API losing connection to the Binance server

Hello, first of all thanks for any kind of help.

I have 4 bots making requests through the API to make trades.

Tonight, 3 of them failed in different times (2.10am, 2.13 am, 4.30 am), with errors like this one:

File “/usr/lib/python3.8/http/client.py”, line 1348, in getresponse
response.begin()
File “/usr/lib/python3.8/http/client.py”, line 316, in begin
version, status, reason = self._read_status()
File “/usr/lib/python3.8/http/client.py”, line 285, in _read_status
raise RemoteDisconnected(“Remote end closed connection without”
http.client.RemoteDisconnected: Remote end closed connection without response

or this one

File “/usr/lib/python3.8/http/client.py”, line 1348, in getresponse
response.begin()
File “/usr/lib/python3.8/http/client.py”, line 316, in begin
version, status, reason = self._read_status()
File “/usr/lib/python3.8/http/client.py”, line 277, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), “iso-8859-1”)
File “/usr/lib/python3.8/socket.py”, line 669, in readinto
return self._sock.recv_into(b)
File “/usr/lib/python3.8/ssl.py”, line 1241, in recv_into
return self.read(nbytes, buffer)
File “/usr/lib/python3.8/ssl.py”, line 1099, in read
return self._sslobj.read(len, buffer)
ConnectionResetError: [Errno 104] Connection reset by peer

What can be happening? Please help!

Can you provide more detailed information regarding the implementation?

Which endpoints failed?

I am using Python SDK which is mentioned in the official documentation. I need to periodically get information from /fapi/v2/positionRisk endpoint. I don’t know whether it is SDK or API bug, but I got the same error very often (literally every second request).

Error:
requests.exceptions.ConnectionError: (‘Connection aborted.’, RemoteDisconnected(‘Remote end closed connection without response’).
Python version: 3.9
sdk version: binance-futures-connector==3.3.1

Me too i have receive many times this errors.
If you want your bot not close, and you use While you can use try-except for not close and try the conection to API.