{"record":{"id":"8d9205acf5fb1473","repo":"apache/hadoop","slug":"if-resource-is-on-remote-filesystem-must-be-a-fil","errorCode":null,"errorMessage":"If resource is on remote filesystem, must be a file: {}","messagePattern":"If resource is on remote filesystem, must be a file: (.+?)","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":831,"sourceCode":"          try (InputStream inputStream = new FileInputStream(srcFiles.get(0))) {\n            IOUtils.copyBytes(inputStream, outputStream, getConf());\n          }\n        }\n      }\n      remoteFileStatus = remoteFS.getFileStatus(dstPath);\n    } else {\n      if (srcPaths.length > 1) {\n        throw new IllegalArgumentException(\"If resource is on remote, must be \"\n            + \"a single file: \" + srcPathString);\n      }\n      LOG.info(\"Using resource {} directly from current location: {}\",\n          resource, srcPaths[0]);\n      dstPath = new Path(srcPaths[0]);\n      // non-local file system; we can just use it directly from where it is\n      remoteFileStatus = FileSystem.get(dstPath.toUri(), getConf())\n          .getFileStatus(dstPath);\n      if (remoteFileStatus.isDirectory()) {\n        throw new IllegalArgumentException(\"If resource is on remote \"\n            + \"filesystem, must be a file: \" + srcPaths[0]);\n      }\n    }\n    env.put(resource.getLocationEnvVar(), dstPath.toString());\n    env.put(resource.getTimestampEnvVar(),\n        String.valueOf(remoteFileStatus.getModificationTime()));\n    env.put(resource.getLengthEnvVar(),\n        String.valueOf(remoteFileStatus.getLen()));\n  }\n\n  /**\n   * Get the directory on the default FS which will be used for storing files\n   * relevant to this Dynamometer application. This is inside of the\n   * {@value DynoConstants#DYNAMOMETER_STORAGE_DIR} directory within the\n   * submitter's home directory.\n   *\n   * @param conf Configuration for this application.\n   * @param appId This application's ID.","sourceCodeStart":813,"sourceCodeEnd":849,"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#L813-L849","documentation":"Error \"If resource is on remote filesystem, must be a file: {}\" thrown in apache/hadoop.","triggerScenarios":"A dynamometer resource path on a remote filesystem points to a directory rather than a file; only a single remote file can be localized.","commonSituations":"See trigger scenarios.","solutions":["Point the resource at a regular file on the remote filesystem, not a 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"}