{"record":{"id":"da58b76d0c1568e6","repo":"apache/hadoop","slug":"if-resource-is-on-remote-must-be-a-single-file","errorCode":null,"errorMessage":"If resource is on remote, must be a single file: {}","messagePattern":"If resource is on remote, must be a single 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":821,"sourceCode":"            filesToZip = Lists.newArrayList(childFiles);\n          } else {\n            filesToZip = srcFiles;\n          }\n          ZipOutputStream zout = new ZipOutputStream(outputStream);\n          for (File fileToZip : filesToZip) {\n            addFileToZipRecursively(fileToZip.getParentFile(), fileToZip, zout);\n          }\n          zout.close();\n        } else {\n          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()));","sourceCodeStart":803,"sourceCodeEnd":839,"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#L803-L839","documentation":"Error \"If resource is on remote, must be a single file: {}\" thrown in apache/hadoop.","triggerScenarios":"A dynamometer resource resolved to multiple files on a remote filesystem; remote resources must resolve to exactly one file before they can be staged.","commonSituations":"See trigger scenarios.","solutions":["Reference exactly one remote file for the resource; glob or multiple remote paths are not accepted."],"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-23T01:17:44.959Z"}