{"record":{"id":"7f6b72e7fed94bf4","repo":"apache/cassandra","slug":"failed-to-read-keystore-password-from-the-s-for","errorCode":null,"errorMessage":"'Failed to read keystore password from the %s for %s","messagePattern":"'Failed to read keystore password from the (.+?) for (.+?)","errorType":"exception","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java","lineNumber":333,"sourceCode":"\n            if (!keystorePasswordFile.exists())\n            {\n                final String msg = format(\"keystore password file %s does not exist\", keystorePasswordFile.path());\n                throw new ConfigurationException(msg);\n            }\n\n            try\n            {\n                // we expect a password to be on the first line\n                List<String> lines = FileUtils.readLines(keystorePasswordFile);\n                if (lines.isEmpty())\n                    return \"\";\n\n                return lines.get(0);\n            }\n            catch (RuntimeException e)\n            {\n                throw new ConfigurationException(format(\"'Failed to read keystore password from the %s for %s\",\n                                                        keystorePasswordFile, keystoreFilePath),\n                                                 e);\n            }\n        }\n    }\n}\n","sourceCodeStart":315,"sourceCodeEnd":340,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java#L315-L340","documentation":"In resolvePassword, reading the keystore password file failed: the file is empty or a RuntimeException occurred while reading its first line. The code throws ConfigurationException('Failed to read keystore password from the %s for %s') so TLS setup fails with a clear config error instead of a null/blank password.","triggerScenarios":"Thrown at src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java:333 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix file permissions/ownership so the password file is readable by the Cassandra process","Verify the file's first line contains the password and re-create the file if corrupt"],"exampleFix":null,"handlingStrategy":"try-catch","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"}