node-ib icon indicating copy to clipboard operation
node-ib copied to clipboard

RangeError: Invalid array length

Open claude2 opened this issue 9 years ago • 1 comments

I started seeing the error below after March 17. My code was not changed, I did not upgrade any libraries, or the node version. The code is a ticker monitoring program which uses reqMktData on about 15 contracts. The example reqMktData works fine.

/home/claude2/ib/node_modules/ib/lib/incoming.js:1229
      this._dataQueue = this._dataQueue.concat(dataQueueSnapshot);
                                        ^

RangeError: Invalid array length
    at Array.concat (<anonymous>)
    at Incoming.process (/home/dan/ib/node_modules/ib/lib/incoming.js:1229:41)
    at Socket._onData (/home/dan/ib/node_modules/ib/lib/socket.js:48:30)
    at Socket.<anonymous> (/home/dan/ib/node_modules/ib/lib/socket.js:91:18)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:189:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at TCP.onread (net.js:551:20)

claude2 avatar Mar 26 '17 22:03 claude2

March 17 is the key... that's when several monitored contracts expired. I'll try to give reproduction code but it's something like monitoring expired futures contracts:

ib.contract.future('ES', '20170317', 'USD', 'GLOBEX', 50),

claude2 avatar Mar 27 '17 14:03 claude2