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
- Setup a cluster
- 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
- blocks
-
MB-47172 Multiple Root CA Certs management (couchbase-cli)
- Closed