apache/cassandra · error · IllegalStateException

No arguments.

Error message

No arguments.

What it means

IllegalArgumentException from the GuardrailsConfigCommand setter subcommand when execute is invoked without any arguments: neither a setter/guardrail name nor its arguments were provided, so there is nothing to configure and the command aborts.

Source

Thrown at src/java/org/apache/cassandra/tools/nodetool/GuardrailsConfigCommand.java:197

                        "For thresholds accepting integers, the reset value is -1.")
        private List<String> args = new ArrayList<>();

        @Parameters(index = "0", arity = "0..1")
        private String setterName;

        @Parameters(index = "1..*", arity = "0..*", description = "Arguments for the setter. For flags, possible values are 'true' or 'false'. " +
                "For thresholds, two values are expected, first for failure, second for warning. " +
                "For values, enumeration of values expected or one value where multiple items are separated by comma. " +
                "Setting for thresholds accepting strings and value guardrails are reset by specifying 'null' or '[]' value. " +
                "For thresholds accepting integers, the reset value is -1.")
        private List<String> setterArgs = new ArrayList<>();

        @Override
        public void execute(NodeProbe probe)
        {
            args = CommandUtils.concatArgs(setterName, setterArgs);
            if (args.isEmpty())
                throw new IllegalStateException("No arguments.");

            String snakeCaseName = args.get(0);

            Method setter = getAllSetters(probe).entrySet().stream()
                                                .findFirst()
                                                .map(o -> o.getValue().get(0))
                                                .orElseThrow(() -> new IllegalStateException(format("Guardrail %s not found.", snakeCaseName)));

            sanitizeArguments(setter, args);
            validateArguments(setter, snakeCaseName, args);

            List<String> methodArgs = args.subList(1, args.size());
            try
            {
                setter.invoke(probe.getGuardrailsMBean(), prepareArguments(methodArgs, setter));
            }
            catch (Exception ex)
            {

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Supply the guardrail setter name and the value(s): `nodetool guardrailsconfig set <guardrail> <value>...`.
  2. Quote/verify script variables so the arguments aren't dropped.
  3. Run `nodetool help guardrails-config` for the exact usage.

Example fix

// before
nodetool guardrailsconfig set
// after
nodetool guardrailsconfig set read_consistency_level EACH_QUORUM
Defensive patterns

Strategy: validation

Validate before calling

def validate_set_args(argv):
    if len(argv) < 1:
        raise SystemExit('Usage: nodetool guardrailsconfig set <guardrail> <value>...')

Try / catch

try:
    run(['nodetool','guardrailsconfig','set']+args)
except subprocess.CalledProcessError:
    sys.exit('guardrails set requires a guardrail name and value(s)')

Prevention

When it happens

Trigger: Running `nodetool guardrailsconfig set` with no positional arguments at all.

Common situations: Forgetting the guardrail name and value when setting; scripts with empty/unexpanded variables losing their arguments.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/73467d8a5d8b9f7d. Report an issue: GitHub.