Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-105

mongorestore stops after encountering invalid bson object

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.0.0
    • Affects Version/s: Legacy C++ Implementation
    • Component/s: mongorestore
    • Not Needed

      The expected behavior is to print out the object and move on: https://github.com/mongodb/mongo/blob/r2.4.8/src/mongo/tools/tool.cpp#L518

      However, BSONElement::validate() doesn't validate all types of objects (e.g. arrays):
      https://github.com/mongodb/mongo/blob/r2.4.8/src/mongo/bson/bson-inl.h#L526

      So if an array contains an invalid object, exception will be thrown when we try to print it out. That exception is unchecked and causes mongodump to abruptly stop.

            Assignee:
            kyle.erf Kyle Erf
            Reporter:
            alex.komyagin@mongodb.com Alexander Komyagin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: