{"record":{"id":"b27e2c52de37cb5b","repo":"apache/cassandra","slug":"key-s-was-not-found-in-keystore","errorCode":null,"errorMessage":"key %s was not found in keystore","messagePattern":"key (.+?) was not found in keystore","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/security/JKSKeyProvider.java","lineNumber":84,"sourceCode":"    {\n        // there's a lovely behavior with jceks files that all aliases are lower-cased\n        if (isJceks)\n            keyAlias = toLowerCaseLocalized(keyAlias);\n\n        Key key;\n        try\n        {\n            String password = options.get(PROP_KEY_PW);\n            if (password == null || password.isEmpty())\n                password = options.get(PROP_KEYSTORE_PW);\n            key = store.getKey(keyAlias, password.toCharArray());\n        }\n        catch (Exception e)\n        {\n            throw new IOException(\"unable to load key from keystore\");\n        }\n        if (key == null)\n            throw new IOException(String.format(\"key %s was not found in keystore\", keyAlias));\n        return key;\n    }\n}\n","sourceCodeStart":66,"sourceCodeEnd":88,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/security/JKSKeyProvider.java#L66-L88","documentation":"In JKSKeyProvider.getSecretKey, store.getKey returned null after not throwing: the requested alias does not exist in the keystore (remembering JCEKS lowercases aliases). An IOException('key %s was not found in keystore') is thrown because TDE requires the named secret.","triggerScenarios":"Thrown at src/java/org/apache/cassandra/security/JKSKeyProvider.java:84 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the correct key_alias configured in transparent_data_encryption_options","Add the missing key/alias to the keystore or point config to an alias that exists"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}