From 1da5b3033ec73dfc33a5271cd8ce062f3caedf09 Mon Sep 17 00:00:00 2001 From: Ferenc Szili Date: Mon, 11 Mar 2024 18:33:35 +0100 Subject: [PATCH] scylla-nodetool: check for missing keyspace argument on describering Calling scylla-nodetool with option describering and ommiting the keyspace name argument results in a boost exception with the following error message: error running operation: boost::wrapexcept (boost::bad_any_cast: failed conversion using boost::any_cast) This change checks for the missing keyspace and outputs a more sensible error message: error processing arguments: keyspace must be specified Closes scylladb/scylladb#17741 --- tools/scylla-nodetool.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/scylla-nodetool.cc b/tools/scylla-nodetool.cc index f5c9d16699..c55faa614d 100644 --- a/tools/scylla-nodetool.cc +++ b/tools/scylla-nodetool.cc @@ -534,6 +534,10 @@ void decommission_operation(scylla_rest_client& client, const bpo::variables_map } void describering_operation(scylla_rest_client& client, const bpo::variables_map& vm) { + if (!vm.contains("keyspace")) { + throw std::invalid_argument("keyspace must be specified"); + } + const auto keyspace = vm["keyspace"].as(); const auto schema_version_res = client.get("/storage_service/schema_version");