Uploaded image for project: 'Couchbase C client library libcouchbase'
  1. Couchbase C client library libcouchbase
  2. CCBC-1375

N1QL query towards unknown scope leads to LCB_ERR_HTTP instead of LCB_ERR_SCOPE_NOT_FOUND

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 3.1.0
    • None
    • None
    • None
    • 1

    Description

      Aim of this ticket is to improve error return while attempting n1ql query to unknown scope/collection. In the example below, we could see the global errorĀ LCB_ERR_HTTP for scope not found issue.

      2021/02/12 14:16:51.154304 vm01 test MDW DBG TST <N1QLOperations.cpp#187 TID#0> Setting query statement: 'SELECT * FROM `adeltour-br5`.`unknown_s
      cope`.`my_collection1` WHERE type=$type'
      2021/02/12 14:16:51.154315 vm01 test MDW DBG TST <N1QLOperations.cpp#193 TID#0> Setting scope name 'unknown_scope'
      2021/02/12 14:16:51.154319 vm01 test MDW DBG TST <N1QLOperations.cpp#210 TID#0> Using default query context 'adeltour-br5.unknown_scope'
      2021/02/12 14:16:51.154334 vm01 test MDW DBG TST <N1QLOperations.cpp#65 TID#0> Setting named argument (Name: type, Value: "airline")
      2021/02/12 14:16:51.154342 vm01 test MDW DBG TST <N1QLOperations.cpp#104 TID#0> Setting option (Name: timeout, Value: "10s")
      2021/02/12 14:16:51.154345 vm01 test MDW DBG TST <N1QLOperations.cpp#132 TID#0> Setting consistency option (Value: 2)
      2021/02/12 14:16:51.161920 vm01 test MDW ERROR [17/kKVClientError_HTTPError] TST <ErrorManager.cpp#425 TID#0> Error: LCB_ERR_HTTP (1053): HTTP Op
      eration failed. Inspect status code for details ; Error in N1QL callback, LCB_ERR_HTTP (1053): HTTP Operation failed. Inspect status code for details, rc: [1
      053], code: [12021] / msg: [Scope not found in CB datastore default:adeltour-br5.unknown_scope], global elapsed time: [7ms]
       
      2021/02/12 14:16:51.162087 vm01 test MDW DBG TST <N1QLOperations.cpp#187 TID#0> Setting query statement: 'SELECT * FROM `my_collection1` WHERE ty
      pe=$type'
      2021/02/12 14:16:51.162099 vm01 test MDW DBG TST <N1QLOperations.cpp#193 TID#0> Setting scope name 'unknown_scope'
      2021/02/12 14:16:51.162103 vm01 test MDW DBG TST <N1QLOperations.cpp#210 TID#0> Using default query context 'adeltour-br5.unknown_scope'
      2021/02/12 14:16:51.162112 vm01 test MDW DBG TST <N1QLOperations.cpp#65 TID#0> Setting named argument (Name: type, Value: "airline")
      2021/02/12 14:16:51.162117 vm01 test MDW DBG TST <N1QLOperations.cpp#104 TID#0> Setting option (Name: timeout, Value: "10s")
      2021/02/12 14:16:51.162121 vm01 test MDW DBG TST <N1QLOperations.cpp#132 TID#0> Setting consistency option (Value: 2)
      2021/02/12 14:16:51.236860 vm01 test MDW ERROR [17/kKVClientError_HTTPError] TST <ErrorManager.cpp#425 TID#0> Error: LCB_ERR_HTTP (1053): HTTP Op
      eration failed. Inspect status code for details ; Error in N1QL callback, LCB_ERR_HTTP (1053): HTTP Operation failed. Inspect status code for details, rc: [1
      053], code: [12021] / msg: [Scope not found in CB datastore default:adeltour-br5.unknown_scope], global elapsed time: [74ms]
       
      2021/02/12 14:16:51.236944 vm01 test MDW DBG TST <N1QLOperations.cpp#187 TID#0> Setting query statement: 'SELECT * FROM `my_collection1` WHERE ty
      pe=$type'
      2021/02/12 14:16:51.236951 vm01 test MDW DBG TST <N1QLOperations.cpp#193 TID#0> Setting scope name 'unknown_scope'
      2021/02/12 14:16:51.236955 vm01 test MDW DBG TST <N1QLOperations.cpp#203 TID#0> Setting query context 'adeltour-br5.unknown_scope'
      2021/02/12 14:16:51.236964 vm01 test MDW DBG TST <N1QLOperations.cpp#65 TID#0> Setting named argument (Name: type, Value: "airline")
      2021/02/12 14:16:51.236970 vm01 test MDW DBG TST <N1QLOperations.cpp#104 TID#0> Setting option (Name: timeout, Value: "10s")
      2021/02/12 14:16:51.236976 vm01 test MDW DBG TST <N1QLOperations.cpp#132 TID#0> Setting consistency option (Value: 2)
      2021/02/12 14:16:51.240285 vm01 test MDW ERROR [17/kKVClientError_HTTPError] TST <ErrorManager.cpp#425 TID#0> Error: LCB_ERR_HTTP (1053): HTTP Operation failed. Inspect status code for details ; Error in N1QL callback, LCB_ERR_HTTP (1053): HTTP Operation failed. Inspect status code for details, rc: [1053], code: [12021] / msg: [Scope not found in CB datastore default:adeltour-br5.unknown_scope], global elapsed time: [3ms]
       
      2021/02/12 14:16:51.260609 vm01 test MDW DBG TST <N1QLOperations.cpp#187 TID#0> Setting query statement: 'DROP SCOPE `adeltour-br5`.`unknown_scope`'
      2021/02/12 14:16:51.260632 vm01 test MDW DBG TST <N1QLOperations.cpp#193 TID#0> Setting scope name 'unknown_scope'
      2021/02/12 14:16:51.260636 vm01 test MDW DBG TST <N1QLOperations.cpp#203 TID#0> Setting query context 'adeltour-br5.unknown_scope'
      2021/02/12 14:16:51.260647 vm01 test MDW DBG TST <N1QLOperations.cpp#65 TID#0> Setting named argument (Name: type, Value: "airline")
      2021/02/12 14:16:51.260653 vm01 test MDW DBG TST <N1QLOperations.cpp#104 TID#0> Setting option (Name: timeout, Value: "10s")
      2021/02/12 14:16:51.260656 vm01 test MDW DBG TST <N1QLOperations.cpp#132 TID#0> Setting consistency option (Value: 2)
      2021/02/12 14:16:51.268830 vm01 test MDW ERROR [17/kKVClientError_HTTPError] TST <ErrorManager.cpp#425 TID#0> Error: LCB_ERR_HTTP (1053): HTTP Operation failed. Inspect status code for details ; Error in N1QL callback, LCB_ERR_HTTP (1053): HTTP Operation failed. Inspect status code for details, rc: [1053], code: [13014] / msg: [User does not have credentials to run this type of query. Add role admin to allow the query to run.], global elapsed time: [8ms]
      2021/02/12 14:16:51.268850 vm01 test MDW DBG N1QL <N1QLOperations.cpp#370 TID#0> The last row has already been returned by the N1QL callback, global elapsed time: [8ms]
       
      2021/02/12 14:16:51.268887 vm01 test MDW DBG TST <N1QLOperations.cpp#187 TID#0> Setting query statement: 'DROP COLLECTION `adeltour-br5`.`my_scope1`.`unknown_collection`'
      2021/02/12 14:16:51.268898 vm01 test MDW DBG TST <N1QLOperations.cpp#193 TID#0> Setting scope name 'unknown_scope'
      2021/02/12 14:16:51.268901 vm01 test MDW DBG TST <N1QLOperations.cpp#203 TID#0> Setting query context 'adeltour-br5.unknown_scope'
      2021/02/12 14:16:51.268910 vm01 test MDW DBG TST <N1QLOperations.cpp#65 TID#0> Setting named argument (Name: type, Value: "airline")
      2021/02/12 14:16:51.268915 vm01 test MDW DBG TST <N1QLOperations.cpp#104 TID#0> Setting option (Name: timeout, Value: "10s")
      2021/02/12 14:16:51.268920 vm01 test MDW DBG TST <N1QLOperations.cpp#132 TID#0> Setting consistency option (Value: 2)
      2021/02/12 14:16:51.277533 vm01 test MDW ERROR [17/kKVClientError_HTTPError] TST <ErrorManager.cpp#425 TID#0> Error: LCB_ERR_HTTP (1053): HTTP Operation failed. Inspect status code for details ; Error in N1QL callback, LCB_ERR_HTTP (1053): HTTP Operation failed. Inspect status code for details, rc: [1053], code: [13014] / msg: [User does not have credentials to run this type of query. Add role admin to allow the query to run.], global elapsed time: [8ms]
      

      Attachments

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

        Activity

          People

            avsej Sergey Avseyev
            Alexis Deltour Alexis Deltour
            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