{"record":{"id":"9bdb686b3c60f4cb","repo":"apache/hadoop","slug":"must-be-exactly-one-fsimage-file-present-in-fs-ima","errorCode":null,"errorMessage":"Must be exactly one fsimage file present in fs_image_dir","messagePattern":"Must be exactly one fsimage file present in fs_image_dir","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-dynamometer/hadoop-dynamometer-infra/src/main/java/org/apache/hadoop/tools/dynamometer/Client.java","lineNumber":427,"sourceCode":"        Joiner.on(\"\\\" \\\"\").join(args));\n\n    Path fsImageDir = new Path(commandLine.getOptionValue(FS_IMAGE_DIR_ARG,\n        \"\"));\n    versionFilePath = new Path(fsImageDir, \"VERSION\").toString();\n    if (commandLine.hasOption(NAMENODE_SERVICERPC_ADDR_ARG)) {\n      launchNameNode = false;\n      remoteNameNodeRpcAddress =\n          commandLine.getOptionValue(NAMENODE_SERVICERPC_ADDR_ARG);\n    } else {\n      launchNameNode = true;\n      FileSystem localFS = FileSystem.getLocal(getConf());\n      fsImageDir = fsImageDir.makeQualified(localFS.getUri(),\n          localFS.getWorkingDirectory());\n      FileSystem fsImageFS = fsImageDir.getFileSystem(getConf());\n      FileStatus[] fsImageFiles = fsImageFS.listStatus(fsImageDir,\n          (path) -> path.getName().matches(\"^fsimage_(\\\\d)+$\"));\n      if (fsImageFiles.length != 1) {\n        throw new IllegalArgumentException(\n            \"Must be exactly one fsimage file present in fs_image_dir\");\n      }\n      fsImagePath = fsImageFiles[0].getPath().toString();\n      fsImageMD5Path = fsImageFiles[0].getPath().suffix(\".md5\").toString();\n    }\n\n    if (amMemory < 0) {\n      throw new IllegalArgumentException(\"Invalid memory specified for \"\n          + \"application master, exiting. Specified memory=\" + amMemory);\n    }\n    if (amVCores < 0) {\n      throw new IllegalArgumentException(\"Invalid virtual cores specified for \"\n          + \"application master, exiting. Specified virtual cores=\" + amVCores);\n    }\n\n    this.appName = commandLine.getOptionValue(APPNAME_ARG, APPNAME_DEFAULT);\n    this.amQueue = commandLine.getOptionValue(QUEUE_ARG, QUEUE_DEFAULT);\n    this.amMemory = Integer.parseInt(commandLine","sourceCodeStart":409,"sourceCodeEnd":445,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-dynamometer/hadoop-dynamometer-infra/src/main/java/org/apache/hadoop/tools/dynamometer/Client.java#L409-L445","documentation":"Error \"Must be exactly one fsimage file present in fs_image_dir\" thrown in apache/hadoop.","triggerScenarios":"The fs_image_dir supplied to the dynamometer Client contains zero or more than one fsimage file, so the Client cannot determine which image to distribute to the simulated NameNode.","commonSituations":"See trigger scenarios.","solutions":["Point fs_image_dir at a directory containing exactly one fsimage file; remove extra files or copy the fsimage into an empty directory."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}