{"record":{"id":"a8db318c3f5deaa8","repo":"apache/cassandra","slug":"async-profiler-not-available","errorCode":null,"errorMessage":"Async profiler not available.","messagePattern":"Async profiler not available\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/AsyncProfilerService.java","lineNumber":507,"sourceCode":"            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.\");\n    }\n\n    public abstract static class ThrowingFunction<A, B>\n    {\n        public abstract B apply(AsyncProfiler a) throws Throwable;\n    }\n\n    private AsyncProfiler getProfiler()\n    {\n        if (!ASYNC_PROFILER_ENABLED.getBoolean())\n            return null;\n\n        if (asyncProfiler != null)\n            return asyncProfiler;\n\n        try\n        {\n            asyncProfiler = AsyncProfiler.getInstance();","sourceCodeStart":489,"sourceCodeEnd":525,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/AsyncProfilerService.java#L489-L525","documentation":"run() checks that the AsyncProfiler instance was successfully obtained at service construction (via getProfiler). If asyncProfiler is null — i.e. the profiler library could not be attached — any start/stop/execute/status call throws IllegalStateException('Async profiler not available.').","triggerScenarios":"Calling any AsyncProfilerService operation when the AsyncProfiler instance failed to initialize (e.g. libasyncProfiler.so could not be loaded at JVM startup), even with the feature enabled.","commonSituations":"Async profiler agent library missing from the library path or wrong architecture; feature flag enabled but the native agent never attached; tests that did not call reset()/initialize the profiler.","solutions":["Verify the async-profiler native library is installed and loadable by the JVM (check LD_LIBRARY_PATH / -agentpath)","Ensure the node was started with the async profiler agent attached","Call AsyncProfilerService.reset()/reinitialize in tests before exercising the service","Check startup logs for the original AsyncProfiler.getInstance() failure"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { service.execute(cmd); } catch (IllegalStateException e) { if (e.getMessage().contains(\"not available\")) { fallbackToLocalDiagnostics(); return; } throw e; }","preventionTips":["Verify the async-profiler native library loads at startup before enabling the feature","Check node startup logs for profiler initialization failures after deployments","Alert on this error in monitoring to catch missing native libraries early"],"tags":["profiling","initialization","native-library"],"backgroundTag":"module-init-failed","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"}