{"record":{"id":"1e26076b0d3a68cf","repo":"apache/cassandra","slug":"uninstallation-of-failed","errorCode":null,"errorMessage":"Uninstallation of {} failed","messagePattern":"Uninstallation of (.+?) failed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/security/AbstractCryptoProvider.java","lineNumber":171,"sourceCode":"        }\n        catch (Throwable ex)\n        {\n            failureMessage = format(\"The installation of %s was not successful, reason: %s\",\n                                    getProviderClassAsString(), ex.getMessage());\n            t = ex;\n        }\n\n        if (failureMessage != null)\n        {\n            // To be sure there is not any leftover, proactively remove this provider in case of any failure.\n            // This method returns silently if the provider is not installed or if name is null.\n            try\n            {\n                uninstall();\n            }\n            catch (Throwable throwable)\n            {\n                logger.warn(\"Uninstallation of {} failed\", getProviderName(), throwable);\n            }\n\n            if (failOnMissingProvider)\n                throw new ConfigurationException(failureMessage, t);\n            else\n                logger.warn(failureMessage);\n        }\n    }\n\n    /**\n     * Uninstalls this crypto provider of name {@link #getProviderName()}\n     *\n     * @see Security#removeProvider(String)\n     */\n    public void uninstall()\n    {\n        Security.removeProvider(getProviderName());\n    }","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/security/AbstractCryptoProvider.java#L153-L189","documentation":"During install(), if the target provider is missing, Cassandra attempts uninstall() to clean stale registrations before installing. If uninstall throws, it logs this warning with the throwable and continues; the original failure is then raised (or warned) via failureMessage. It signals that a prior/incomplete provider registration could not be cleaned up.","triggerScenarios":"install() finds the provider missing, calls uninstall(), and Security.removeProvider() (or the provider's un-install hook) throws a Throwable (e.g. SecurityException from a security manager, or provider deregistration failure).","commonSituations":"JDK policy blocking provider modification; provider name mismatch between config and java.security; partially-initialized JVM security registry.","solutions":["Inspect the logged throwable to find why removeProvider failed (permissions, wrong name).","Fix the provider name in cassandra.yaml crypto_provider config to match getProviderName().","Remove stale provider registrations manually from the java.security file and restart."],"exampleFix":"// before\ncrypto_provider:\n  - class_name: org.apache.cassandra.security.ThreadLocalSecurityProvider\n    parameters:\n      - name: provider_name\n        value: \"WrongName\"\n// after\nvalue: \"AmazonCorrettoCryptoProvider\"  // match actual provider name","handlingStrategy":"validation","validationCode":"// verify provider name matches what Cassandra will uninstall\nString expected = org.apache.cassandra.security.DefaultCryptoProvider.getProviderName();\nif (java.security.Security.getProvider(expected) == null)\n    System.out.println(\"Provider \" + expected + \" not registered; config mismatch likely\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep provider_name in cassandra.yaml exactly matching the provider's getName().","Test crypto provider config on a staging JVM identical to production JDK.","Avoid security-manager policies that block Security.removeProvider."],"tags":["security","crypto-provider","jce","cleanup"],"backgroundTag":"unsupported-operation","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"}