question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] LOG entries: RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 && <= 17825792.

See original GitHub issue

Describe the bug Some downloads cause this to appear in the log:

RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 && <= 17825792. Received 17825795
at validateOffset (node:buffer:115:3)
at Buffer.write (node:buffer:1066:5)
at serializeObject (/app/node_modules/bson/lib/bson/parser/serializer.js:342:14)
at serializeInto (/app/node_modules/bson/lib/bson/parser/serializer.js:947:17)
at serializeObject (/app/node_modules/bson/lib/bson/parser/serializer.js:347:18)
at serializeInto (/app/node_modules/bson/lib/bson/parser/serializer.js:947:17)
at serializeObject (/app/node_modules/bson/lib/bson/parser/serializer.js:347:18)
at serializeInto (/app/node_modules/bson/lib/bson/parser/serializer.js:947:17)
at serializeObject (/app/node_modules/bson/lib/bson/parser/serializer.js:347:18)
at serializeInto (/app/node_modules/bson/lib/bson/parser/serializer.js:729:17)
at serializeObject (/app/node_modules/bson/lib/bson/parser/serializer.js:347:18)
at serializeInto (/app/node_modules/bson/lib/bson/parser/serializer.js:947:17)
at BSON.serialize (/app/node_modules/bson/lib/bson/bson.js:64:28)
at Msg.serializeBson (/app/node_modules/mongodb/lib/core/connection/msg.js:127:22)
at Msg.makeDocumentSegment (/app/node_modules/mongodb/lib/core/connection/msg.js:119:33)
at Msg.toBin (/app/node_modules/mongodb/lib/core/connection/msg.js:105:25) {
code: 'ERR_OUT_OF_RANGE'
}

Not sure what this will cause for our instance’s mongoDB data integrity?

To Reproduce Steps to reproduce the behavior:

I get this on some subscription downloads (and I think one-offs as well).

I’m sussing this may have something to do with the info.json being too large to ingress into mongodb when you have enabled to download comments, since they all get written into the info.json.

Expected behavior

for the log to not receive this STERR and if my assumption above about the reason for this appearing is correct:

Maybe YTDL-M should truncate the comment part out of the query to mongoDB and rely on the info.json to load the comments when we implement displaying them. (#289) Writing to the DB that we DO have the comments downloaded would suffice.

Screenshots n/a

Environment

  • Installed version: v4.2
  • Installation type: docker Docker tag: nightly Commit hash: d5c1361 Build date: 2022-04-24

Additional context n/a

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
martadinata666commented, Jun 25, 2022

Currently please use nightly tag rather latest tag.

0reactions
Tzahi12345commented, Jun 26, 2022

This is not a new installation, though I did attempt to switch to mongodb right when this started happening. But the container just no longer appears to start up at all using local db.

Can you give a few more details/logs? It should be relatively easy to switch back

The error appears to be MongoDB related, not surprised it only happens then

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - The value of "offset" is out of range. It must be >= 0 ...
Your MongoDB query is too large. This happens when your search or update query exceeds 17.825.792 bytes. For those having the same issue....
Read more >
The value of "offset" is out of range on a "find" query - Drivers ...
But I get this error: RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 && <= 17825792....
Read more >
RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is ...
when i use utf8mb4. the error is: Trace at Packet.readLengthCodedNumberExt (/workspace ...
Read more >
NodeJS: Storing big objects to DB leads to RangeError
ERROR : RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 && <= 17825792. Received 17825798
Read more >
The value of "offset" is out of range. It must be >= 0 ...
You will be presented with the following error: RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found