{"record":{"id":"f402dc4350b77888","repo":"juicedata/juicefs","slug":"cannot-get-file-system","errorCode":null,"errorMessage":"Cannot get file system.","messagePattern":"Cannot get file system\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdk/java/src/main/java/io/juicefs/bench/NNBench.java","lineNumber":440,"sourceCode":"\n    /**\n     * Constructor\n     */\n    public NNBenchMapper() {\n    }\n\n\n    /**\n     * Mapper base implementation\n     */\n    public void configure(JobConf conf) {\n      setConf(conf);\n      local = conf.getBoolean(\"test.nnbench.local\", false);\n      try {\n        baseDir = conf.get(\"test.nnbench.basedir\");\n        filesystem = new Path(baseDir).getFileSystem(conf);\n      } catch (Exception e) {\n        throw new RuntimeException(\"Cannot get file system.\", e);\n      }\n\n      numberOfFiles = conf.getLong(\"test.nnbench.numberoffiles\", 1l);\n      dataDirName = conf.get(\"test.nnbench.datadir.name\");\n      op = conf.get(\"test.nnbench.operation\");\n      beforeRename = conf.getBoolean(\"test.nnbench.deleteBeforeRename\", false);\n\n      threadsPerMap = conf.getInt(\"test.nnbench.threadsPerMap\", 1);\n      executorService = Executors.newFixedThreadPool(threadsPerMap, r -> {\n        Thread t = new Thread(r);\n        t.setDaemon(true);\n        return t;\n      });\n    }\n\n    /**\n     * Mapper base implementation\n     */","sourceCodeStart":422,"sourceCodeEnd":458,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/sdk/java/src/main/java/io/juicefs/bench/NNBench.java#L422-L458","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Pass a valid basedir, e.g. -baseDir jfs://myvol/NNBench-<date>, ensuring the property test.nnbench.basedir is set in the job conf.","Install the filesystem plugin for the basedir scheme (juicefs-hadoop jar + fs.jfs.impl config).","Read the wrapped cause to see the actual resolution failure and fix it.","Sanity-check with a plain local path (file:///tmp/nnbench) to isolate plugin issues from benchmark issues."],"exampleFix":"// before\nhadoop jar NNBench -baseDir (unset)\n// after\nhadoop jar NNBench -baseDir jfs://myvol/NNBench-2026 -numberOfFiles 10 ...","handlingStrategy":"validation","validationCode":"String baseDir = conf.get(\"test.nnbench.basedir\");\nif (baseDir == null || baseDir.isEmpty()) throw new IllegalArgumentException(\"-baseDir is required\");\nPath p = new Path(baseDir);\nif (p.toUri().getScheme() == null) throw new IllegalArgumentException(\"basedir needs an explicit scheme\");","typeGuard":null,"tryCatchPattern":"try {\n  runNNBench(args);\n} catch (RuntimeException e) {\n  if (\"Cannot get file system.\".equals(e.getMessage())) {\n    throw new IllegalArgumentException(\"bad/missing -baseDir or missing FS plugin\", e.getCause());\n  }\n  throw e;\n}","preventionTips":["Always pass -baseDir with an explicit scheme when launching NNBench.","Install the FS plugin jar on every node before benchmarking.","Resolve the Path to a FileSystem once in a dry-run check before the job."],"tags":["java","hadoop","benchmark","filesystem"],"backgroundTag":"missing-required-config","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}