apache/hadoop · error · IOException

Cannot find any path capability

Error message

Cannot find any path capability

What it means

HdfsCompatServer collects the union of CommonPathCapabilities (read-only connector, snapshots, storage policy, symlinks, truncate, xattrs, ...) and probes fs().hasPathCapability(base, cap) for each. If the filesystem under test reports none of them, it throws IOException('Cannot find any path capability'). hasPathCapability is how modern Hadoop filesystems advertise features; a filesystem answering false for all of them is unusable for the bench.

Source

Thrown at hadoop-tools/hadoop-compat-bench/src/main/java/org/apache/hadoop/fs/compat/cases/HdfsCompatServer.java:225

    allCaps.add(CommonPathCapabilities.FS_APPEND);
    allCaps.add(CommonPathCapabilities.FS_CHECKSUMS);
    allCaps.add(CommonPathCapabilities.FS_CONCAT);
    allCaps.add(CommonPathCapabilities.FS_LIST_CORRUPT_FILE_BLOCKS);
    allCaps.add(CommonPathCapabilities.FS_PATHHANDLES);
    allCaps.add(CommonPathCapabilities.FS_PERMISSIONS);
    allCaps.add(CommonPathCapabilities.FS_READ_ONLY_CONNECTOR);
    allCaps.add(CommonPathCapabilities.FS_SNAPSHOTS);
    allCaps.add(CommonPathCapabilities.FS_STORAGEPOLICY);
    allCaps.add(CommonPathCapabilities.FS_SYMLINKS);
    allCaps.add(CommonPathCapabilities.FS_TRUNCATE);
    allCaps.add(CommonPathCapabilities.FS_XATTRS);
    final Path base = getBasePath();
    for (String cap : allCaps) {
      if (fs().hasPathCapability(base, cap)) {
        return;
      }
    }
    throw new IOException("Cannot find any path capability");
  }
}

View on GitHub (pinned to 2add963021)

Solutions

  1. Run the bench against a filesystem that declares capabilities, e.g. HDFS (hdfs://...)
  2. If you maintain the connector, override hasPathCapability(Path, String) and return true for the capabilities it genuinely supports (constants in CommonPathCapabilities)
  3. Verify the -uri base path actually resolves to the filesystem you mean to test (mounts, default FS, symlinks)
  4. Upgrade the connector to a release implementing PathCapability

Example fix

// before: connector inherits FileSystem.hasPathCapability -> always false
// -> IOException: Cannot find any path capability

// after
@Override
public boolean hasPathCapability(Path path, String capability)
    throws IOException {
  switch (capability) {
  case CommonPathCapabilities.FS_XATTRS:
  case CommonPathCapabilities.FS_TRUNCATE:
    return true;
  default:
    return super.hasPathCapability(path, capability);
  }
}
Defensive patterns

Strategy: validation

Validate before calling

FileSystem fs = basePath.getFileSystem(conf);
String[] probes = {
    CommonPathCapabilities.FS_READ_ONLY_CONNECTOR,
    CommonPathCapabilities.FS_SNAPSHOTS,
    CommonPathCapabilities.FS_TRUNCATE,
    CommonPathCapabilities.FS_XATTRS };
boolean any = false;
for (String cap : probes) {
  try {
    if (fs.hasPathCapability(basePath, cap)) { any = true; break; }
  } catch (IOException ignored) { /* treat as unsupported */ }
}
if (!any) {
  throw new IOException(fs.getUri()
      + " reports no path capabilities; not usable for the compat bench");
}

Prevention

When it happens

Trigger: Pointing -uri at a FileSystem that does not override hasPathCapability (the FileSystem default returns false for everything), a stub/empty test filesystem, or a FilterFileSystem wrapper that does not forward the call. The probe runs against getBasePath(), so a base path that resolves to a different filesystem than intended also triggers it.

Common situations: Custom or third-party connectors written before the PathCapability API (Hadoop 3.3.x era) that never implemented hasPathCapability; older connector versions; testing a wrapped filesystem (viewfs/filter) that drops capability queries.

Related errors


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/bf3d08a416b351fe. Report an issue: GitHub.