Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-4944

Fail gracefully instead of "Invalid UTF-8 string in BSON document"



    • Not Needed


      Problem Statement/Rationale

      Compass will not display any results that would include a document containing an invalid UTF-8 string, and in place of the results displays the error "Invalid UTF-8 string in BSON document". This is also true of exporting: Compass will not allow a set of documents to be exported if one of them contains an invalid UTF-8 string (provides the same error).

      This is in contrast to Compass v1.26.1 which did display/export these documents, but substituted the replacement character � for any invalid bytes.

      Steps to Reproduce

      1. Create a document in MongoDB that contains a string field with invalid UTF-8 bytes. (I do not know how to actually perform this step but it seems to be possible).

      3. View the document in Compass, and also attempt to export the collection that contains this document.

      Expected Results

      I expect the behavior to be the same as it is in v1.26.1. The document can be viewed in Compass, with invalid chars replaced by �. The document can be exported using the "Export Collection" tool.

      Actual Results

      The document is not viewable in Compass and displays the error "Invalid UTF-8 string in BSON document". Clicking "Export Collection" (even if not viewing the document at the time, but exporting the full collection) and saving to a file gives the same error: "Invalid UTF-8 string in BSON document".

      Additional Notes

      The errors occurred on both v1.27.1 and v1.28.1.




            Unassigned Unassigned
            jake@convictional.com Jake Strang
            0 Vote for this issue
            6 Start watching this issue