{"record":{"id":"660c12542bf219ba","repo":"apache/hadoop","slug":"file-creation-failed-for","errorCode":null,"errorMessage":"File creation failed for {}","messagePattern":"File creation failed for (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/PseudoLocalFs.java","lineNumber":106,"sourceCode":"   * @param fileSize file size\n   * @return the generated relative path\n   */\n  static Path generateFilePath(String fileId, long fileSize) {\n    return new Path(fileId + \".\" + fileSize);\n  }\n\n  /**\n   * Creating a pseudo local file is nothing but validating the file path.\n   * Actual data of the file is generated on the fly when client tries to open\n   * the file for reading.\n   * @param path file path to be created\n   */\n  @Override\n  public FSDataOutputStream create(Path path) throws IOException {\n    try {\n      validateFileNameFormat(path);\n    } catch (FileNotFoundException e) {\n      throw new IOException(\"File creation failed for \" + path);\n    }\n    return null;\n  }\n\n  /**\n   * Validate if the path provided is of expected format of Pseudo Local File\n   * System based files.\n   * @param path file path\n   * @return the file size\n   * @throws FileNotFoundException\n   */\n  long validateFileNameFormat(Path path) throws FileNotFoundException {\n    path = this.makeQualified(path);\n    boolean valid = true;\n    long fileSize = 0;\n    if (!path.toUri().getScheme().equals(getUri().getScheme())) {\n      valid = false;\n    } else {","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/PseudoLocalFs.java#L88-L124","documentation":"Error \"File creation failed for {}\" thrown in apache/hadoop.","triggerScenarios":"PseudoLocalFs cannot create the backing file for the requested path, typically because the file already exists or the underlying local filesystem rejects the creation.","commonSituations":"See trigger scenarios.","solutions":["Create the file through PseudoLocalFs.create first; the pseudo filesystem cannot create the requested path."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}