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

failure to drop index should have non-200 response code

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not a Bug
    • Major
    • Morpheus, 7.2.6, 7.6.4
    • 7.2.2
    • query
    • None
    • Untriaged
    • 0
    • Unknown

    Description

      Using CB 7.2.2-6401.

      I use curl to drop an index that does not exist:

      curl -v http://localhost:8093/query/service -H 'Content-Type: application/json' -d '\{ "statement": "drop index idx1 on jobs" }' -u Administrator:password
      *   Trying 127.0.0.1:8093...
      * Connected to localhost (127.0.0.1) port 8093 (#0)
      * Server auth using Basic with user 'Administrator'
      > POST /query/service HTTP/1.1
      > Host: localhost:8093
      > Authorization: Basic QWRtaW5pc3RyYXRvcjpwYXNzd29yZA==
      > User-Agent: curl/7.88.1-DEV
      > Accept: */*
      > Content-Type: application/json
      > Content-Length: 42
      >
      < HTTP/1.1 200 OK
      < Content-Length: 361
      < Content-Type: application/json; version=7.2.2-N1QL
      < Date: Sat, 27 Jul 2024 00:17:11 GMT
      <
      {
      "requestID": "a5aaf223-6290-4935-ae9d-226aa7018872",
      "signature": null,
      "results": [
      ],
      "errors": [\{"code":12016,"msg":"Index Not Found - cause: GSI index idx1 not found.","reason":{"name":"idx1"}}],
      "status": "errors",
      "metrics": \{"elapsedTime": "1.195954ms","executionTime": "1.100719ms","resultCount": 0,"resultSize": 0,"serviceLoad": 2,"errorCount": 1}
      }
      

      I was expecting non-200 response code. Maybe 400 is more appropriate ?

      Attachments

        Activity

          People

            hitesh.walia Hitesh Walia
            hitesh.walia Hitesh Walia
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty