apache/cassandra · warning

Unable to parse .

Error message

Unable to parse {}.

What it means

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.

Solutions

  1. Inspect `cat /proc/sys/vm/max_map_count`; fix whatever makes it non-numeric.
  2. Set vm.max_map_count to a numeric value >= 1048575 (recommended) via sysctl.
  3. If on a non-standard platform, verify Cassandra's Linux-specific /proc assumptions.
  4. Treat as informational; the map-count check is skipped when the value cannot be parsed.

Example fix

# before
cat /proc/sys/vm/max_map_count -> not-a-number
# after
sysctl -w vm.max_map_count=1048575
Defensive patterns

Strategy: validation

Validate before calling

String raw = new String(Files.readAllBytes(Paths.get("/proc/sys/vm/max_map_count"))).trim().split("\\s+")[0];
try { long v = Long.parseLong(raw); if (v < 1048575) System.out.println("max_map_count too low: " + v); }
catch (NumberFormatException e) { System.out.println("max_map_count not numeric: " + raw); }

Try / catch

try { return Long.parseLong(data); }
catch (NumberFormatException e) { logger.warn("Unable to parse {}.", path, e); return -1; }

Prevention

When it happens

Trigger: Long.parseLong fails on the first whitespace-delimited token read from /proc/sys/vm/max_map_count.

Common situations: Unusual kernels/libc sandboxes, FUSE or virtualized /proc, tampered sysctl output, running on non-Linux platforms where the file exists but holds unexpected text.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/77cfb16f2353cec5. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/service/StartupChecks.java:802

        private final long EXPECTED_MAX_MAP_COUNT = 1048575;
        private final String MAX_MAP_COUNT_PATH = "/proc/sys/vm/max_map_count";

        private long getMaxMapCount()
        {
            final Path path = File.getPath(MAX_MAP_COUNT_PATH);
            try (final BufferedReader bufferedReader = Files.newBufferedReader(path))
            {
                final String data = bufferedReader.readLine();
                if (data != null)
                {
                    try
                    {
                        return Long.parseLong(data);
                    }
                    catch (final NumberFormatException e)
                    {
                        logger.warn("Unable to parse {}.", path, e);
                    }
                }
            }
            catch (final IOException e)
            {
                logger.warn("IO exception while reading file {}.", path, e);
            }
            return -1;
        }

        @Override
        public void execute(StartupChecksConfiguration configuration)
        {
            if (configuration.isDisabled(name()) || !FBUtilities.isLinux)
                return;

            if (DatabaseDescriptor.getDiskAccessMode() == Config.DiskAccessMode.standard &&
                DatabaseDescriptor.getIndexAccessMode() == Config.DiskAccessMode.standard)

View on GitHub (pinned to 88fd0f6a0e)