apache/hadoop · error · UnsupportedOperationException

Append is not supported in pseudo local file system.

Error message

Append is not supported in pseudo local file system.

What it means

PseudoLocalFs.append() unconditionally throws UnsupportedOperationException because the file system stores nothing: file content is generated on the fly from the file name each time it is opened, so there is no persisted data to append to. Only create(Path) (a validation no-op returning null), open(), and metadata queries are supported. Any append semantics are impossible by design.

Source

Thrown at hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/PseudoLocalFs.java:305

    public long getPos() throws IOException {
      return curPos;
    }

    @Override
    public void seek(long pos) throws IOException {
      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 "

View on GitHub (pinned to 2add963021)

Solutions

  1. Do not append to pseudo-local files; write new files with the desired size encoded in the name via PseudoLocalFs.generateFilePath(name, newSize)
  2. Point append operations at a real FileSystem (local fs or HDFS) that persists content
  3. If a generic code path calls append, guard it by checking fs.getUri().getScheme().equals("pseudo") and skip or substitute a real file system
Defensive patterns

Strategy: try-catch

Validate before calling

boolean supportsAppend(FileSystem fs) {
  return !"pseudo".equals(fs.getUri().getScheme());
}

Try / catch

try {
  fs.append(path, bufferSize, progress);
} catch (UnsupportedOperationException e) {
  // PseudoLocalFs is generate-on-read only; switch to a real FileSystem for append
}

Prevention

When it happens

Trigger: Calling FileSystem.append(Path) or append(Path, int, Progressable) on a PseudoLocalFs instance; frameworks that recover or extend output files (e.g. output-format recovery paths, FSDataOutputStream.append wrappers) invoked against pseudo:/// paths.

Common situations: Using pseudo:// URIs as output locations in gridmix jobs or custom tools; routing a generic file-copy/append utility at the pseudo local file system; writing test harnesses that assume every FileSystem implementation supports append.

Related errors


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/66e9a4688766654a. Report an issue: GitHub.