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
- 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.
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
- 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.
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.
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- 32bit JVM detected. It is recommended to run Cassandra on…
- Async-profiler experience likely affected. Kernel symbols…
- Cannot parse the version of the file:
- Cassandra server running in degraded mode.
- Detected high ' ' setting of for device ' ' of data…
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)