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

[cbstats] key and vkey command for non-existent collection should exit gracefully

    XMLWordPrintable

Details

    • 1

    Description

       

      Build : 7.0.0-4735

      Scenario:

      • Single node cluster, Couchbase bucket with custom scope and few collections
      • Insert few doc on each collection
      • Try to execute cbstats key|vkey command to fetch the key-stats on non-existent collections (In the below case, collection "c2" does not exists under _default scope)

      Observation:

      Seeing cbstats script backtraces + Memcached error prints on the console.

      ]# ./cbstats -u Administrator -p password localhost:11210 key test 127 _default.c2
      key test 127 _default.c2
      Traceback (most recent call last):
        File "/opt/couchbase/lib/python/cbstats", line 528, in stats_key
          vbs = mc.stats(cmd)
        File "/opt/couchbase/lib/python/mc_bin_client.py", line 631, in stats
          cmd, opaque, cas, klen, extralen, data = self._handleKeyedResponse(None)
        File "/opt/couchbase/lib/python/mc_bin_client.py", line 287, in _handleKeyedResponse
          raise MemcachedError(errcode,  msg)
      mc_bin_client.ErrorUnknownCollection: Memcached error #136:  UNKNOWN_COLLECTION : Operation specified an unknown collection. : {"error":{"context":"Unknown scope or collection in operation"},"manifest_uid":"4"}During handling of the above exception, another exception occurred:Traceback (most recent call last):
        File "/opt/couchbase/lib/python/cbstats", line 999, in <module>
          main()
        File "/opt/couchbase/lib/python/cbstats", line 996, in main
          c.execute()
        File "/opt/couchbase/lib/python/clitool.py", line 71, in execute
          f[0](mc, *args[2:], **opts.__dict__)
        File "/opt/couchbase/lib/python/cbstats", line 38, in g
          f(*args, **kwargs)
        File "/opt/couchbase/lib/python/cli_auth_utils.py", line 94, in g
          f(*args, **kwargs)
        File "/opt/couchbase/lib/python/cbstats", line 530, in stats_key
          print(e.message)
      AttributeError: 'ErrorUnknownCollection' object has no attribute 'message'
       
      ]# ./cbstats -u Administrator -p password localhost:11210 vkey test 127 _default.c2
      Traceback (most recent call last):
        File "/opt/couchbase/lib/python/cbstats", line 553, in stats_vkey
          vbs = mc.stats(cmd)
        File "/opt/couchbase/lib/python/mc_bin_client.py", line 631, in stats
          cmd, opaque, cas, klen, extralen, data = self._handleKeyedResponse(None)
        File "/opt/couchbase/lib/python/mc_bin_client.py", line 287, in _handleKeyedResponse
          raise MemcachedError(errcode,  msg)
      mc_bin_client.ErrorUnknownCollection: Memcached error #136:  UNKNOWN_COLLECTION : Operation specified an unknown collection. : {"error":{"context":"Unknown scope or collection in operation"},"manifest_uid":"4"}During handling of the above exception, another exception occurred:Traceback (most recent call last):
        File "/opt/couchbase/lib/python/cbstats", line 999, in <module>
          main()
        File "/opt/couchbase/lib/python/cbstats", line 996, in main
          c.execute()
        File "/opt/couchbase/lib/python/clitool.py", line 71, in execute
          f[0](mc, *args[2:], **opts.__dict__)
        File "/opt/couchbase/lib/python/cbstats", line 38, in g
          f(*args, **kwargs)
        File "/opt/couchbase/lib/python/cli_auth_utils.py", line 94, in g
          f(*args, **kwargs)
        File "/opt/couchbase/lib/python/cbstats", line 555, in stats_vkey
          print(e.message)
      AttributeError: 'ErrorUnknownCollection' object has no attribute 'message

      Expected behaviour:

      Would be better to see something like collection "c2" does not exists.

       

      Attachments

        Issue Links

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

          Activity

            People

              owend Daniel Owen
              ashwin.govindarajulu Ashwin Govindarajulu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty