Closed mor-o closed 6 years ago
@mor-o can you please update your software to the lastest version and provide additional information
looking at 1520 in our code suggest you are on an old version.
This bug may have been fixed 26 days ago.
https://github.com/jaggedsoft/node-binance-api/commit/ee82114d2859479c2f1fcf6862ee7a9d69148502
I am working with the latest release and saw this error today twice after some time.
depthHandler: [GTOBTC] Incorrect update ID. The depth cache is out of sync.
CombinedStream: Subscribed to [707487233] gtobtc@depth
WebSocket error: 707487233 Unexpected server response: 504
WebSocket closed: 707487233 (1006)
WebSocket reconnecting: 707487233...
CombinedStream: Subscribed to [707487233] gtobtc@depth
depthHandler: [GTOBTC] Incorrect update ID. The depth cache is out of sync.
CombinedStream: Subscribed to [707487233] gtobtc@depth
depthHandler: [GTOBTC] Skip count exceeded. The depth cache is out of sync.
depthHandler and Combined Stream messages we're repeated endlessly - I had to restart my bot to take care of it. Then a new websocket subscription went flawlessly.
sorry, this still happens. here are the logs:
2018-5-14 12:22:11 INFO: binance:depthHandler: [LTCBTC] Incorrect update ID. The depth cache is out of sync.
2018-5-14 12:22:11 INFO: binance:CombinedStream: Subscribed to [2785022752] ethbtc@depth/ltcbtc@depth/bnbbtc@depth/neobtc@depth/bccbtc@depth/gasbtc@depth/hsrbtc@depth/mcobtc@depth/wtcbtc@depth/lrcbtc@depth/qtumbtc@depth/yoyobtc@depth/omgbtc@depth/zrxbtc@depth/stratbtc@depth/snglsbtc@depth/bqxbtc@depth/kncbtc@depth/funbtc@depth/snmbtc@depth/iotabtc@depth/linkbtc@depth/xvgbtc@depth/saltbtc@depth/mdabtc@depth/mtlbtc@depth/subbtc@depth/eosbtc@depth/sntbtc@depth/etcbtc@depth/mthbtc@depth/engbtc@depth/dntbtc@depth/zecbtc@depth/bntbtc@depth/astbtc@depth/dashbtc@depth/oaxbtc@depth/icnbtc@depth/btgbtc@depth/evxbtc@depth/reqbtc@depth/vibbtc@depth/trxbtc@depth/powrbtc@depth/arkbtc@depth/xrpbtc@depth/modbtc@depth/enjbtc@depth/storjbtc@depth/venbtc@depth/kmdbtc@depth/rcnbtc@depth/nulsbtc@depth/rdnbtc@depth/xmrbtc@depth/dltbtc@depth/ambbtc@depth/batbtc@depth/bcptbtc@depth/arnbtc@depth/gvtbtc@depth/cdtbtc@depth/gxsbtc@depth/poebtc@depth/qspbtc@depth/btsbtc@depth/xzcbtc@depth/lskbtc@depth/tntbtc@depth/fuelbtc@depth/manabtc@depth/bcdbtc@depth/dgdbtc@depth/adxbtc@depth/adabtc@depth/pptbtc@depth/cmtbtc@depth/xlmbtc@depth/cndbtc@depth/lendbtc@depth/wabibtc@depth/tnbbtc@depth/wavesbtc@depth/gtobtc@depth/icxbtc@depth/ostbtc@depth/elfbtc@depth/aionbtc@depth/neblbtc@depth/brdbtc@depth/edobtc@depth/wingsbtc@depth/navbtc@depth/lunbtc@depth/trigbtc@depth/appcbtc@depth/vibebtc@depth/rlcbtc@depth/insbtc@depth/pivxbtc@depth/iostbtc@depth/chatbtc@depth/steembtc@depth/nanobtc@depth/viabtc@depth/blzbtc@depth/aebtc@depth/rpxbtc@depth/ncashbtc@depth/poabtc@depth/zilbtc@depth/ontbtc@depth/stormbtc@depth/xembtc@depth/wprbtc@depth/qlcbtc@depth/sysbtc@depth/grsbtc@depth/cloakbtc@depth/repbtc@depth/btcusdt@depth
2018-5-14 12:22:14 INFO: binance:depthHandler: [CMTBTC] Incorrect update ID. The depth cache is out of sync.
2018-5-14 12:22:14 INFO: binance:CombinedStream: Subscribed to [2785022752] ethbtc@depth/ltcbtc@depth/bnbbtc@depth/neobtc@depth/bccbtc@depth/gasbtc@depth/hsrbtc@depth/mcobtc@depth/wtcbtc@depth/lrcbtc@depth/qtumbtc@depth/yoyobtc@depth/omgbtc@depth/zrxbtc@depth/stratbtc@depth/snglsbtc@depth/bqxbtc@depth/kncbtc@depth/funbtc@depth/snmbtc@depth/iotabtc@depth/linkbtc@depth/xvgbtc@depth/saltbtc@depth/mdabtc@depth/mtlbtc@depth/subbtc@depth/eosbtc@depth/sntbtc@depth/etcbtc@depth/mthbtc@depth/engbtc@depth/dntbtc@depth/zecbtc@depth/bntbtc@depth/astbtc@depth/dashbtc@depth/oaxbtc@depth/icnbtc@depth/btgbtc@depth/evxbtc@depth/reqbtc@depth/vibbtc@depth/trxbtc@depth/powrbtc@depth/arkbtc@depth/xrpbtc@depth/modbtc@depth/enjbtc@depth/storjbtc@depth/venbtc@depth/kmdbtc@depth/rcnbtc@depth/nulsbtc@depth/rdnbtc@depth/xmrbtc@depth/dltbtc@depth/ambbtc@depth/batbtc@depth/bcptbtc@depth/arnbtc@depth/gvtbtc@depth/cdtbtc@depth/gxsbtc@depth/poebtc@depth/qspbtc@depth/btsbtc@depth/xzcbtc@depth/lskbtc@depth/tntbtc@depth/fuelbtc@depth/manabtc@depth/bcdbtc@depth/dgdbtc@depth/adxbtc@depth/adabtc@depth/pptbtc@depth/cmtbtc@depth/xlmbtc@depth/cndbtc@depth/lendbtc@depth/wabibtc@depth/tnbbtc@depth/wavesbtc@depth/gtobtc@depth/icxbtc@depth/ostbtc@depth/elfbtc@depth/aionbtc@depth/neblbtc@depth/brdbtc@depth/edobtc@depth/wingsbtc@depth/navbtc@depth/lunbtc@depth/trigbtc@depth/appcbtc@depth/vibebtc@depth/rlcbtc@depth/insbtc@depth/pivxbtc@depth/iostbtc@depth/chatbtc@depth/steembtc@depth/nanobtc@depth/viabtc@depth/blzbtc@depth/aebtc@depth/rpxbtc@depth/ncashbtc@depth/poabtc@depth/zilbtc@depth/ontbtc@depth/stormbtc@depth/xembtc@depth/wprbtc@depth/qlcbtc@depth/sysbtc@depth/grsbtc@depth/cloakbtc@depth/repbtc@depth/btcusdt@depth
2018-5-14 12:22:16 INFO: binance:depthHandler: [LTCBTC] Incorrect update ID. The depth cache is out of sync.
2018-5-14 12:22:16 INFO: binance:CombinedStream: Subscribed to [2785022752] ethbtc@depth/ltcbtc@depth/bnbbtc@depth/neobtc@depth/bccbtc@depth/gasbtc@depth/hsrbtc@depth/mcobtc@depth/wtcbtc@depth/lrcbtc@depth/qtumbtc@depth/yoyobtc@depth/omgbtc@depth/zrxbtc@depth/stratbtc@depth/snglsbtc@depth/bqxbtc@depth/kncbtc@depth/funbtc@depth/snmbtc@depth/iotabtc@depth/linkbtc@depth/xvgbtc@depth/saltbtc@depth/mdabtc@depth/mtlbtc@depth/subbtc@depth/eosbtc@depth/sntbtc@depth/etcbtc@depth/mthbtc@depth/engbtc@depth/dntbtc@depth/zecbtc@depth/bntbtc@depth/astbtc@depth/dashbtc@depth/oaxbtc@depth/icnbtc@depth/btgbtc@depth/evxbtc@depth/reqbtc@depth/vibbtc@depth/trxbtc@depth/powrbtc@depth/arkbtc@depth/xrpbtc@depth/modbtc@depth/enjbtc@depth/storjbtc@depth/venbtc@depth/kmdbtc@depth/rcnbtc@depth/nulsbtc@depth/rdnbtc@depth/xmrbtc@depth/dltbtc@depth/ambbtc@depth/batbtc@depth/bcptbtc@depth/arnbtc@depth/gvtbtc@depth/cdtbtc@depth/gxsbtc@depth/poebtc@depth/qspbtc@depth/btsbtc@depth/xzcbtc@depth/lskbtc@depth/tntbtc@depth/fuelbtc@depth/manabtc@depth/bcdbtc@depth/dgdbtc@depth/adxbtc@depth/adabtc@depth/pptbtc@depth/cmtbtc@depth/xlmbtc@depth/cndbtc@depth/lendbtc@depth/wabibtc@depth/tnbbtc@depth/wavesbtc@depth/gtobtc@depth/icxbtc@depth/ostbtc@depth/elfbtc@depth/aionbtc@depth/neblbtc@depth/brdbtc@depth/edobtc@depth/wingsbtc@depth/navbtc@depth/lunbtc@depth/trigbtc@depth/appcbtc@depth/vibebtc@depth/rlcbtc@depth/insbtc@depth/pivxbtc@depth/iostbtc@depth/chatbtc@depth/steembtc@depth/nanobtc@depth/viabtc@depth/blzbtc@depth/aebtc@depth/rpxbtc@depth/ncashbtc@depth/poabtc@depth/zilbtc@depth/ontbtc@depth/stormbtc@depth/xembtc@depth/wprbtc@depth/qlcbtc@depth/sysbtc@depth/grsbtc@depth/cloakbtc@depth/repbtc@depth/btcusdt@depth
2018-5-14 12:22:16 INFO: binance:depthHandler: [RLCBTC] Skip count exceeded. The depth cache is out of sync.
2018-5-14 12:22:16 INFO: binance:CombinedStream: Subscribed to [2785022752] ethbtc@depth/ltcbtc@depth/bnbbtc@depth/neobtc@depth/bccbtc@depth/gasbtc@depth/hsrbtc@depth/mcobtc@depth/wtcbtc@depth/lrcbtc@depth/qtumbtc@depth/yoyobtc@depth/omgbtc@depth/zrxbtc@depth/stratbtc@depth/snglsbtc@depth/bqxbtc@depth/kncbtc@depth/funbtc@depth/snmbtc@depth/iotabtc@depth/linkbtc@depth/xvgbtc@depth/saltbtc@depth/mdabtc@depth/mtlbtc@depth/subbtc@depth/eosbtc@depth/sntbtc@depth/etcbtc@depth/mthbtc@depth/engbtc@depth/dntbtc@depth/zecbtc@depth/bntbtc@depth/astbtc@depth/dashbtc@depth/oaxbtc@depth/icnbtc@depth/btgbtc@depth/evxbtc@depth/reqbtc@depth/vibbtc@depth/trxbtc@depth/powrbtc@depth/arkbtc@depth/xrpbtc@depth/modbtc@depth/enjbtc@depth/storjbtc@depth/venbtc@depth/kmdbtc@depth/rcnbtc@depth/nulsbtc@depth/rdnbtc@depth/xmrbtc@depth/dltbtc@depth/ambbtc@depth/batbtc@depth/bcptbtc@depth/arnbtc@depth/gvtbtc@depth/cdtbtc@depth/gxsbtc@depth/poebtc@depth/qspbtc@depth/btsbtc@depth/xzcbtc@depth/lskbtc@depth/tntbtc@depth/fuelbtc@depth/manabtc@depth/bcdbtc@depth/dgdbtc@depth/adxbtc@depth/adabtc@depth/pptbtc@depth/cmtbtc@depth/xlmbtc@depth/cndbtc@depth/lendbtc@depth/wabibtc@depth/tnbbtc@depth/wavesbtc@depth/gtobtc@depth/icxbtc@depth/ostbtc@depth/elfbtc@depth/aionbtc@depth/neblbtc@depth/brdbtc@depth/edobtc@depth/wingsbtc@depth/navbtc@depth/lunbtc@depth/trigbtc@depth/appcbtc@depth/vibebtc@depth/rlcbtc@depth/insbtc@depth/pivxbtc@depth/iostbtc@depth/chatbtc@depth/steembtc@depth/nanobtc@depth/viabtc@depth/blzbtc@depth/aebtc@depth/rpxbtc@depth/ncashbtc@depth/poabtc@depth/zilbtc@depth/ontbtc@depth/stormbtc@depth/xembtc@depth/wprbtc@depth/qlcbtc@depth/sysbtc@depth/grsbtc@depth/cloakbtc@depth/repbtc@depth/btcusdt@depth
2018-5-14 12:22:16 INFO: binance:depthHandler: [ARKBTC] Skip count exceeded. The depth cache is out of sync.
2018-5-14 12:22:16 INFO: binance:CombinedStream: Subscribed to [2785022752] ethbtc@depth/ltcbtc@depth/bnbbtc@depth/neobtc@depth/bccbtc@depth/gasbtc@depth/hsrbtc@depth/mcobtc@depth/wtcbtc@depth/lrcbtc@depth/qtumbtc@depth/yoyobtc@depth/omgbtc@depth/zrxbtc@depth/stratbtc@depth/snglsbtc@depth/bqxbtc@depth/kncbtc@depth/funbtc@depth/snmbtc@depth/iotabtc@depth/linkbtc@depth/xvgbtc@depth/saltbtc@depth/mdabtc@depth/mtlbtc@depth/subbtc@depth/eosbtc@depth/sntbtc@depth/etcbtc@depth/mthbtc@depth/engbtc@depth/dntbtc@depth/zecbtc@depth/bntbtc@depth/astbtc@depth/dashbtc@depth/oaxbtc@depth/icnbtc@depth/btgbtc@depth/evxbtc@depth/reqbtc@depth/vibbtc@depth/trxbtc@depth/powrbtc@depth/arkbtc@depth/xrpbtc@depth/modbtc@depth/enjbtc@depth/storjbtc@depth/venbtc@depth/kmdbtc@depth/rcnbtc@depth/nulsbtc@depth/rdnbtc@depth/xmrbtc@depth/dltbtc@depth/ambbtc@depth/batbtc@depth/bcptbtc@depth/arnbtc@depth/gvtbtc@depth/cdtbtc@depth/gxsbtc@depth/poebtc@depth/qspbtc@depth/btsbtc@depth/xzcbtc@depth/lskbtc@depth/tntbtc@depth/fuelbtc@depth/manabtc@depth/bcdbtc@depth/dgdbtc@depth/adxbtc@depth/adabtc@depth/pptbtc@depth/cmtbtc@depth/xlmbtc@depth/cndbtc@depth/lendbtc@depth/wabibtc@depth/tnbbtc@depth/wavesbtc@depth/gtobtc@depth/icxbtc@depth/ostbtc@depth/elfbtc@depth/aionbtc@depth/neblbtc@depth/brdbtc@depth/edobtc@depth/wingsbtc@depth/navbtc@depth/lunbtc@depth/trigbtc@depth/appcbtc@depth/vibebtc@depth/rlcbtc@depth/insbtc@depth/pivxbtc@depth/iostbtc@depth/chatbtc@depth/steembtc@depth/nanobtc@depth/viabtc@depth/blzbtc@depth/aebtc@depth/rpxbtc@depth/ncashbtc@depth/poabtc@depth/zilbtc@depth/ontbtc@depth/stormbtc@depth/xembtc@depth/wprbtc@depth/qlcbtc@depth/sysbtc@depth/grsbtc@depth/cloakbtc@depth/repbtc@depth/btcusdt@depth
2018-5-14 12:22:17 INFO: binance:depthHandler: [ZECBTC] Incorrect update ID. The depth cache is out of sync.
2018-5-14 12:22:17 INFO: binance:CombinedStream: Subscribed to [2785022752] ethbtc@depth/ltcbtc@depth/bnbbtc@depth/neobtc@depth/bccbtc@depth/gasbtc@depth/hsrbtc@depth/mcobtc@depth/wtcbtc@depth/lrcbtc@depth/qtumbtc@depth/yoyobtc@depth/omgbtc@depth/zrxbtc@depth/stratbtc@depth/snglsbtc@depth/bqxbtc@depth/kncbtc@depth/funbtc@depth/snmbtc@depth/iotabtc@depth/linkbtc@depth/xvgbtc@depth/saltbtc@depth/mdabtc@depth/mtlbtc@depth/subbtc@depth/eosbtc@depth/sntbtc@depth/etcbtc@depth/mthbtc@depth/engbtc@depth/dntbtc@depth/zecbtc@depth/bntbtc@depth/astbtc@depth/dashbtc@depth/oaxbtc@depth/icnbtc@depth/btgbtc@depth/evxbtc@depth/reqbtc@depth/vibbtc@depth/trxbtc@depth/powrbtc@depth/arkbtc@depth/xrpbtc@depth/modbtc@depth/enjbtc@depth/storjbtc@depth/venbtc@depth/kmdbtc@depth/rcnbtc@depth/nulsbtc@depth/rdnbtc@depth/xmrbtc@depth/dltbtc@depth/ambbtc@depth/batbtc@depth/bcptbtc@depth/arnbtc@depth/gvtbtc@depth/cdtbtc@depth/gxsbtc@depth/poebtc@depth/qspbtc@depth/btsbtc@depth/xzcbtc@depth/lskbtc@depth/tntbtc@depth/fuelbtc@depth/manabtc@depth/bcdbtc@depth/dgdbtc@depth/adxbtc@depth/adabtc@depth/pptbtc@depth/cmtbtc@depth/xlmbtc@depth/cndbtc@depth/lendbtc@depth/wabibtc@depth/tnbbtc@depth/wavesbtc@depth/gtobtc@depth/icxbtc@depth/ostbtc@depth/elfbtc@depth/aionbtc@depth/neblbtc@depth/brdbtc@depth/edobtc@depth/wingsbtc@depth/navbtc@depth/lunbtc@depth/trigbtc@depth/appcbtc@depth/vibebtc@depth/rlcbtc@depth/insbtc@depth/pivxbtc@depth/iostbtc@depth/chatbtc@depth/steembtc@depth/nanobtc@depth/viabtc@depth/blzbtc@depth/aebtc@depth/rpxbtc@depth/ncashbtc@depth/poabtc@depth/zilbtc@depth/ontbtc@depth/stormbtc@depth/xembtc@depth/wprbtc@depth/qlcbtc@depth/sysbtc@depth/grsbtc@depth/cloakbtc@depth/repbtc@depth/btcusdt@depth
Debugger attached.
node_modules\node-binance-api\node-binance-api.js:1638
context.messageQueue = context.messageQueue.filter(depth => depth.u > context.snapshotUpdateId);
^
TypeError: Cannot read property 'filter' of undefined
at node_modules\node-binance-api\node-binance-api.js:1638:69
at Request._callback (node_modules\node-binance-api\node-binance-api.js:108:61)
at Request.self.callback (node_modules\node-binance-api\node_modules\request\request.js:186:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request.<anonymous> (node_modules\node-binance-api\node_modules\request\request.js:1163:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage.<anonymous> (node_modules\node-binance-api\node_modules\request\request.js:1085:12)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1055:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
Waiting for the debugger to disconnect...
looks like sometimes when reconnecting, we get a symbol that was not initialized, otherwise it would have had context.messageQueue
defined :
let symbolDepthInit = function(symbol) {
if ( typeof depthCacheContext[symbol] === 'undefined' ) depthCacheContext[symbol] = {};
let context = depthCacheContext[symbol];
context.snapshotUpdateId = null;
context.lastEventUpdateId = null;
context.messageQueue = [];
depthCache[symbol] = { bids: {}, asks: {} };
};
i can see that we are not initializing all symbols in the callback of subscribe
in line 1670
else {
let symbol = symbols;
symbolDepthInit(symbol);
subscription = subscribe(symbol.toLowerCase()+'@depth', handleDepthStreamData, reconnect, function() {
getSymbolDepthSnapshot(symbol);
});
}
maybe we should?
Short Description: node-binance-api crashed after using depth cache for long period of time.
Platform: windows
node version:
Long descrption in the logs below you can see it gets 504 from the server and keeps trying. at some point it seems to be losing sync for some symbols and than the exception occurs. this is the second time it happens but this time i had it on verbose. both times it append after binance listed a new coin. could that be the reason for the exception? btw i am working with release v0.4.29
please check why this happens thank you:)