{"record":{"id":"831a97b6b6bc45e4","repo":"juicedata/juicefs","slug":"cannot-create-file-system","errorCode":null,"errorMessage":"Cannot create file system.","messagePattern":"Cannot create file system\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdk/java/src/main/java/io/juicefs/bench/TestDFSIO.java","lineNumber":479,"sourceCode":"    }\n\n    public byte[] getBuffer() {\n      if (randomBytes) {\n        random.nextBytes(buffer.get());\n      }\n      return buffer.get();\n    }\n\n    @Override // Mapper\n    public void configure(JobConf conf) {\n      super.configure(conf);\n      bufferSize = conf.getInt(\"test.io.file.buffer.size\", 4096);\n      buffer = ThreadLocal.withInitial(() -> new byte[bufferSize]);\n      try {\n        baseDir = conf.get(\"test.basedir\");\n        fs = new Path(baseDir).getFileSystem(conf);\n      } catch (IOException e) {\n        throw new RuntimeException(\"Cannot create file system.\", e);\n      }\n      randomBytes = conf.getBoolean(\"test.randomBytes\", false);\n\n      // grab compression\n      String compression = getConf().get(\"test.io.compression.class\", null);\n      Class<? extends CompressionCodec> codec;\n\n      // try to initialize codec\n      try {\n        codec = (compression == null) ? null :\n                Class.forName(compression).asSubclass(CompressionCodec.class);\n      } catch (Exception e) {\n        throw new RuntimeException(\"Compression codec not found: \", e);\n      }\n\n      if (codec != null) {\n        compressionCodec = (CompressionCodec)\n                ReflectionUtils.newInstance(codec, getConf());","sourceCodeStart":461,"sourceCodeEnd":497,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/sdk/java/src/main/java/io/juicefs/bench/TestDFSIO.java#L461-L497","documentation":"TestDFSIO.configure resolves the benchmark's FileSystem from test.basedir via new Path(baseDir).getFileSystem(conf) inside a try block; any IOException is rethrown as a RuntimeException \"Cannot create file system.\". This is the setup-time filesystem acquisition for the benchmark and failing it aborts before any I/O runs.","triggerScenarios":"Running TestDFSIO where test.basedir is unset (conf.get returns null, Path(\"null\") resolution fails) or its scheme has no FileSystem implementation, or the FS constructor throws IOException (e.g. missing plugin class wired via config).","commonSituations":"Running TestDFSIO against jfs:// without the JuiceFS Hadoop jar and fs.jfs.impl configured; launching from an environment where test.basedir was never set (forgotten -baseDir); HADOOP conf not propagated to the mapper tasks.","solutions":["Set a valid basedir, e.g. -baseDir jfs://myvol/TestDFSIO (populates test.basedir).","Ensure the filesystem plugin for the basedir scheme is on the classpath with its impl config keys set (fs.jfs.impl for JuiceFS).","Inspect the wrapped IOException cause for the true failure (missing class, bad URI, config parse) and fix it.","Verify with a local path (file:///tmp/testdfsio) to separate config issues from benchmark code."],"exampleFix":"// before\nTestDFSIO -write -size 1GB            // no basedir -> RuntimeException\n// after\nTestDFSIO -write -baseDir jfs://myvol/TestDFSIO -size 1GB","handlingStrategy":"validation","validationCode":"String baseDir = conf.get(\"test.basedir\");\nif (baseDir == null || baseDir.isEmpty()) throw new IllegalArgumentException(\"-baseDir is required for TestDFSIO\");\nnew Path(baseDir).getFileSystem(conf); // dry-run resolution\n","typeGuard":null,"tryCatchPattern":"try {\n  runTestDFSIO(args);\n} catch (RuntimeException e) {\n  if (\"Cannot create file system.\".equals(e.getMessage())) {\n    throw new IllegalArgumentException(\"check -baseDir and FS plugin (fs.jfs.impl)\", e.getCause());\n  }\n  throw e;\n}","preventionTips":["Always pass -baseDir with an explicit scheme when launching TestDFSIO.","Deploy the juicefs-hadoop jar and impl config keys cluster-wide before benchmarking.","Do a dry-run Path.getFileSystem resolution in a pre-flight check."],"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-14T00:17:10.932Z"}