apache/hadoop · error · UnsupportedOperationException
Mkdirs is not supported in pseudo local file system.
Error message
Mkdirs is not supported in pseudo local file system.
What it means
PseudoLocalFs.mkdirs() unconditionally throws UnsupportedOperationException. The pseudo local file system has no directory hierarchy: only the root '/' exists and all files live directly under it, so directory creation is meaningless. File 'creation' is just name-format validation; content appears only when a reader opens the file.
Source
Thrown at hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/PseudoLocalFs.java:311
throw new UnsupportedOperationException();
}
@Override
public boolean seekToNewSource(long targetPos) throws IOException {
throw new UnsupportedOperationException();
}
}
@Override
public FSDataOutputStream append(Path path, int bufferSize,
Progressable progress) throws IOException {
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 "View on GitHub (pinned to 2add963021)
Solutions
- Remove pseudo:/// paths from any code path that creates directories; the pseudo FS only serves generated input files
- Use a real FileSystem (file:// or hdfs://) for outputs and directory structures
- Guard with a scheme check (fs.getUri().getScheme()) and skip mkdirs for 'pseudo'
Defensive patterns
Strategy: try-catch
Validate before calling
if ("pseudo".equals(fs.getUri().getScheme())) {
// PseudoLocalFs: only root '/' exists; skip directory creation
} Try / catch
try {
fs.mkdirs(dir, perm);
} catch (UnsupportedOperationException e) {
// pseudo-local FS has no directories; ignore only if dir is pseudo:///
} Prevention
- Route outputs and directory-creating tools (distcp -p, committers) to real file systems
- Treat PseudoLocalFs as a read-only generated-input source only
When it happens
Trigger: Calling FileSystem.mkdirs(Path) or mkdirs(Path, FsPermission) on PseudoLocalFs; utilities that pre-create parent directories before writing files (distcp with -p, FileContext.mkdir, most output committers) when given pseudo:/// destinations.
Common situations: Using pseudo:// paths as map/reduce output directories in gridmix jobs; feeding pseudo-local paths into copy tools that replicate source directory structure; generic code that calls mkdirs for every parent in a path.
Related errors
- Append is not supported in pseudo local file system.
- Rename is not supported in pseudo local file system.
- File deletion 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/58bdbe2a5f408d0d.
Report an issue: GitHub.