{"record":{"id":"bc622ea992db8fef","repo":"apache/cassandra","slug":"there-was-an-attempt-to-load-custom-startup-check","errorCode":null,"errorMessage":"There was an attempt to load custom startup check with same name as in-built check: ${preFlightCheck.name()}","messagePattern":"There was an attempt to load custom startup check with same name as in-built check: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/StartupChecks.java","lineNumber":198,"sourceCode":"        catch (ServiceConfigurationError t)\n        {\n            throw new ConfigurationException(\"Unable to get startup checks via ServiceLoader. \" +\n                                             \"Custom checks will not be triggered.\", t);\n        }\n\n        if (!duplicitNames.isEmpty())\n        {\n            throw new IllegalStateException(\"There was an attempt to load custom startup \" +\n                                            \"checks with same name which is ambiguous: \" + duplicitNames);\n        }\n\n        for (StartupCheck customCheck : customChecks)\n        {\n            for (StartupCheck preFlightCheck : preFlightChecks)\n            {\n                if (preFlightCheck.name().equals(customCheck.name()))\n                {\n                    throw new IllegalStateException(\"There was an attempt to load custom startup check \" +\n                                                    \"with same name as in-built check: \" + preFlightCheck.name());\n                }\n            }\n        }\n\n        preFlightChecks.addAll(customChecks);\n\n        return this;\n    }\n\n    /**\n     * Add system test to be run before schema is loaded during startup\n     * @param test the system test to include\n     */\n    public StartupChecks withTest(StartupCheck test)\n    {\n        preFlightChecks.add(test);\n        return this;","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/StartupChecks.java#L180-L216","documentation":"A custom startup check registered via ServiceLoader uses a name() that collides with one of Cassandra's built-in pre-flight checks. Since names identify checks, Cassandra throws IllegalStateException to prevent a custom check from shadowing or being confused with an in-built one.","triggerScenarios":"During getCustomStartupChecks, a custom check's name() equals a built-in preFlightCheck's name() in the nested comparison loop.","commonSituations":"Naming a custom check 'snapshot' or 'disk_space' etc., colliding with built-ins; copying built-in check source as a template without changing name().","solutions":["Change the custom check's name() to a unique value not used by built-in checks","Consult the built-in pre-flight check names (in StartupChecks.java) and pick a vendor-prefixed name","Rebuild and redeploy the custom check jar"],"exampleFix":"// before\npublic String name() { return \"disk_space\"; }\n// after\npublic String name() { return \"acme_disk_space\"; }","handlingStrategy":"validation","validationCode":"compare planned custom check names against built-in check names listed in StartupChecks.java before deploy","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always vendor-prefix custom check names","Grep the built-in names when creating a new check","Never copy built-in check templates without renaming"],"tags":["startup","serviceloader","duplicate-name"],"backgroundTag":"conflicting-config-options","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"}