{"record":{"id":"a4eaf9d9688e25a5","repo":"apache/cassandra","slug":"was-already-installed-on-position-check-the","errorCode":null,"errorMessage":"{} was already installed on position {}. Check the configuration of JRE and either remove the provider from java.security or do not install this provider by Cassandra.","messagePattern":"(.+?) was already installed on position (.+?)\\. Check the configuration of JRE and either remove the provider from java\\.security or do not install this provider by Cassandra\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/security/AbstractCryptoProvider.java","lineNumber":124,"sourceCode":"            }\n\n            FBUtilities.classForNameWithoutInitialization(getProviderClassAsString(), \"crypto provider\", Provider.class);\n\n            String providerName = getProviderName();\n            int providerPosition = getProviderPosition(providerName);\n            if (providerPosition > 0)\n            {\n                if (providerPosition == 1)\n                {\n                    logger.info(\"{} was already installed on position {}.\", providerName, providerPosition);\n                }\n                else if (failOnMissingProvider)\n                {\n                    throw new IllegalStateException(String.format(\"%s was already installed on position %s.\", providerName, providerPosition));\n                }\n                else\n                {\n                    logger.warn(\"{} was already installed on position {}. Check the configuration of \" +\n                                \"JRE and either remove the provider from java.security or do not install this provider \" +\n                                \"by Cassandra.\", providerName, providerPosition);\n                    return;\n                }\n            }\n            else\n            {\n                Runnable r = installator();\n                if (r == null)\n                    throw new IllegalStateException(\"Installator runnable can not be null!\");\n                else\n                    r.run();\n            }\n\n            if (isHealthyInstallation())\n                logger.info(\"{} health check OK.\", getProviderName());\n            else\n                failureMessage = format(\"%s has not passed the health check. \" +","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/security/AbstractCryptoProvider.java#L106-L142","documentation":"AbstractCryptoProvider.install checks whether the target JCE security provider is already registered at the configured position. When it is and failOnMissingProvider is false, it logs this warning and skips installation; with failOnMissingProvider=true it throws IllegalStateException. It exists to prevent double-registering providers that the JDK already ships.","triggerScenarios":"Calling install() (directly or via EncryptedKey/SSLFactory crypto provider config) when a provider with the same name (e.g. default OpenSSL provider) is already present at the requested position in Security.getProviders(), typically because java.security already loads it.","commonSituations":"Upgrading to a JDK that bundles the provider natively; duplicate provider listed in the java.security file; cassandra.yaml crypto provider config pointing at a provider already installed.","solutions":["Remove the provider entry from the JDK's java.security file, or remove the Cassandra crypto_provider config so only one installs it.","Verify with a startup check (Security.getProviders()) which position the provider occupies and adjust provider_position.","If deliberate duplication is intended, accept the warning; it is harmless because the provider is already usable."],"exampleFix":"// before (cassandra.yaml)\ncrypto_provider:\n  - class_name: org.apache.cassandra.security.DefaultCryptoProvider\n// after: remove the stanza if the JRE already installs the provider\n# crypto_provider removed","handlingStrategy":"validation","validationCode":"// check if provider already installed before configuring\nboolean present = java.util.Arrays.stream(java.security.Security.getProviders())\n    .anyMatch(p -> p.getName().equals(\"AmazonCorrettoCryptoProvider\"));\nif (present) System.out.println(\"Remove crypto_provider from cassandra.yaml\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Audit the JDK's java.security file for pre-installed providers before adding crypto_provider config.","After JDK upgrades, re-check provider presence - newer JREs bundle common providers.","Keep cassandra.yaml crypto_provider entries minimal and intentional."],"tags":["security","crypto-provider","jce","configuration"],"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"}