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

Invalid JSON might break UI for listing documents

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • bug-backlog
    • 4.6.3, 5.0.0
    • ns_server
    • None
    • Triaged
    • Unknown

    Description

      For some reason couchdb doesn't fallback to base64 form when trying to display document with 0a 0b as the content (two bytes). This breaks the page, and it cannot display any of results. It returns 500 error code

      $ curl  'http://localhost:8091/pools/default/buckets/default/docs?include_docs=true'
      ["Unexpected server error, request logged."]
      

      In the logs:

      [ns_server:error,2017-10-06T19:31:06.065+03:00,ns_1@127.0.0.1:<0.8252.0>:menelaus_web:loop:187]Server error during processing: ["web request failed",
                                       {path,"/pools/default/buckets/default/docs"},
                                       {method,'GET'},
                                       {type,error},
                                       {what,{case_clause,<<"\n\v">>}},
                                       {trace,
                                        [{mochijson2,tokenize,2,
                                          [{file,
                                            "/home/couchbase/jenkins/workspace/watson-unix/couchdb/src/mochiweb/mochijson2.erl"},
                                           {line,547}]},
                                         {mochijson2,decode1,2,
                                          [{file,
                                            "/home/couchbase/jenkins/workspace/watson-unix/couchdb/src/mochiweb/mochijson2.erl"},
                                           {line,326}]},
                                         {mochijson2,json_decode,2,
                                          [{file,
                                            "/home/couchbase/jenkins/workspace/watson-unix/couchdb/src/mochiweb/mochijson2.erl"},
                                           {line,321}]},
                                         {menelaus_web_crud,encode_doc,1,
                                          [{file,"src/menelaus_web_crud.erl"},
                                           {line,163}]},
                                         {menelaus_web_crud,do_handle_limit,3,
                                          [{file,"src/menelaus_web_crud.erl"},
                                           {line,153}]},
                                         {menelaus_web_crud,do_handle_list,4,
                                          [{file,"src/menelaus_web_crud.erl"},
                                           {line,82}]},
                                         {menelaus_web,loop,2,
                                          [{file,"src/menelaus_web.erl"},
                                           {line,163}]},
                                         {mochiweb_http,headers,5,
                                          [{file,
                                            "/home/couchbase/jenkins/workspace/watson-unix/couchdb/src/mochiweb/mochiweb_http.erl"},
                                           {line,94}]}]}]
      

      Attachments

        Issue Links

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

          Activity

            People

              dfinlay Dave Finlay
              avsej Sergey Avseyev
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty