{"record":{"id":"feb9801e3ade3305","repo":"apache/cassandra","slug":"wrong-parameters-passed-to-start-async-profiler-me","errorCode":null,"errorMessage":"Wrong parameters passed to start async profiler method. Passed parameters should be: ${ASYNC_PROFILER_START_PARAMS}","messagePattern":"Wrong parameters passed to start async profiler method\\. Passed parameters should be: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/AsyncProfilerService.java","lineNumber":456,"sourceCode":"            if (dir.startsWith(location))\n                throw new RuntimeException(\"You can not store Async-Profiler results into a data directory of Cassandra.\");\n        }\n\n        try\n        {\n            new File(logDir).createDirectoriesIfNotExists();\n        }\n        catch (Throwable t)\n        {\n            throw new RuntimeException(\"Unable to create directory \" + logDir);\n        }\n    }\n\n    private void validateStartParameters(Map<String, String> parameters)\n    {\n        if (!ASYNC_PROFILER_START_PARAMS.equals(parameters.keySet()))\n        {\n            throw new IllegalArgumentException(\"Wrong parameters passed to start async profiler method. Passed parameters\" +\n                                               \" should be: \" + ASYNC_PROFILER_START_PARAMS);\n        }\n    }\n\n    private void validateStopParameters(Map<String, String> parameters)\n    {\n        if (!ASYNC_PROFILER_STOP_PARAMS.containsAll(parameters.keySet()))\n        {\n            throw new IllegalArgumentException(\"Wrong parameters passed to stop async profiler method. Passed parameters\" +\n                                               \" should be: \" + ASYNC_PROFILER_STOP_PARAMS);\n        }\n    }\n\n    private boolean isRunning()\n    {\n        if (!isEnabled())\n            return false;\n","sourceCodeStart":438,"sourceCodeEnd":474,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/AsyncProfilerService.java#L438-L474","documentation":"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.","triggerScenarios":"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.","commonSituations":"Operators hand-typing profiling parameters into nodetool or JMX clients; scripts copied from older Cassandra versions where the accepted start parameters changed.","solutions":["Inspect ASYNC_PROFILER_START_PARAMS in AsyncProfilerService and pass exactly that parameter set (no extra, no missing keys)","Check the nodetool/jmx command syntax for the profiler start subcommand in your Cassandra version","Log the map keys being passed and diff against the required set before calling start"],"exampleFix":"// before\nservice.start(Map.of(\"event\", \"cpu\", \"interval\", \"10ms\"));\n// after\nservice.start(AsyncProfilerService.ASYNC_PROFILER_START_PARAMS);","handlingStrategy":"validation","validationCode":"if (!AsyncProfilerService.ASYNC_PROFILER_START_PARAMS.equals(params.keySet()))\n    throw new IllegalArgumentException(\"start params must be exactly \" + AsyncProfilerService.ASYNC_PROFILER_START_PARAMS);\nservice.start(params);","typeGuard":null,"tryCatchPattern":"try { service.start(params); } catch (IllegalArgumentException e) { logger.warn(\"Bad profiler start params: {}\", e.getMessage()); }","preventionTips":["Build the parameters map from ASYNC_PROFILER_START_PARAMS constants, never free-form strings","Diff map keys against the required set in tests before calling start","Wrap profiler start in a helper that validates keys first"],"tags":["profiling","validation","illegal-argument"],"backgroundTag":"invalid-argument-value","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}