Skip to content

Commit 749083e

Browse files
redm2daverigby
authored andcommitted
MB-27146: add err msg for non-KVnode cbstats calls
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]>
1 parent c86ff24 commit 749083e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

engines/ep/management/cli_auth_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ def g(*args, **kwargs):
110110
print("No access to bucket:{0} - permission denied "
111111
"or bucket does not exist.".format(bucket))
112112
sys.exit(1)
113+
except mc_bin_client.ErrorKeyEnoent:
114+
print(
115+
"Error: bucket:{0} was not found - is this node running the Data Service?".format(bucket))
116+
sys.exit(1)
113117

114118
return g
115119

engines/ep/management/clitool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def execute(self):
8888
if type(e) is tuple and e[0] == 32 or \
8989
isinstance(e, socket.error) and e.errno == 32:
9090
print("Could not connect to %s:%d: "
91-
"Connection refused" % (host, port), file=sys.stderr)
91+
"Connection refused" % (host, port), file=sys.stderr)
9292
else:
9393
raise
9494

0 commit comments

Comments
 (0)