Skip to content

Commit

Permalink
MB-27146: add err msg for non-KVnode cbstats calls
Browse files Browse the repository at this point in the history
Instead of exiting with "mc_bin_client.ErrorKeyEnoent: Memcached error #1:
KEY_ENOENT : Not Found :" any time a cbstats call is executed against a
node that is not running the Data (KV) Service, catch and specifically
handle this error - printing a more user-friendly error message.

Change-Id: I26f41ed3ec4f14fa5259bc182978503a8e872c4c
Reviewed-on: https://review.couchbase.org/c/kv_engine/+/172296
Tested-by: Build Bot <[email protected]>
Reviewed-by: Dave Rigby <[email protected]>
  • Loading branch information
redm2 authored and daverigby committed Mar 28, 2022
1 parent c86ff24 commit 749083e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions engines/ep/management/cli_auth_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ def g(*args, **kwargs):
print("No access to bucket:{0} - permission denied "
"or bucket does not exist.".format(bucket))
sys.exit(1)
except mc_bin_client.ErrorKeyEnoent:
print(
"Error: bucket:{0} was not found - is this node running the Data Service?".format(bucket))
sys.exit(1)

return g

Expand Down
2 changes: 1 addition & 1 deletion engines/ep/management/clitool.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def execute(self):
if type(e) is tuple and e[0] == 32 or \
isinstance(e, socket.error) and e.errno == 32:
print("Could not connect to %s:%d: "
"Connection refused" % (host, port), file=sys.stderr)
"Connection refused" % (host, port), file=sys.stderr)
else:
raise

Expand Down

0 comments on commit 749083e

Please sign in to comment.