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

Passed in JSON generates error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.0
    • 2.2.0
    • ns_server
    • Security Level: Public
    • None
    • MacOSX 64-bit

    Description

      I tried to copy-paste some JSON into the UI and it didn't complain, but on save it failed with this error in the top bar (I had to inspect the DOM element to get the full info):

      {'EXIT',{badarg,[{erlang,iolist_to_binary,
      [[{[

      {<<"id">>,0},
      {<<"guid">>, <<"c4cabe72-8635-411f-8bca-f853fcaa3d49">>},
      {<<"isActive">>,true},
      {<<"balance">>,<<"$1,092.00">>},
      {<<"picture">>,<<"http://placehold.it/32x32">>},
      {<<"age">>,34},
      {<<"name">>,<<"Zamora Mccarthy">>},
      {<<"gender">>,<<"male">>},
      {<<"company">>,<<"Daido">>},
      {<<"email">>,<<"zamoramccarthy@daido.com">>},
      {<<"phone">>,<<"+1 (826) 469-2961">>},
      {<<"address">>, <<"132 Rutland Road, Crawfordsville, Rhode Island, 3658">>},
      {<<"about">>, <<"Elit elit eiusmod enim aliqua incididunt. Labore fugiat ad in excepteur do laborum. Sunt ullamco ex ad veniam nostrud ea ea anim duis. Officia velit Lorem sint esse magna. Nostrud Lorem est do sit ad. Quis laboris culpa cillum veniam enim commodo. Reprehenderit nisi fugiat consectetur non commodo cillum irure laborum duis commodo aliquip.\r\n">>},
      {<<"registered">>, <<"2004-01-22T00:07:24 -01:00">>},
      {<<"latitude">>,-89.913804},
      {<<"longitude">>,39.005512},
      {<<"tags">>, [<<"occaecat">>,<<"ut">>,<<"mollit">>, <<"voluptate">>,<<"ea">>,<<"dolor">>, <<"aute">>]},
      {<<"friends">>,
      [{[{<<"id">>,0}

      ,

      {<<"name">>,<<"Mcintyre Lancaster">>}

      ]},
      {[

      {<<"id">>,1}

      ,

      {<<"name">>,<<"Rachael Kirk">>}

      ]},
      {[

      {<<"id">>,2}

      ,

      {<<"name">>,<<"Anastasia Lopez">>}

      ]}]},

      {<<"randomArrayItem">>,<<"cherry">>}

      ]}]]},

      {couch_doc,to_raw_json_binary_views,1}

      ,

      {capi_crud,update_doc,3}

      ,

      {rpc,local_call,3}

      ,

      {capi_frontend,attempt,6}

      ,

      {capi_frontend,update_doc,3}

      ,

      {couch_httpd_db,update_doc,5}

      ,

      {request_throttler,do_request,3}

      ]}}

      Here is the JSON to repro:

      [
      {
      "id": 0,
      "guid": "c4cabe72-8635-411f-8bca-f853fcaa3d49",
      "isActive": true,
      "balance": "$1,092.00",
      "picture": "http://placehold.it/32x32",
      "age": 34,
      "name": "Zamora Mccarthy",
      "gender": "male",
      "company": "Daido",
      "email": "zamoramccarthy@daido.com",
      "phone": "+1 (826) 469-2961",
      "address": "132 Rutland Road, Crawfordsville, Rhode Island, 3658",
      "about": "Elit elit eiusmod enim aliqua incididunt. Labore fugiat ad in excepteur do laborum. Sunt ullamco ex ad veniam nostrud ea ea anim duis. Officia velit Lorem sint esse magna. Nostrud Lorem est do sit ad. Quis laboris culpa cillum veniam enim commodo. Reprehenderit nisi fugiat consectetur non commodo cillum irure laborum duis commodo aliquip.\r\n",
      "registered": "2004-01-22T00:07:24 -01:00",
      "latitude": -89.913804,
      "longitude": 39.005512,
      "tags": [
      "occaecat",
      "ut",
      "mollit",
      "voluptate",
      "ea",
      "dolor",
      "aute"
      ],
      "friends": [

      { "id": 0, "name": "Mcintyre Lancaster" }

      ,

      { "id": 1, "name": "Rachael Kirk" }

      ,

      { "id": 2, "name": "Anastasia Lopez" }

      ],
      "randomArrayItem": "cherry"
      }
      ]

      btw it is taken from: http://www.json-generator.com/

      ... just create a new doc in the UI and paste it in there, click save. It will complain and not save, but it also doesn't tell you it's not saved.

      Attachments

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

        Activity

          People

            subhashni Subhashni Balakrishnan (Inactive)
            daschl Michael Nitschinger
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty