Nonce is too small Error. When trying to use bitfinex exchange.
Just starting gekko
node gekko
Then i see some advices and then gekko stops with error:
Gekko encountered an error and can't continue
Error:
Error: Nonce is too small.
at Request._callback (/home/ubuntu/workspace/gekko/node_modules/bitfinex-api-node/rest.js:68:23)
at Request.self.callback (/home/ubuntu/workspace/gekko/node_modules/request/request.js:186:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:192:7)
at Request.<anonymous> (/home/ubuntu/workspace/gekko/node_modules/request/request.js:1081:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:189:7)
at IncomingMessage.<anonymous> (/home/ubuntu/workspace/gekko/node_modules/request/request.js:1001:12)
at Object.onceWrapper (events.js:291:19)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:186:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9) '\n\n'
Meta debug info:
Gekko version: v0.3.4
Nodejs version: v7.5.0
If i use log.debug in rest.js file (in bitfinex-api-node module):
function rest(key, secret, nonceGenerator) {
this.url = "https://api.bitfinex.com";
this.version = 'v1';
this.key = key;
this.secret = secret;
this.nonce = new Date().getTime();
this._nonce = typeof nonceGenerator === "function" ? nonceGenerator : function () {
//noinspection JSPotentiallyInvalidUsageOfThis
log.debug(this.nonce);
return ++this.nonce;
};
}
i see nonces logged in console, and see another error:
2017-02-21 16:39:10 (DEBUG): 1487695150056
2017-02-21 16:39:10 (DEBUG): 1487695150057
2017-02-21 16:39:10 (DEBUG): 1487695150058
2017-02-21 16:39:10 (DEBUG): 1487695150059
2017-02-21 16:39:10 (DEBUG): 1487695150060
2017-02-21 16:39:10 (DEBUG): 1487695150061
2017-02-21 16:39:10 (DEBUG): 1487695150062
2017-02-21 16:39:10 (DEBUG): 1487695150063
2017-02-21 16:39:10 (DEBUG): 1487695150064
2017-02-21 16:39:10 (DEBUG): 1487695150065
2017-02-21 16:39:10 (DEBUG): 1487695150066
2017-02-21 16:39:10 (DEBUG): 1487695150067
2017-02-21 16:39:10 (DEBUG): 1487695150068
2017-02-21 16:39:10 (DEBUG): 1487695150069
2017-02-21 16:39:10 (DEBUG): 1487695150070
2017-02-21 16:39:10 (DEBUG): 1487695150071
2017-02-21 16:39:10 (DEBUG): 1487695150072
2017-02-21 16:39:10 (DEBUG): 1487695150073
2017-02-21 16:39:10 (DEBUG): { type: 'exchange',
currency: 'btc',
amount: '1.0',
available: '1.0' }
/home/ubuntu/workspace/gekko/plugins/trader/portfolioManager.js:110
return this.getFund(fund).amount;
^
TypeError: Cannot read property 'amount' of undefined
at Manager.getBalance (/home/ubuntu/workspace/gekko/plugins/trader/portfolioManager.js:110:28)
at Manager.bound [as getBalance] (/home/ubuntu/workspace/gekko/node_modules/lodash/dist/lodash.js:729:21)
at Manager.act (/home/ubuntu/workspace/gekko/plugins/trader/portfolioManager.js:138:23)
at bound (/home/ubuntu/workspace/gekko/node_modules/lodash/dist/lodash.js:729:21)
at /home/ubuntu/workspace/gekko/node_modules/async/lib/async.js:232:13
at /home/ubuntu/workspace/gekko/node_modules/async/lib/async.js:142:25
at /home/ubuntu/workspace/gekko/node_modules/async/lib/async.js:229:17
at /home/ubuntu/workspace/gekko/node_modules/async/lib/async.js:556:34
at Manager.<anonymous> (/home/ubuntu/workspace/gekko/plugins/trader/portfolioManager.js:76:7)
at /home/ubuntu/workspace/gekko/exchanges/bitfinex.js:56:5
at Request._callback (/home/ubuntu/workspace/gekko/node_modules/bitfinex-api-node/rest.js:70:16)
at Request.self.callback (/home/ubuntu/workspace/gekko/node_modules/request/request.js:186:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:192:7)
at Request.<anonymous> (/home/ubuntu/workspace/gekko/node_modules/request/request.js:1081:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:189:7)
at IncomingMessage.<anonymous> (/home/ubuntu/workspace/gekko/node_modules/request/request.js:1001:12)
at Object.onceWrapper (events.js:291:19)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:186:7)
at endReadableNT (_stream_readable.js:974:12)
Sorry, it's not bound. I have Nonce error even if i log this:
2017-02-21 16:44:43 (DEBUG): 1487695483017
2017-02-21 16:44:43 (DEBUG): 1487695483018
2017-02-21 16:44:43 (DEBUG): 1487695483019
2017-02-21 16:44:43 (DEBUG): 1487695483020
2017-02-21 16:44:43 (DEBUG): 1487695483021
2017-02-21 16:44:43 (DEBUG): 1487695483022
2017-02-21 16:44:43 (DEBUG): 1487695483023
2017-02-21 16:44:43 (DEBUG): 1487695483024
2017-02-21 16:44:43 (DEBUG): 1487695483025
2017-02-21 16:44:43 (DEBUG): 1487695483026
2017-02-21 16:44:43 (DEBUG): 1487695483027
2017-02-21 16:44:43 (DEBUG): 1487695483028
2017-02-21 16:44:43 (DEBUG): 1487695483029
2017-02-21 16:44:43 (DEBUG): 1487695483030
Gekko encountered an error and can't continue
Error:
Error: Nonce is too small.
at Request._callback (/home/ubuntu/workspace/gekko/node_modules/bitfinex-api-node/rest.js:68:23)
at Request.self.callback (/home/ubuntu/workspace/gekko/node_modules/request/request.js:186:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:192:7)
at Request.<anonymous> (/home/ubuntu/workspace/gekko/node_modules/request/request.js:1081:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:189:7)
at IncomingMessage.<anonymous> (/home/ubuntu/workspace/gekko/node_modules/request/request.js:1001:12)
at Object.onceWrapper (events.js:291:19)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:186:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9) '\n\n'
Meta debug info:
Gekko version: v0.3.4
Nodejs version: v7.5.0
I've noticed that logging nonces a really strange. In unixtime it is like that: 1487695483030 = Wed, 12 Mar 49113 17:17:10 GMT
I think "Nonce too small" can be because any same process is running twice. But which process?...
I can take a look at this when I have time. Its very possible the bfx npm module is outdated and would need to be rewritten.
http://docs.bitfinex.com/v1/docs/rest-auth
Getting the same error with Poloniex.
same problem on the Bitfinex
Bitfinex problem
Still getting this on poloniex
I had this error when I ran gekko in a virtual machine on Windows 7. In my case it turned out to be time drift.
This is on ubuntu 16.04 and:
Nonce must be greater than 1905332886555001. You provided 149315522139600.
Is anyone else getting this issue on Poloniex?
@thegamecat please open a seperate issue for poloniex, this is definitely not the same problem!
I have worked on updating the codebase for bitfinex (as part of #737), in my testing I am unable to reproduce. I am closing this because I assume this is not an issue anymore, it it is please comment here :)
I have just had the same problem ... I have remove old api key/secret. Create a new one and now it s work.
I have this problem too on my local. On VPS working fine. Created new API doesnt help.
@askmike I can give You access to my local with anydesk to fix it if You want.
Same problem on Poloniex. Error: Nonce must be greater than 152510833507500. You provided 152510832809100