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

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

    XMLWordPrintable

    Details

    • Documentation Changes:
      Not Needed

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            jake@convictional.com Jake Strang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: