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

/pools/default/trustedCAs errors in different format to the rest of ns_server

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 7.1.0
    • 7.1.0
    • ns_server
    • None
    • Untriaged
    • 1
    • No

    Description

      Problem
      While implementing MB-47172 I notice the json error object returned by the /pools/default/trustedCAs/[id] is in a different format to the rest of the errors returned by ns_server. couchbase-cli has code to handle three different error message formats.

      steps to reproduce

      1. Setup a cluster
      2. Try to delete the self-generated CA:

        curl  -uAdministrator:asdasd -XDELETE http://localhost:9000/pools/default/trustedCAs/0 
        {"error":"The CA certificate is in use by the following nodes: 172.18.1.75, 127.0.0.1"}%    
        

      Note that other endpoints use errors and not error.

      Expectation
      For the errors messages to be returned in uniformed format across ns_server (ideally the whole of Couchbase Server)

      For example one of the following formats could be used instead

      ["The CA certificate is in use by the following nodes: 172.18.1.75, 127.0.0.1"]
      {"errors": ["The CA certificate is in use by the following nodes: 172.18.1.75, 127.0.0.1"]}
      {"errors": {0: "The CA certificate is in use by the following nodes: 172.18.1.75, 127.0.0.1"}}
      #The last one does not make sense and is shown for completeness
      

      Note
      If this not a bug then please let me know and I will change the implementation in couchbase-cli to handle another new error format.

      Attachments

        Issue Links

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

          Activity

            People

              sumedh.basarkod Sumedh Basarkod (Inactive)
              pvarley Patrick Varley (Inactive)
              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