{"record":{"id":"77cfb16f2353cec5","repo":"apache/cassandra","slug":"unable-to-parse","errorCode":null,"errorMessage":"Unable to parse {}.","messagePattern":"Unable to parse (.+?)\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/service/StartupChecks.java","lineNumber":802,"sourceCode":"\n        private final long EXPECTED_MAX_MAP_COUNT = 1048575;\n        private final String MAX_MAP_COUNT_PATH = \"/proc/sys/vm/max_map_count\";\n\n        private long getMaxMapCount()\n        {\n            final Path path = File.getPath(MAX_MAP_COUNT_PATH);\n            try (final BufferedReader bufferedReader = Files.newBufferedReader(path))\n            {\n                final String data = bufferedReader.readLine();\n                if (data != null)\n                {\n                    try\n                    {\n                        return Long.parseLong(data);\n                    }\n                    catch (final NumberFormatException e)\n                    {\n                        logger.warn(\"Unable to parse {}.\", path, e);\n                    }\n                }\n            }\n            catch (final IOException e)\n            {\n                logger.warn(\"IO exception while reading file {}.\", path, e);\n            }\n            return -1;\n        }\n\n        @Override\n        public void execute(StartupChecksConfiguration configuration)\n        {\n            if (configuration.isDisabled(name()) || !FBUtilities.isLinux)\n                return;\n\n            if (DatabaseDescriptor.getDiskAccessMode() == Config.DiskAccessMode.standard &&\n                DatabaseDescriptor.getIndexAccessMode() == Config.DiskAccessMode.standard)","sourceCodeStart":784,"sourceCodeEnd":820,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/StartupChecks.java#L784-L820","documentation":"checkMaxMapCount reads /proc/sys/vm/max_map_count via getMaxMapCount. If the file's content cannot be parsed as a long (NumberFormatException), the check logs 'Unable to parse {path}.' with the exception and returns -1, which causes the caller to skip the max_map_count validation instead of failing. This guards against non-numeric content from exotic /proc implementations.","triggerScenarios":"Long.parseLong fails on the first whitespace-delimited token read from /proc/sys/vm/max_map_count.","commonSituations":"Unusual kernels/libc sandboxes, FUSE or virtualized /proc, tampered sysctl output, running on non-Linux platforms where the file exists but holds unexpected text.","solutions":["Inspect `cat /proc/sys/vm/max_map_count`; fix whatever makes it non-numeric.","Set vm.max_map_count to a numeric value >= 1048575 (recommended) via sysctl.","If on a non-standard platform, verify Cassandra's Linux-specific /proc assumptions.","Treat as informational; the map-count check is skipped when the value cannot be parsed."],"exampleFix":"# before\ncat /proc/sys/vm/max_map_count -> not-a-number\n# after\nsysctl -w vm.max_map_count=1048575","handlingStrategy":"validation","validationCode":"String raw = new String(Files.readAllBytes(Paths.get(\"/proc/sys/vm/max_map_count\"))).trim().split(\"\\\\s+\")[0];\ntry { long v = Long.parseLong(raw); if (v < 1048575) System.out.println(\"max_map_count too low: \" + v); }\ncatch (NumberFormatException e) { System.out.println(\"max_map_count not numeric: \" + raw); }","typeGuard":null,"tryCatchPattern":"try { return Long.parseLong(data); }\ncatch (NumberFormatException e) { logger.warn(\"Unable to parse {}.\", path, e); return -1; }","preventionTips":["Keep vm.max_map_count >= 1048575 via sysctl.d.","Verify /proc/sys/vm/max_map_count prints a plain number on your platform.","Avoid non-Linux /proc emulations for production Cassandra.","Treat parse warnings as a signal the environment is non-standard."],"tags":["proc","startup-check","parse"],"backgroundTag":"invalid-config-value","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"}