{"record":{"id":"a6319b4c1025524a","repo":"apache/cassandra","slug":"async-profiler-is-not-enabled-enable-it-by-settin","errorCode":null,"errorMessage":"Async Profiler is not enabled. Enable it by setting ${ASYNC_PROFILER_ENABLED.getKey()} property to true.","messagePattern":"Async Profiler is not enabled\\. Enable it by setting (.+?) property to true\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/AsyncProfilerService.java","lineNumber":489,"sourceCode":"    {\n        if (!isEnabled())\n            return false;\n\n        try\n        {\n            String status = status();\n            return status != null && status.contains(\"Profiling is running\");\n        }\n        catch (Throwable t)\n        {\n            throw new RuntimeException(t);\n        }\n    }\n\n    private <T> T run(ThrowingFunction<AsyncProfiler, T> f)\n    {\n        if (!ASYNC_PROFILER_ENABLED.getBoolean())\n            throw new IllegalStateException(\"Async Profiler is not enabled. Enable it by setting \" + ASYNC_PROFILER_ENABLED.getKey() +\n                                            \" property to true.\");\n        if (asyncProfiler != null)\n        {\n            try\n            {\n                return f.apply(asyncProfiler);\n            }\n            catch (IllegalStateException | IllegalArgumentException t)\n            {\n                throw t;\n            }\n            catch (Throwable t)\n            {\n                throw new RuntimeException(t);\n            }\n        }\n        else\n            throw new IllegalStateException(\"Async profiler not available.\");","sourceCodeStart":471,"sourceCodeEnd":507,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/AsyncProfilerService.java#L471-L507","documentation":"All AsyncProfilerService operations (start, stop, execute, status) funnel through run(), which first checks the async_profiler_enabled config flag. If the feature is disabled, an IllegalStateException is thrown telling the user to enable the property.","triggerScenarios":"Calling start, stop, execute, or status on AsyncProfilerService while the async_profiler_enabled config property is false (the default).","commonSituations":"Operators attempting nodetool profiling on a node where async profiler was never enabled at startup; containers launched without the config override.","solutions":["Set async_profiler_enabled: true in cassandra.yaml (or the corresponding system property) and restart the node","Re-run the profiling command after enabling","If profiling is not intended, avoid calling the profiler endpoints"],"exampleFix":"// cassandra.yaml\n// before\nasync_profiler_enabled: false\n// after\nasync_profiler_enabled: true","handlingStrategy":"validation","validationCode":"if (!DatabaseDescriptor.getRawConfig().async_profiler_enabled)\n    throw new IllegalStateException(\"Enable async_profiler_enabled before calling the profiler service\");\nservice.status();","typeGuard":null,"tryCatchPattern":"try { service.start(params); } catch (IllegalStateException e) { if (e.getMessage().contains(\"not enabled\")) { /* surface 'enable async_profiler_enabled' to operator */ } throw e; }","preventionTips":["Check the async_profiler_enabled config before exposing profiler endpoints in tooling","Document the flag requirement in runbooks/scripts that call nodetool profiling","Enable the flag in test/staging cluster configs used for profiling"],"tags":["profiling","configuration","feature-flag"],"backgroundTag":"feature-not-enabled","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"}