apache/cassandra · error · IllegalArgumentException

Wrong parameters passed to start async profiler method…

Error message

Wrong parameters passed to start async profiler method. Passed parameters should be: ${ASYNC_PROFILER_START_PARAMS}

What it means

AsyncProfilerService.start validates that the parameter map passed to the profiler start call contains exactly the required parameter keys (ASYNC_PROFILER_START_PARAMS). If the caller passes unknown, missing, or extra parameters, an IllegalArgumentException is thrown before any profiling is started.

Solutions

  1. Inspect ASYNC_PROFILER_START_PARAMS in AsyncProfilerService and pass exactly that parameter set (no extra, no missing keys)
  2. Check the nodetool/jmx command syntax for the profiler start subcommand in your Cassandra version
  3. Log the map keys being passed and diff against the required set before calling start

Example fix

// before
service.start(Map.of("event", "cpu", "interval", "10ms"));
// after
service.start(AsyncProfilerService.ASYNC_PROFILER_START_PARAMS);
Defensive patterns

Strategy: validation

Validate before calling

if (!AsyncProfilerService.ASYNC_PROFILER_START_PARAMS.equals(params.keySet()))
    throw new IllegalArgumentException("start params must be exactly " + AsyncProfilerService.ASYNC_PROFILER_START_PARAMS);
service.start(params);

Try / catch

try { service.start(params); } catch (IllegalArgumentException e) { logger.warn("Bad profiler start params: {}", e.getMessage()); }

Prevention

When it happens

Trigger: Calling AsyncProfilerService.start with a Map<String,String> whose key set does not equal the required ASYNC_PROFILER_START_PARAMS set, e.g. via JMX/nodetool profiling start with misspelled or unsupported option names.

Common situations: Operators hand-typing profiling parameters into nodetool or JMX clients; scripts copied from older Cassandra versions where the accepted start parameters changed.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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

Appendix: source

Thrown at src/java/org/apache/cassandra/service/AsyncProfilerService.java:456

            if (dir.startsWith(location))
                throw new RuntimeException("You can not store Async-Profiler results into a data directory of Cassandra.");
        }

        try
        {
            new File(logDir).createDirectoriesIfNotExists();
        }
        catch (Throwable t)
        {
            throw new RuntimeException("Unable to create directory " + logDir);
        }
    }

    private void validateStartParameters(Map<String, String> parameters)
    {
        if (!ASYNC_PROFILER_START_PARAMS.equals(parameters.keySet()))
        {
            throw new IllegalArgumentException("Wrong parameters passed to start async profiler method. Passed parameters" +
                                               " should be: " + ASYNC_PROFILER_START_PARAMS);
        }
    }

    private void validateStopParameters(Map<String, String> parameters)
    {
        if (!ASYNC_PROFILER_STOP_PARAMS.containsAll(parameters.keySet()))
        {
            throw new IllegalArgumentException("Wrong parameters passed to stop async profiler method. Passed parameters" +
                                               " should be: " + ASYNC_PROFILER_STOP_PARAMS);
        }
    }

    private boolean isRunning()
    {
        if (!isEnabled())
            return false;

View on GitHub (pinned to 88fd0f6a0e)