juicedata/juicefs · error · RuntimeException

Cannot get file system.

Error message

Cannot get file system.

What it means

NNBench.configure reads test.nnbench.basedir from the Configuration and resolves a FileSystem via new Path(baseDir).getFileSystem(conf). Any exception while resolving (bad or null baseDir, no handler for the scheme, config error) is rethrown as a RuntimeException with this message, aborting the benchmark setup.

Source

Thrown at sdk/java/src/main/java/io/juicefs/bench/NNBench.java:440

    /**
     * Constructor
     */
    public NNBenchMapper() {
    }


    /**
     * Mapper base implementation
     */
    public void configure(JobConf conf) {
      setConf(conf);
      local = conf.getBoolean("test.nnbench.local", false);
      try {
        baseDir = conf.get("test.nnbench.basedir");
        filesystem = new Path(baseDir).getFileSystem(conf);
      } catch (Exception e) {
        throw new RuntimeException("Cannot get file system.", e);
      }

      numberOfFiles = conf.getLong("test.nnbench.numberoffiles", 1l);
      dataDirName = conf.get("test.nnbench.datadir.name");
      op = conf.get("test.nnbench.operation");
      beforeRename = conf.getBoolean("test.nnbench.deleteBeforeRename", false);

      threadsPerMap = conf.getInt("test.nnbench.threadsPerMap", 1);
      executorService = Executors.newFixedThreadPool(threadsPerMap, r -> {
        Thread t = new Thread(r);
        t.setDaemon(true);
        return t;
      });
    }

    /**
     * Mapper base implementation
     */

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Pass a valid basedir, e.g. -baseDir jfs://myvol/NNBench-<date>, ensuring the property test.nnbench.basedir is set in the job conf.
  2. Install the filesystem plugin for the basedir scheme (juicefs-hadoop jar + fs.jfs.impl config).
  3. Read the wrapped cause to see the actual resolution failure and fix it.
  4. Sanity-check with a plain local path (file:///tmp/nnbench) to isolate plugin issues from benchmark issues.

Example fix

// before
hadoop jar NNBench -baseDir (unset)
// after
hadoop jar NNBench -baseDir jfs://myvol/NNBench-2026 -numberOfFiles 10 ...
Defensive patterns

Strategy: validation

Validate before calling

String baseDir = conf.get("test.nnbench.basedir");
if (baseDir == null || baseDir.isEmpty()) throw new IllegalArgumentException("-baseDir is required");
Path p = new Path(baseDir);
if (p.toUri().getScheme() == null) throw new IllegalArgumentException("basedir needs an explicit scheme");

Try / catch

try {
  runNNBench(args);
} catch (RuntimeException e) {
  if ("Cannot get file system.".equals(e.getMessage())) {
    throw new IllegalArgumentException("bad/missing -baseDir or missing FS plugin", e.getCause());
  }
  throw e;
}

Prevention

When it happens

Trigger: Running NNBench without setting test.nnbench.basedir (conf.get returns null), or with a basedir URI whose scheme has no FileSystem implementation, inside localRun's job setup.

Common situations: Benchmarking JuiceFS with -baseDir pointing at a jfs:// path before the JuiceFS Hadoop jar/config is installed; typo in the basedir property name; running in a minimal container lacking the target filesystem plugin.

Understand the failure class

Background: "X is required", "must be set", "cannot be empty": the missing-required-config error family, from Vertex AI project/location to WeChat keys — this error's family across 18 libraries.

Related errors


AI-assisted analysis of juicedata/juicefs@c9a67b23e8 (2026-09-06). Data as JSON: /api/errors/f402dc4350b77888. Report an issue: GitHub.