Task exception was never retrieved
future: <Task finished name='Task-2512' coro=<binance_live() done, defined at bedit_prod.py:46> exception=BinanceAPIException(<ClientResponse(https://fapi.binance.co
m/fapi/v2/balance?timestamp=1701958984031&signature=xxxxxxx) [400 Bad Request]>
<CIMultiDictProxy('Date': 'Thu, 07 Dec 2023 14:23:02 GMT', 'Content-Type': 'application/json', 'Content-Length': '88', 'Connection': 'keep-alive', 'Server': 'Tengine
', 'x-mbx-used-weight-1m': '2', 'x-response-time': '0ms', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS')>
, 400, '{"code":-1021,"msg":"Timestamp for this request was 1000ms ahead of the server\'s time."}')>
Traceback (most recent call last):
File "test_timestamp.py", line 48, in binance_live
await bot.futures_account_balance()
File "/usr/local/lib/python3.8/dist-packages/binance/client.py", line 8970, in futures_account_balance
return await self._request_futures_api('get', 'balance', True, version=2, data=params)
File "/usr/local/lib/python3.8/dist-packages/binance/client.py", line 7921, in _request_futures_api
return await self._request(method, uri, signed, True, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/binance/client.py", line 7899, in _request
return await self._handle_response(response)
File "/usr/local/lib/python3.8/dist-packages/binance/client.py", line 7907, in _handle_response
raise BinanceAPIException(response, response.status, await response.text())
binance.exceptions.BinanceAPIException: APIError(code=-1021): Timestamp for this request was 1000ms ahead of the server's time.
Task exception was never retrieved.
I shouldn't get this issue if the time is synchronized, right? Mysteriously, the code works fine if I just rerun it.
OS: Ubuntu 20.04 Python: v3.8.10 python-binance: v1.0.19
The same code worked fine, but after updating to the newest version, I am getting this issue repeatedly.
I checked if there's something wrong with My Server clock using this code :
I ran this above code at the time I was getting the errors on tmux
The code I am using
I shouldn't get this issue if the time is synchronized, right? Mysteriously, the code works fine if I just rerun it.