Skip to content

document has bytes remaining that were not visited #481

@LinusU

Description

@LinusU

Versions/Environment

  1. What version of Rust are you using? 1.78.0
  2. What operating system are you using? Amazon Linux 2
  3. What versions of the driver and its dependencies are you using?
    • registry+https://github.com/rust-lang/crates.io-index#mongodb@3.0.0
    • registry+https://github.com/rust-lang/crates.io-index#bson@2.11.0
  4. What version of MongoDB are you using? 5.0.26
  5. What is your MongoDB topology (standalone, replica set, sharded cluster, serverless)? replica set

Describe the bug

For one specific document in our database, we are getting the following error:

document has bytes remaining that were not visited: 2344

I have tried to dump the document as BSON from the database, but I can read that just fine. We are however using a projection, so my working theory is that our database server is giving some invalid bson for that specific projection on that specific query 🤔

We have ~6.8 million documents that works, and one that doesn't 😅

We also tried removing the document, and inserting it again, but the same error is still happening when we query it out with a projection.

I would love to get some more help on how to debug this! e.g. how I can dump the exact BSON that's being parsed.

BE SPECIFIC:

  • What is the expected behavior and what is actually happening?
    • Expected behaviour is for the BSON to parse, but the actual behavior is that it gives the error pasted above
  • Do you have any particular output that demonstrates this problem?
    • Unfortunately not at this time, but would love help on how to get this!
  • Do you have any ideas on why this may be happening that could give us a
    clue in the right direction?
    • My working theory is that there is an incompatibility with the serializer used in MongoDB 5.0.26, and this BSON deserializer
  • Did this issue arise out of nowhere, or after an update (of the driver,
    server, and/or Rust)?
    • The issue arose out of nowhere; that is, no versions have been upgraded in a long time
  • Are there multiple ways of triggering this bug (perhaps more than one
    function produce a crash)?
    • So far, this is the only document out of ~6.8 million that we have observed this error on
  • If you know how to reproduce this bug, please include a code snippet here:
    • Unfortunately, not at this time...

To Reproduce
Unfortunately, I haven't figure out how to reproduce this at this moment.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions