Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-4511

JSON encoding during View Indexing over escapes double quotes in values

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 2.0-developer-preview-3
    • 2.0-developer-preview-3
    • couchbase-bucket
    • Security Level: Public
    • None
    • Impediment

    Description

      I'm getting "invalid_json" warnings during indexing/view runs for JSON docs that are indeed valid both prior to being added to the bucket and after retrieval in the UI.

      It seems to center around escaped double quotes in content.

      Steps to reproduce:
      1. add both of the attached .json docs to a new, empty bucket.
      2. access any of the production views. The two that should return results with this single, content document in place are "brewery_beers" and "by_key_value"

      After clicking "Show Results" for one of these views (or otherwise triggering view generation), Couchbase Server will generate an invalid_json error message (see the "json_encoding_issue" attached).

      An example of the invalidated JSON is below (abbreviated "description" value from the IPA doc):
      \"Esquire Magazine calls our 90 Minute .IPA., \"\"\\\"\"\"perhaps the best I.P.A. in America.\"\"\\\"\"\" An Imperial I.P.A. brewed to be savored from a snifter....\"

      The invalid_json error is specifically:
      "parse error: after key and value, inside map, I expect ',' or '}'\n"

      Additionally, we should add a test for this, but that likely deserves it's own ticket.

      Attachments

        1. beer_90_Minute_IPA.json
          0.5 kB
        2. beer.json
          1 kB
        3. json_encoding_issue
          12 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            damien damien (Inactive)
            BigBlueHat Benjamin Young
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty