{"record":{"id":"9110eac80728b5cd","repo":"apache/hadoop","slug":"can-t-make-directory-for-path-s-since-it-is-a-f-9110ea","errorCode":null,"errorMessage":"Can't make directory for path '%s' since it is a file.","messagePattern":"Can't make directory for path '(.+?)' since it is a file\\.","errorType":"exception","errorClass":"FileAlreadyExistsException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/MkdirOperation.java","lineNumber":192,"sourceCode":"  private void verifyFileStatusOfClosestAncestor() throws IOException {\n    FileStatus fileStatus;\n    // Walk path to root, ensuring the closest ancestor is a directory, not file\n    Path fPart = dir.getParent();\n    try {\n      while (fPart != null && !fPart.isRoot()) {\n        fileStatus = getPathStatusExpectingDir(fPart);\n        if (fileStatus == null) {\n          // nothing at this path, so validate the parent\n          fPart = fPart.getParent();\n          continue;\n        }\n        if (fileStatus.isDirectory()) {\n          // the parent dir exists. All is good.\n          break;\n        }\n\n        // there's a file at the parent entry\n        throw new FileAlreadyExistsException(\n            String.format(\n                \"Can't make directory for path '%s' since it is a file.\",\n                fPart));\n      }\n    } catch (AccessDeniedException e) {\n      LOG.info(\"mkdirs({}}: Access denied when looking\"\n              + \" for parent directory {}; skipping checks\",\n          dir,\n          fPart);\n      LOG.debug(\"{}\", e, e);\n    }\n  }\n\n  /**\n   * Get the status of a path, downgrading FNFE to null result.\n   * @param path path to probe.\n   * @param probes probes to exec\n   * @return the status or null","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/MkdirOperation.java#L174-L210","documentation":"Error \"Can't make directory for path '%s' since it is a file.\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/MkdirOperation.java:192 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove or rename the conflicting file at the path, then create the directory."],"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"}