{"record":{"id":"313f6e7a4be0d49f","repo":"apache/cassandra","slug":"dictionary-file-s-does-not-exist","errorCode":null,"errorMessage":"Dictionary file %s does not exist.","messagePattern":"Dictionary file (.+?) does not exist\\.","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/guardrails/CassandraPasswordConfiguration.java","lineNumber":280,"sourceCode":"\n        int minimumLenghtOfFailCharacteristics = 0;\n        for (int i = 0; i < characteristicsFail; i++)\n            minimumLenghtOfFailCharacteristics += minimumLengthsFail[i];\n\n        if (minimumLenghtOfFailCharacteristics > lengthFail)\n            throw new ConfigurationException(format(\"The shortest password to pass the failing validator for any %s \" +\n                                                    \"characteristics out of %s is %s but you have set the %s to %s.\",\n                                                    characteristicsFail,\n                                                    MAX_CHARACTERISTICS,\n                                                    minimumLenghtOfFailCharacteristics,\n                                                    LENGTH_FAIL_KEY,\n                                                    lengthFail));\n\n        if (dictionary != null)\n        {\n            File dictionaryFile = new File(dictionary);\n            if (!dictionaryFile.exists())\n                throw new ConfigurationException(format(\"Dictionary file %s does not exist.\", dictionary));\n\n            if (!dictionaryFile.isReadable())\n                throw new ConfigurationException(format(\"Dictionary file %s is not readable.\", dictionary));\n        }\n    }\n\n    private ConfigurationException getValidationException(String key1, int value1, String key2, int value2)\n    {\n        return new ConfigurationException(format(\"%s of value %s is less or equal to %s of value %s\",\n                                                 key1, value1,\n                                                 key2, value2));\n    }\n}\n","sourceCodeStart":262,"sourceCodeEnd":294,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/guardrails/CassandraPasswordConfiguration.java#L262-L294","documentation":"The password validator's dictionary guardrail requires a word-list file on the node's local filesystem. When the configured dictionary path (cassandra.password_validator.dictionary) points to a path that does not exist, validateParameters throws a ConfigurationException during configuration loading.","triggerScenarios":"Setting cassandra.password_validator.dictionary to a nonexistent or mistyped absolute path; the file being deleted after configuration was written; paths valid on one node but not others in a heterogeneous deployment.","commonSituations":"Config file copied from another machine with a different layout; the dictionary file not provisioned on every node; relative path resolved against an unexpected working directory.","solutions":["Create the dictionary file at the configured path, or correct the path in the configuration to point at an existing file","Verify on each node with `ls <path>` that the file exists locally (config is per-node)","Use a deployment tool (e.g. config management) to distribute the dictionary file to all nodes before applying the config"],"exampleFix":"// before\ncassandra.password_validator.dictionary: /etc/cassandra/passwords.txt  (file missing)\n// after\nsudo cp wordlist.txt /etc/cassandra/passwords.txt  # then reload config, or fix the path","handlingStrategy":"validation","validationCode":"import java.io.File;\nFile f = new File(dictionaryPath);\nif (!f.exists()) throw new IllegalStateException(\"Dictionary missing: \" + dictionaryPath);","typeGuard":null,"tryCatchPattern":"try {\n    applyGuardrailConfig(config);\n} catch (ConfigurationException e) {\n    if (e.getMessage().startsWith(\"Dictionary file\") && e.getMessage().contains(\"does not exist\")) {\n        logger.error(\"Provision dictionary at configured path: {}\", e.getMessage());\n    }\n}","preventionTips":["Provision the dictionary file on every node before enabling the guardrail","Use absolute paths, not relative ones","Add a config-management check that the file exists on all nodes"],"tags":["configuration","guardrails","filesystem","file-not-found"],"backgroundTag":"file-not-found","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}