Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-2657

Exceptions Aren't Thrown For N1QL Errors After Results

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.5
    • 3.0.6
    • library
    • None
    • 1

    Description

      When errors occur after the "results" portion of the N1QL query response, no exception is thrown. This is rare, but can happen if the server encounters a problem after result streaming begins.

      Additionally, it seems to consistently happen if the error is related to RBAC:

      {
          "requestID": "033651a5-4138-4617-9bb6-6e0e0d0eb218",
          "signature": {
              "*": "*"
          },
          "results": [],
          "errors": [
              {
                  "code": 13014,
                  "msg": "User does not have credentials to run SELECT queries on the default bucket. Add role query_select on default to allow the query to run."
              }
          ],
          "status": "fatal",
          "metrics": {
              "elapsedTime": "7.574158ms",
              "executionTime": "7.510357ms",
              "resultCount": 0,
              "resultSize": 0,
              "errorCount": 1
          }
      }
      

      I recommend two changes:

      1. After we get done iterating through the list, check for errors and throw an exception if they are found for consistency
      2. If possible, detect the empty result array case early so we can throw the exception before the result set is iterated

      Forum post: https://forums.couchbase.com/t/cannot-execute-n1ql-queries-with-couchbase-net-sdk-3-0/27707/8

      Attachments

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

        Activity

          There are no comments yet on this issue.

          People

            btburnett3 Brant Burnett
            btburnett3 Brant Burnett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty