apache/hadoop · error · IOException

File creation failed for

Error message

File creation failed for {}

What it means

Gridmix pseudo-local filesystem guard: creating the pseudo file failed because the file name did not pass validation (unparseable fileId/size format); the FileNotFoundException from validation is re-wrapped as IOException.

Solutions

  1. Create the file through PseudoLocalFs.create first; the pseudo filesystem cannot create the requested path.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: PseudoLocalFs cannot create the backing file for the requested path, typically because the file already exists or the underlying local filesystem rejects the creation.

Common situations: See trigger scenarios.


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

Appendix: source

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

   * @param fileSize file size
   * @return the generated relative path
   */
  static Path generateFilePath(String fileId, long fileSize) {
    return new Path(fileId + "." + fileSize);
  }

  /**
   * Creating a pseudo local file is nothing but validating the file path.
   * Actual data of the file is generated on the fly when client tries to open
   * the file for reading.
   * @param path file path to be created
   */
  @Override
  public FSDataOutputStream create(Path path) throws IOException {
    try {
      validateFileNameFormat(path);
    } catch (FileNotFoundException e) {
      throw new IOException("File creation failed for " + path);
    }
    return null;
  }

  /**
   * Validate if the path provided is of expected format of Pseudo Local File
   * System based files.
   * @param path file path
   * @return the file size
   * @throws FileNotFoundException
   */
  long validateFileNameFormat(Path path) throws FileNotFoundException {
    path = this.makeQualified(path);
    boolean valid = true;
    long fileSize = 0;
    if (!path.toUri().getScheme().equals(getUri().getScheme())) {
      valid = false;
    } else {

View on GitHub (pinned to 2add963021)