apache/hadoop · error · UnsupportedOperationException
File deletion is not supported in pseudo local file system.
Error message
File deletion is not supported in pseudo local file system.
What it means
PseudoLocalFs.delete() unconditionally throws UnsupportedOperationException. Since pseudo-local files are never materialized on disk (data is synthesized from the file name on each open), there is nothing to delete. Note the method signature does not even declare IOException — the UnsupportedOperationException is unchecked.
Source
Thrown at hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/PseudoLocalFs.java:323
throw new UnsupportedOperationException("Append is not supported"
+ " in pseudo local file system.");
}
@Override
public boolean mkdirs(Path f, FsPermission permission) throws IOException {
throw new UnsupportedOperationException("Mkdirs is not supported"
+ " in pseudo local file system.");
}
@Override
public boolean rename(Path src, Path dst) throws IOException {
throw new UnsupportedOperationException("Rename is not supported"
+ " in pseudo local file system.");
}
@Override
public boolean delete(Path path, boolean recursive) {
throw new UnsupportedOperationException("File deletion is not supported "
+ "in pseudo local file system.");
}
@Override
public void setWorkingDirectory(Path newDir) {
throw new UnsupportedOperationException("SetWorkingDirectory "
+ "is not supported in pseudo local file system.");
}
@Override
public Path makeQualified(Path path) {
// skip FileSystem#checkPath() to validate some other Filesystems
return path.makeQualified(this.getUri(), this.getWorkingDirectory());
}
}
View on GitHub (pinned to 2add963021)
Solutions
- Exclude pseudo:/// paths from cleanup/teardown logic (skip when scheme is 'pseudo')
- Let unused pseudo-local files simply be forgotten — they consume no storage
- If cleanup must succeed, catch UnsupportedOperationException (unchecked) around delete for pseudo files, or route deletion to a real FileSystem only for real paths
Defensive patterns
Strategy: try-catch
Validate before calling
// Skip deletion for virtual file systems
static void safeDelete(FileSystem fs, Path p) throws IOException {
if ("pseudo".equals(fs.getUri().getScheme())) {
return; // pseudo-local files are generated on read; nothing to delete
}
fs.delete(p, true);
} Try / catch
try {
fs.delete(path, true);
} catch (UnsupportedOperationException e) {
// unchecked; pseudo-local files need no cleanup
} Prevention
- Exclude pseudo:// from cleanup loops by scheme
- Remember pseudo-local files consume no storage — skipping delete is safe
When it happens
Trigger: Calling FileSystem.delete(Path, boolean) on PseudoLocalFs; job-cleanup and task-abort paths that delete temporary/output directories; DistributedCache cleanup hooks run against pseudo-local distributed-cache files.
Common situations: Gridmix's DistributedCacheEmulator creates pseudo-local files; if a job or cleanup task later tries to delete them, this throws. Also common when generic test teardown or workspace-cleanup code deletes everything under a root that includes pseudo:// URIs.
Related errors
- Append is not supported in pseudo local file system.
- Mkdirs is not supported in pseudo local file system.
- Rename is not supported in pseudo local file system.
- SetWorkingDirectory is not supported in pseudo local file sy
- File {} does not exist in pseudo local file system
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/acb12e17ae51409d.
Report an issue: GitHub.