Uploaded image for project: 'Couchbase Python Client Library'
  1. Couchbase Python Client Library
  2. PYCBC-377

Cross-bucket N1QL queries fail even with "add_bucket_creds"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • None
    • 2.2.0
    • library
    • None
    • Ubuntu 16.04.1
      lcb 2.7.1

    Description

      The following query fails in the above mentioned environment:

      from couchbase.bucket import Bucket
      from couchbase.n1ql import N1QLQuery
       
      cb = Bucket("couchbase://172.23.100.55/bucket-1", password="password")
       
      cb.add_bucket_creds("bucket-1", "password")
      cb.add_bucket_creds("bucket-2", "password")
      cb.add_bucket_creds("bucket-3", "password")
       
       
      q = N1QLQuery("SELECT u.email AS email, COUNT(t.title) "
                    "FROM `bucket-2` t "
                    "INNER JOIN `bucket-3` c ON KEYS t.categories "
                    "LEFT OUTER JOIN `bucket-1` u ON KEYS t.owner "
                    "WHERE t.capped = $1 AND c.name = $2 "
                    "GROUP BY u.email", "d8576d", "n1ql-000000000001")
      q.adhoc = False
      q.consistency = 'not_bounded'
       
      cb.n1ql_query(q).execute()
      

      couchbase.exceptions.HTTPError: <RC=0x3B[HTTP Operation failed. Inspect status code for details], HTTP Request failed. Examine 'objextra' for full result, Results=1, C Source=(src/http.c,140), OBJ=ViewResult<rc=0x3B[HTTP Operation failed. Inspect status code for details], value={u'status': u'stopped', u'errors': [{u'msg': u'Authorization Failed Keyspace bucket-2', u'code': 10000}], u'results': [], u'metrics': {u'elapsedTime': u'6.651541ms', u'executionTime': u'6.579298ms', u'resultSize': 0, u'resultCount': 0, u'errorCount': 1}, u'requestID': u'4578d546-d2e0-4d6e-8ce7-575e8177ebe7', u'signature': {u'email': u'json', u'$1': u'number'}}, http_status=401>>
      

      Interestingly, the same code snippet works just fine on my laptop with lcb 2.6 and pycb 2.1.0.

      Attachments

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

        Activity

          People

            mnunberg Mark Nunberg (Inactive)
            pavelpaulau Pavel Paulau (Inactive)
            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