edeng23 / binance-trade-bot

Automated cryptocurrency trading bot
GNU General Public License v3.0
7.75k stars 2.16k forks source link

Face this issue:- CRITICAL:root:BinanceWebSocketApiSocket.start_socket(ec45ad51-a8ed-4f6b-9df4-dc602fd9f115, ['arr'], ['!miniTicker']) - Exception Connection Closed - error_msg: code = 1006 (connection closed abnormally [internal]), no reason #380

Open Muhammad-Zubair opened 3 years ago

Muhammad-Zubair commented 3 years ago

ERROR:root:BinanceWebSocketApiSocket.start_socket(ec45ad51-a8ed-4f6b-9df4-dc602fd9f115, ['arr'], ['!miniTicker'] socket_id=12b51d3d-36ef-495c-86b1-fe40c115ac8c recent_socket_id=12b51d3d-36ef-495c-86b1-fe40c115ac8c - Sending payload - exit because its not the recent socket id! stream_id=ec45ad51-a8ed-4f6b-9df4-dc602fd9f115, recent_socket_id=fd0f5f41-45bb-487c-a1c3-607148e788c6 CRITICAL:root:BinanceWebSocketApiSocket.start_socket(ac00fec3-5d4e-4938-a49d-ea6436b015af, ['arr'], ['!userData']) - Exception ConnectionClosed - error_msg: code = 1006 (connection closed abnormally [internal]), no reason CRITICAL:root:BinanceWebSocketApiManager.stream_is_crashing(ac00fec3-5d4e-4938-a49d-ea6436b015af) ERROR:root:BinanceWebSocketApiSocket.start_socket(ac00fec3-5d4e-4938-a49d-ea6436b015af, ['arr'], ['!userData'] socket_id=ca50421c-34eb-47e3-a0f7-2becff58979c recent_socket_id=ca50421c-34eb-47e3-a0f7-2becff58979c - Sending payload - exit because its not the recent socket id! stream_id=ac00fec3-5d4e-4938-a49d-ea6436b015af, recent_socket_id=4184db58-16bd-47e4-97c9-963a3fab4866 2021-06-20 12:11:14,191 - crypto_trading_logger - ERROR - Error while scouting... Traceback (most recent call last): File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 426, in _make_request six.raise_from(e, None) File "", line 3, in raise_from File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 421, in _make_request httplib_response = conn.getresponse() File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 1369, in getresponse response.begin() File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 310, in begin version, status, reason = self._read_status() File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 271, in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\socket.py", line 589, in readinto return self._sock.recv_into(b) File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 1071, in recv_into return self.read(nbytes, buffer) File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 929, in read return self._sslobj.read(len, buffer) socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\adapters.py", line 449, in send timeout=timeout File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 727, in urlopen method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\retry.py", line 403, in increment raise six.reraise(type(error), error, _stacktrace) File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\packages\six.py", line 735, in reraise raise value File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 677, in urlopen chunked=chunked, File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 428, in _make_request self._raise_timeout(err=e, url=url, timeout_value=read_timeout) File "C:\Users***\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 336, in _raise_timeout self, url, "Read timed out. (read timeout=%s)" % timeout_value urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='api.binance.com', port=443): Read timed out. (read timeout=10)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "E:\bot\binance_trade_bot\scheduler.py", line 25, in _run_job super()._run_job(job) File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\site-packages\schedule__init__.py", line 172, in _run_job ret = job.run() File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\site-packages\schedule__init__.py", line 661, in run ret = self.job_func() File "E:\bot\binance_trade_bot\strategies\default_strategy.py", line 33, in scout self._jump_to_best_coin(current_coin, current_coin_price) File "E:\bot\binance_trade_bot\auto_trader.py", line 139, in _jump_to_best_coin ratio_dict = self._get_ratios(coin, coin_price) File "E:\bot\binance_trade_bot\auto_trader.py", line 126, in _get_ratios transaction_fee = self.manager.get_fee(pair.from_coin, self.config.BRIDGE, True) + self.manager.get_fee( File "E:\bot\binance_trade_bot\binance_api_manager.py", line 70, in get_fee bnb_balance = self.get_currency_balance("BNB") File "E:\bot\binance_trade_bot\binance_api_manager.py", line 110, in get_currency_balance for currency_balance in self.binance_client.get_account()["balances"] File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\site-packages\binance\client.py", line 1912, in get_account return self._get('account', True, data=params) File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\site-packages\binance\client.py", line 320, in _get return self._request_api('get', path, signed, version, kwargs) File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\site-packages\binance\client.py", line 265, in _request_api return self._request(method, uri, signed, kwargs) File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\site-packages\binance\client.py", line 259, in _request self.response = getattr(self.session, method)(uri, kwargs) File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 543, in get return self.request('GET', url, kwargs) File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 530, in request resp = self.send(prep, send_kwargs) File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 643, in send r = adapter.send(request, kwargs) File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\adapters.py", line 529, in send raise ReadTimeout(e, request=request) requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.binance.com', port=443): Read timed out. (read timeout=10)

CRITICAL:root:BinanceWebSocketApiSocket.start_socket(ec45ad51-a8ed-4f6b-9df4-dc602fd9f115, ['arr'], ['!miniTicker']) - Exception ConnectionClosed - error_msg: code = 1006 (connection closed abnormally [internal]), no reason CRITICAL:root:BinanceWebSocketApiManager.stream_is_crashing(ec45ad51-a8ed-4f6b-9df4-dc602fd9f115) CRITICAL:root:BinanceWebSocketApiSocket.start_socket(ec45ad51-a8ed-4f6b-9df4-dc602fd9f115, ['arr'], ['!miniTicker']) - Exception ConnectionClosed - error_msg: code = 1006 (connection closed abnormally [internal]), no reason CRITICAL:root:BinanceWebSocketApiManager.stream_is_crashing(ec45ad51-a8ed-4f6b-9df4-dc602fd9f115) ERROR:root:BinanceWebSocketApiSocket.start_socket(ec45ad51-a8ed-4f6b-9df4-dc602fd9f115, ['arr'], ['!miniTicker'] socket_id=6e5e62d7-bd88-4575-89f6-79b114384ac2 recent_socket_id=6e5e62d7-bd88-4575-89f6-79b114384ac2 - Sending payload - exit because its not the recent socket id! stream_id=ec45ad51-a8ed-4f6b-9df4-dc602fd9f115, recent_socket_id=733e8879-1167-4378-ac9a-5a549fa14645 CRITICAL:root:BinanceWebSocketApiSocket.start_socket(ec45ad51-a8ed-4f6b-9df4-dc602fd9f115, ['arr'], ['!miniTicker']) - Exception ConnectionClosed - error_msg: code = 1006 (connection closed abnormally [internal]), no reason CRITICAL:root:BinanceWebSocketApiManager.stream_is_crashing(ec45ad51-a8ed-4f6b-9df4-dc602fd9f115) ERROR:root:BinanceWebSocketApiSocket.start_socket(ec45ad51-a8ed-4f6b-9df4-dc602fd9f115, ['arr'], ['!miniTicker'] socket_id=24d39302-9c12-485f-8544-2159424994c0 recent_socket_id=24d39302-9c12-485f-8544-2159424994c0 - Sending payload - exit because its not the recent socket id! stream_id=ec45ad51-a8ed-4f6b-9df4-dc602fd9f115, recent_socket_id=76260f9a-44be-4437-9c76-8d2c859fbe53 CRITICAL:root:BinanceWebSocketApiSocket.start_socket(ec45ad51-a8ed-4f6b-9df4-dc602fd9f115, ['arr'], ['!miniTicker']) - Exception ConnectionClosed - error_msg: code = 1006 (connection closed abnormally [internal]), no reason CRITICAL:root:BinanceWebSocketApiManager.stream_is_crashing(ec45ad51-a8ed-4f6b-9df4-dc602fd9f115) CRITICAL:root:BinanceWebSocketApiSocket.start_socket(ec45ad51-a8ed-4f6b-9df4-dc602fd9f115, ['arr'], ['!miniTicker']) - Exception ConnectionClosed - error_msg: code = 1006 (connection closed abnormally [internal]), no reason CRITICAL:root:BinanceWebSocketApiManager.stream_is_crashing(ec45ad51-a8ed-4f6b-9df4-dc602fd9f115) CRITICAL:root:BinanceWebSocketApiSocket.start_socket(ec45ad51-a8ed-4f6b-9df4-dc602fd9f115, ['arr'], ['!miniTicker']) - Exception ConnectionClosed - error_msg: code = 1006 (connection closed abnormally [internal]), no reason CRITICAL:root:BinanceWebSocketApiManager.stream_is_crashing(ec45ad51-a8ed-4f6b-9df4-dc602fd9f115) CRITICAL:root:BinanceWebSocketApiSocket.start_socket(ec45ad51-a8ed-4f6b-9df4-dc602fd9f115, ['arr'], ['!miniTicker']) - Exception ConnectionClosed - error_msg: code = 1006 (connection closed abnormally [internal]), no reason CRITICAL:root:BinanceWebSocketApiManager.stream_is_crashing(ec45ad51-a8ed-4f6b-9df4-dc602fd9f115) ERROR:root:BinanceWebSocketApiSocket.start_socket(ec45ad51-a8ed-4f6b-9df4-dc602fd9f115, ['arr'], ['!miniTicker'] socket_id=a9801a4e-9201-4343-88f2-e2b39f902cea recent_socket_id=a9801a4e-9201-4343-88f2-e2b39f902cea - Sending payload - exit because its not the recent socket id! stream_id=ec45ad51-a8ed-4f6b-9df4-dc602fd9f115, recent_socket_id=fea22eef-5705-4d97-8cb5-0d665d34cae0

oliver-zehentleitner commented 3 years ago

https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api/issues/113