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

UUID for key and value are treated as JSON--at least in _all_docs

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • 2.0
    • 2.0
    • None
    • Security Level: Public
    • None

    Description

      In build 1554 setting a key with a UUID as both the key and the value makes Couchbase Server think the value is JSON.

      The effect of the bug is that a request to _all_docs is no longer valid JSON.

      Example:
      Store a key/value pair with "3021318e-adf1-40ce-a81b-5617c67d2710" as both the key and the value.

      GET http://127.0.0.1:1984/default/_all_docs?include_docs=true&key=%223021318e-adf1-40ce-a81b-5617c67d2710%22

      Results:
      {"total_rows":21,"rows":[
      {"id":"3021318e-adf1-40ce-a81b-5617c67d2710","key":"3021318e-adf1-40ce-a81b-5617c67d2710","value":

      {"rev":"3-000001b2cdeba1110000000000000000"}

      ,"doc":{"meta":

      {"id":"3021318e-adf1-40ce-a81b-5617c67d2710","rev":"3-000001b2cdeba1110000000000000000","expiration":0,"flags":0}

      ,"json":3021318e-adf1-40ce-a81b-5617c67d2710}}
      ]
      }

      The value of "json" in the object should be a string, but instead it's being sent without quotation marks and so is invalidating the JSON object--which breaks _all_docs at least and likely any other client that attempts to "objectify" that response.

      I realize this may be a unique scenario, but it's one that at least the Python SDK uses often--though I'm changing it to route around this bug.

      That said, it does highlight an issue that may have wider ranging consequences.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            alkondratenko Aleksey Kondratenko (Inactive)
            BigBlueHat Benjamin Young
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty