-
Notifications
You must be signed in to change notification settings - Fork 2k
Binance API cannot be used to trade. Error: binance {"code":-1021,"msg":"Timestamp for this request is outside of the recvWindow." #1647
Comments
Is your systemdate correct? Do you have an NTP client running? |
It's correct. NTP is default running in MacOS, which is using 'time.apple.com'. |
I have the same issue on both Windows and Mac with zenbot on Docker.
Mac is set to update time from Apple, Windows from time.nist.gov. However, the problem seems to be related to the time in the Docker container. On my Windows machine:
Possibly because...
From a shell in the container, I tried to resolve with...
but
From here I tried...
but
and...
similarly results in,
Then I tried a javascript package from (here)[https://www.npmjs.com/package/ntp-client], but...
I could probably fight my way through installation of an ntp updating tool, but the Windows server container is built on I would be happy to test potential Windows solutions. As for Mac, Docker pushed solution in 17.05.0-ce-mac9 in 05/2017. I need to check what version I'm on, but I would think that I should be beyond that build. My plan for later tonight is to append to the volumes key in
Alternatively, I have seen discussion of the binance api being especially time sensitive and a potential solution is here. |
My version of Docker for Mac is 18.03.1-ce-mac65 which should presumably contain the time fix referenced above. Here's the time in the container vs my system.
I was not able to bind time information from the host as,
At this point. I'm stuck. Can someone else confirm that Docker containers are a worm hole in time or point me in the right direction? |
From this post it seems that time in the docker for mac container drifts away from the system time. There may be a more elegant solution, but I added a new command to the After executing I pushed this solution in PR #1659 |
@jraviotta Thanks Jraviotta, I will try. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
System information
c.selector = 'binance.ETH-USDT'
c.strategy = 'trend_ema'
Describe the problem
Binance API cannot be used to trade.
Source code / Error logs
Binance API is down! unable to call getBalance, retrying in 20s
[ { currency: 'USDT', asset: 'ETH' } ]
An error occurred { Error: binance {"code":-1021,"msg":"Timestamp for this request is outside of the recvWindow."}
at binance.handleErrors (/Users/brucelee/projects/eth/zenbot/node_modules/ccxt/js/binance.js:863:31)
at response.text.then (/Users/brucelee/projects/eth/zenbot/node_modules/ccxt/js/base/Exchange.js:513:18)
at
at process._tickCallback (internal/process/next_tick.js:182:7) constructor: [Function: InvalidNonce] }
The text was updated successfully, but these errors were encountered: