apache/hadoop · error · IllegalArgumentException
If resource is on remote, must be a single file: {}
Error message
If resource is on remote, must be a single file: {} What it means
Error "If resource is on remote, must be a single file: {}" thrown in apache/hadoop.
Source
Thrown at hadoop-tools/hadoop-dynamometer/hadoop-dynamometer-infra/src/main/java/org/apache/hadoop/tools/dynamometer/Client.java:821
filesToZip = Lists.newArrayList(childFiles);
} else {
filesToZip = srcFiles;
}
ZipOutputStream zout = new ZipOutputStream(outputStream);
for (File fileToZip : filesToZip) {
addFileToZipRecursively(fileToZip.getParentFile(), fileToZip, zout);
}
zout.close();
} else {
try (InputStream inputStream = new FileInputStream(srcFiles.get(0))) {
IOUtils.copyBytes(inputStream, outputStream, getConf());
}
}
}
remoteFileStatus = remoteFS.getFileStatus(dstPath);
} else {
if (srcPaths.length > 1) {
throw new IllegalArgumentException("If resource is on remote, must be "
+ "a single file: " + srcPathString);
}
LOG.info("Using resource {} directly from current location: {}",
resource, srcPaths[0]);
dstPath = new Path(srcPaths[0]);
// non-local file system; we can just use it directly from where it is
remoteFileStatus = FileSystem.get(dstPath.toUri(), getConf())
.getFileStatus(dstPath);
if (remoteFileStatus.isDirectory()) {
throw new IllegalArgumentException("If resource is on remote "
+ "filesystem, must be a file: " + srcPaths[0]);
}
}
env.put(resource.getLocationEnvVar(), dstPath.toString());
env.put(resource.getTimestampEnvVar(),
String.valueOf(remoteFileStatus.getModificationTime()));
env.put(resource.getLengthEnvVar(),
String.valueOf(remoteFileStatus.getLen()));View on GitHub (pinned to 2add963021)
Solutions
- Reference exactly one remote file for the resource; glob or multiple remote paths are not accepted.
When it happens
Trigger: A dynamometer resource resolved to multiple files on a remote filesystem; remote resources must resolve to exactly one file before they can be staged.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/da58b76d0c1568e6.
Report an issue: GitHub.