apache/hadoop · error · IllegalArgumentException
If resource is on remote filesystem, must be a file: {}
Error message
If resource is on remote filesystem, must be a file: {} What it means
Error "If resource is on remote filesystem, must be a 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:831
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()));
}
/**
* Get the directory on the default FS which will be used for storing files
* relevant to this Dynamometer application. This is inside of the
* {@value DynoConstants#DYNAMOMETER_STORAGE_DIR} directory within the
* submitter's home directory.
*
* @param conf Configuration for this application.
* @param appId This application's ID.View on GitHub (pinned to 2add963021)
Solutions
- Point the resource at a regular file on the remote filesystem, not a directory.
When it happens
Trigger: A dynamometer resource path on a remote filesystem points to a directory rather than a file; only a single remote file can be localized.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/8d9205acf5fb1473.
Report an issue: GitHub.