{"record":{"id":"1849014533b28da8","repo":"apache/cassandra","slug":"unable-to-read-reserved-keywords-file-s","errorCode":null,"errorMessage":"Unable to read reserved keywords file '%s'","messagePattern":"Unable to read reserved keywords file '(.+?)'","errorType":"error_code","errorClass":"ConfigurationException","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/cql3/ReservedKeywords.java","lineNumber":56,"sourceCode":"\n    @VisibleForTesting\n    static final Set<String> reservedKeywords = getFromResource();\n\n    private static Set<String> getFromResource()\n    {\n        ImmutableSet.Builder<String> builder = ImmutableSet.builder();\n        try (InputStream is = ReservedKeywords.class.getResource(FILE_NAME).openConnection().getInputStream();\n             BufferedReader r = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8)))\n        {\n            String line;\n            while ((line = r.readLine()) != null)\n            {\n                builder.add(line.trim());\n            }\n        }\n        catch (IOException e)\n        {\n            throw new ConfigurationException(String.format(\"Unable to read reserved keywords file '%s'\", FILE_NAME), e);\n        }\n        return builder.build();\n    }\n\n    public static boolean isReserved(String text)\n    {\n        return reservedKeywords.contains(toUpperCaseLocalized(text));\n    }\n}\n","sourceCodeStart":38,"sourceCodeEnd":66,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/cql3/ReservedKeywords.java#L38-L66","documentation":"At class initialization ReservedKeywords loads its list of reserved CQL words from a resource file bundled in the Cassandra jar. If reading that resource throws IOException, it aborts startup/configuration with ConfigurationException. This is an internal resource-loading failure, not a user query problem.","triggerScenarios":"Class initialization of ReservedKeywords when the resource file (org/apache/cassandra/cql3/reservedkeywords.txt) is missing from the classpath or unreadable — e.g. corrupted/incomplete jar, shaded jar that excluded resources, custom classloader issues.","commonSituations":"Manually assembled classpaths missing resource files; repackaged/truncated cassandra jar; embedded usage where a build plugin stripped non-class resources; running from a damaged installation.","solutions":["Restore the complete official Cassandra jar (the resource file must be inside it)","If building a fat/shaded jar, include resources from the Cassandra jar (don't filter/exclude .txt resources)","Verify with `unzip -l cassandra-all.jar | grep reservedkeywords` that the file exists","Re-download/redeploy the installation if files are corrupted"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"try (InputStream in = getClass().getResourceAsStream(FILE_NAME)) {\n    if (in == null) throw new IllegalStateException(\"reserved keywords resource missing from jar\");\n}","typeGuard":null,"tryCatchPattern":"try { ReservedKeywords.isReserved(word); } catch (ThrowableInInitializerError | NoClassDefFoundError e) { verifyJarIntegrity(); throw e; }","preventionTips":["Deploy official, unmodified Cassandra jars","Do not exclude resource files when shading/fat-jarring","Verify jar checksums after download"],"tags":["classpath","resource-loading","configuration","startup"],"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"}