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

Http error codes changed for BUILD index statement between 4.1 and 4.5

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Critical
    • 5.0.0
    • 4.5.0
    • query
    • None
    • Untriaged
    • Unknown

    Description

      Download and install both 4.1 and the latest 4.5 build and run the following command:

      curl -vvv http://127.0.0.1:8093/query/service -d 'statement=BUILD INDEX ON `travel-sample`(def_primary,def_name_type,def_faa,def_icao,def_city,def_airportname,def_type,def_sourceairport) USING GSI'

      You will notice that the body is similar, but the HTTP error code is different. This will cause issues for users who upgrade and use the build index query.

      4.1

      [root@localhost ~]# curl -vvv http://127.0.0.1:8093/query/service -d 'statement=BUILD INDEX ON `travel-sample`(def_primary,def_name_type,def_faa,def_icao,def_city,def_airportname,def_type,def_sourceairport) USING GSI'
      * About to connect() to 127.0.0.1 port 8093 (#0)
      *   Trying 127.0.0.1... connected
      * Connected to 127.0.0.1 (127.0.0.1) port 8093 (#0)
      > POST /query/service HTTP/1.1
      > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.15.3 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
      > Host: 127.0.0.1:8093
      > Accept: */*
      > Content-Length: 146
      > Content-Type: application/x-www-form-urlencoded
      > 
      < HTTP/1.1 200 OK
      < Content-Length: 455
      < Content-Type: application/json; version=1.0.0
      < Date: Tue, 24 May 2016 21:27:01 GMT
      < 
      {
          "requestID": "bf37d567-555d-489a-9be0-5417428d0224",
          "signature": null,
          "results": [
          ],
          "errors": [
              {
                  "code": 5000,
                  "msg": "BuildIndexes - cause: Index def_primary is already built ."
              }
          ],
          "status": "errors",
          "metrics": {
              "elapsedTime": "3.315778ms",
              "executionTime": "3.193313ms",
              "resultCount": 0,
              "resultSize": 0,
              "errorCount": 1
          }
      }
      * Connection #0 to host 127.0.0.1 left intact
      * Closing connection #0
      

      4.5

      [root@localhost ~]# curl -vvv http://127.0.0.1:8093/query/service -d 'statement=BUILD INDEX ON `travel-sample`(def_primary,def_name_type,def_faa,def_icao,def_city,def_airportname,def_type,def_sourceairport) USING GSI'
      * About to connect() to 127.0.0.1 port 8093 (#0)
      *   Trying 127.0.0.1... connected
      * Connected to 127.0.0.1 (127.0.0.1) port 8093 (#0)
      > POST /query/service HTTP/1.1
      > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.15.3 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
      > Host: 127.0.0.1:8093
      > Accept: */*
      > Content-Length: 146
      > Content-Type: application/x-www-form-urlencoded
      > 
      < HTTP/1.1 500 Internal Server Error
      < Content-Length: 454
      < Content-Type: application/json; version=1.5.0
      < Date: Tue, 24 May 2016 21:31:50 GMT
      < 
      {
          "requestID": "76c52336-d91a-4c14-b829-511a867ed2cb",
          "signature": null,
          "results": [
          ],
          "errors": [
              {
                  "code": 5000,
                  "msg": "BuildIndexes - cause: Index def_primary is already built ."
              }
          ],
          "status": "errors",
          "metrics": {
              "elapsedTime": "1.870615ms",
              "executionTime": "1.73948ms",
              "resultCount": 0,
              "resultSize": 0,
              "errorCount": 1
          }
      }
      * Connection #0 to host 127.0.0.1 left intact
      * Closing connection #0
      

      Attachments

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

        Activity

          People

            Prerna.Manaktala Prerna Manaktala (Inactive)
            mikew Mike Wiederhold [X] (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