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

setting a JSON document with a matching key "foo" and _id "foo" fails results in attachment with invalid key

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.0-developer-preview-4
    • Fix Version/s: 2.0-beta
    • Component/s: couchbase-bucket
    • Security Level: Public
    • Labels:
      None

      Description

      When building a small sample application that uses the PHP API to insert JSON documents with _id into Couchbase 2.0, even though it matches the key, the server will store it as an attachment and claim reason "invalid key".

        Attachments

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

          Activity

          ingenthr Matt Ingenthron created issue -
          Hide
          chiyoung Chiyoung Seo (Inactive) added a comment -

          Assign it to Jin for the initial investigation.

          Show
          chiyoung Chiyoung Seo (Inactive) added a comment - Assign it to Jin for the initial investigation.
          chiyoung Chiyoung Seo (Inactive) made changes -
          Field Original Value New Value
          Assignee Chiyoung Seo [ chiyoung ] Jin Lim [ jin ]
          chiyoung Chiyoung Seo (Inactive) made changes -
          Assignee Jin Lim [ jin ] Liang Guo [ liang ]
          chiyoung Chiyoung Seo (Inactive) made changes -
          Sprint Status Next Sprint
          chiyoung Chiyoung Seo (Inactive) made changes -
          Sprint Status Next Sprint Current Sprint
          Hide
          liang Liang Guo (Inactive) added a comment -

          Matt said that any client trying to save JSON doc with _id would fail, so I tried python-client-0.6 from github. In python interpreter, I tried the following -

          >>> bkt = cb['default']
          >>> doc_id2 = bkt.save(

          {'_id':'key_id','type':'item2','value':'json test _id','$flags':25}

          )
          >>> print doc_id2
          key_id
          >>> print bkt[doc_id2]
          (25, 3306011834354, '

          {"type": "item2", "value": "json test _id"}

          ')
          >>> doc_id4 = bkt.save(

          {'_id':'key_id','type':'item2_id','value':'json test_id 2','$flags':25}

          )
          >>> print str(bkt[doc_id2])
          (25, 4014080491089, '

          {"type": "item2_id", "value": "json test_id 2"}

          ')

          >>> doc_id3 = bkt.save(

          {'_id':'foo','type':'Foo','value':'json bar','$flags':25}

          )
          >>> print doc_id3
          foo
          >>> print bkt[doc_id3]
          (25, 3691806511403, '

          {"type": "Foo", "value": "json bar"}

          ')
          >>> doc_id5 = bkt.save(

          {'_id':'foo','type':'FOO2','value':'JSON test_id bar','$flags':25}

          )
          >>> print doc_id5 + " " + str(bkt[doc_id5])
          foo (25, 5899276309901, '

          {"type": "FOO2", "value": "JSON test_id bar"}

          ')

          Seems to me that saving a simple JSON doc with _id works. I am using couchbase 2.0 repo and python-client-0.6.

          Show
          liang Liang Guo (Inactive) added a comment - Matt said that any client trying to save JSON doc with _id would fail, so I tried python-client-0.6 from github. In python interpreter, I tried the following - >>> bkt = cb ['default'] >>> doc_id2 = bkt.save( {'_id':'key_id','type':'item2','value':'json test _id','$flags':25} ) >>> print doc_id2 key_id >>> print bkt [doc_id2] (25, 3306011834354, ' {"type": "item2", "value": "json test _id"} ') >>> doc_id4 = bkt.save( {'_id':'key_id','type':'item2_id','value':'json test_id 2','$flags':25} ) >>> print str(bkt [doc_id2] ) (25, 4014080491089, ' {"type": "item2_id", "value": "json test_id 2"} ') >>> doc_id3 = bkt.save( {'_id':'foo','type':'Foo','value':'json bar','$flags':25} ) >>> print doc_id3 foo >>> print bkt [doc_id3] (25, 3691806511403, ' {"type": "Foo", "value": "json bar"} ') >>> doc_id5 = bkt.save( {'_id':'foo','type':'FOO2','value':'JSON test_id bar','$flags':25} ) >>> print doc_id5 + " " + str(bkt [doc_id5] ) foo (25, 5899276309901, ' {"type": "FOO2", "value": "JSON test_id bar"} ') Seems to me that saving a simple JSON doc with _id works. I am using couchbase 2.0 repo and python-client-0.6.
          Hide
          liang Liang Guo (Inactive) added a comment -

          Close it for now. If it is reproduced, please reopen with env info

          Show
          liang Liang Guo (Inactive) added a comment - Close it for now. If it is reproduced, please reopen with env info
          liang Liang Guo (Inactive) made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Cannot Reproduce [ 5 ]
          chiyoung Chiyoung Seo (Inactive) made changes -
          Sprint Status Current Sprint
          farshid Farshid Ghods (Inactive) made changes -
          Fix Version/s 2.0-beta [ 10113 ]
          Fix Version/s 2.0-developer-preview-5 [ 10290 ]
          Hide
          raju Raju Suravarjjala added a comment -

          Bulk closing all invalid bugs that are duplicate, user error, invalid. Please feel free to reopen them if you feel otherwise

          Show
          raju Raju Suravarjjala added a comment - Bulk closing all invalid bugs that are duplicate, user error, invalid. Please feel free to reopen them if you feel otherwise
          raju Raju Suravarjjala made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              liang Liang Guo (Inactive)
              Reporter:
              ingenthr Matt Ingenthron
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes