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

No validation on schema on connection URL.

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Minor
    • 4.0.x
    • 4.0.0
    • library
    • None
    • 1

    Description

      Not sure if this is a Python on a Couchbase-CXX issue, please move if it is.

      Problem
      If there is a typo in the schema no error is produce and instead a timeout is produce.

      Expectation
      For a better error message to be produce

      Steps to reproduce
      Run the following script, noticed that the schema is incorrect: paddy://

      # needed for any cluster connection
      from couchbase.cluster import Cluster
      from couchbase.auth import PasswordAuthenticator
      from couchbase.options import (ClusterOptions, ClusterTimeoutOptions,
                                     QueryOptions)
       
      # needed to support SQL++ (N1QL) query
      from couchbase.cluster import QueryOptions
       
      # get a reference to our cluster
      cluster = Cluster('paddy://localhost', ClusterOptions(
        PasswordAuthenticator('Administrator', 'password')))
       
      # get a reference to our bucket
      cb = cluster.bucket('travel-sample')
       
      cb_coll_default = cb.default_collection()
      result = cb_coll_default.get('airline_10')
      print(result.content_as[str])
      

      It will fail with a timeout

      Traceback (most recent call last):
        File "test-cb.py", line 11, in <module>
          cluster = Cluster('paddy://localhost', ClusterOptions(
        File "/usr/local/lib/python3.8/site-packages/couchbase/cluster.py", line 99, in __init__
          self._connect()
        File "/usr/local/lib/python3.8/site-packages/couchbase/logic/wrappers.py", line 79, in wrapped_fn
          raise e
        File "/usr/local/lib/python3.8/site-packages/couchbase/logic/wrappers.py", line 63, in wrapped_fn
          ret = fn(self, *args, **kwargs)
        File "/usr/local/lib/python3.8/site-packages/couchbase/cluster.py", line 105, in _connect
          raise ErrorMapper.build_exception(ret)
      couchbase.exceptions.UnAmbiguousTimeoutException: <ec=14, category=couchbase.common, message=unambiguous_timeout, C Source=/tmp/pip-install-m32c_u4h/couchbase_1a8227f1df6f4bd284fe14ab216a1be6/src/connection.cxx:149>
      

      Attachments

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

        Activity

          People

            jared.casey Jared Casey
            pvarley Patrick Varley (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty