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

implement better return code from bucket creation when the bucket exists

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.0
    • Fix Version/s: feature-backlog
    • Component/s: ns_server
    • Security Level: Public
    • Labels:

      Description

      The bucket creation use return code 400 (Bad request) if the bucket already exists, which seems wrong to me. From the description of 400 I can read:

      400 - The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.

      Better alternatives would be:
      403 - The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information available to the client, the status code 404 (Not Found) can be used instead.

      409 - conflict
      412 - The precondition given in one or more of the request-header fields evaluated to false when it was tested on the server. This response code allows the client to place preconditions on the current resource metainformation (header field data) and thus prevent the requested method from being applied to a resource other than the one intended.

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

        Activity

        Hide
        farshid Farshid Ghods (Inactive) added a comment -

        something that documentation team needs be to aware of as well.

        Thanks Trond for reporting this issue.

        Show
        farshid Farshid Ghods (Inactive) added a comment - something that documentation team needs be to aware of as well. Thanks Trond for reporting this issue.
        Hide
        farshid Farshid Ghods (Inactive) added a comment -

        moving bugs related to REST api clean ups to .next - .next will be scrubbed soon to move back to 2.0.2 or 2.1a

        Show
        farshid Farshid Ghods (Inactive) added a comment - moving bugs related to REST api clean ups to .next - .next will be scrubbed soon to move back to 2.0.2 or 2.1a
        Hide
        alkondratenko Aleksey Kondratenko (Inactive) added a comment -

        400 is never a bug when 403 is alternative. Downgraded to minor

        Show
        alkondratenko Aleksey Kondratenko (Inactive) added a comment - 400 is never a bug when 403 is alternative. Downgraded to minor

          People

          • Assignee:
            Aliaksey Artamonau Aliaksey Artamonau
            Reporter:
            trond Trond Norbye
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Gerrit Reviews

              There are no open Gerrit changes