RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range.

728 views
Skip to first unread message

Tim Oxley

unread,
Jun 9, 2021, 4:06:03 PM6/9/21
to DataStax Node.js Driver for Apache Cassandra Mailing List
I am experiencing the same issue as this: https://datastax-oss.atlassian.net/browse/NODEJS-626

I don't have permission to comment on that jira ticket so I'm emailing here. This is causing a critical issue for the project I'm on.

Issue seems to be that the RangeError produced by node is not the same class as the global RangeError. The proposed solution that uses standard code rather than instanceof `|| e.code === 'ERR_OUT_OF_RANGE'` seems to work.

I'm not entirely sure how to reproduce this but it seems to happen when the connection experiences some throttling (thus buffers fill up) and is trying to fetch around a thousand rows or more via client.eachRow or client.stream. When unthrottled, or with fewer rows, or a small fetchSize, the issue disappears.

Would appreciate some advice on how to either work around this (do I just have to run a forked driver?) or whether there will be an official fix in the near future. Thanks




Bret McGuire

unread,
Aug 27, 2021, 6:02:35 PM8/27/21
to DataStax Node.js Driver for Apache Cassandra Mailing List, sec...@gmail.com
   I'm taking a look at NODEJS-626 now.  If we can come to a good resolution I'd certainly like to include any fix in a future release, although I don't really have a timeline yet for when any future release might occur.

   I just added a comment to that ticket containing some additional details about where I'd like to go with a fix and asking for help from the community if anyone has a reproducible test case (so far I haven't been able to reproduce the problem at all).  I'd like to get a good, solid fix in place but after reviewing the relevant code it's not at all clear to me _why_ we're seeing the problematic behaviour described in the ticket.  If you do have a test case which can reliably reproduce the problem and have the time/resources to help any feedback on the requests mentioned in my comment would be _very_ much appreciated!

   Thanks all!

   - Bret -

Reply all
Reply to author
Forward
0 new messages