{"record":{"id":"843aa5ac5cd7160c","repo":"apache/hadoop","slug":"cannot-create-file-parentpath-because-parent-fol","errorCode":null,"errorMessage":"Cannot create file {parentPath} because parent folder does not exist.","messagePattern":"Cannot create file (.+?) because parent folder does not exist\\.","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsDfsClient.java","lineNumber":489,"sourceCode":"            throw new AbfsDriverException(ERR_CREATE_RECOVERY, exception);\n          }\n        }\n      }\n      throw ex;\n    }\n    return op;\n  }\n\n  /** {@inheritDoc} */\n  public void createNonRecursivePreCheck(Path parentPath,\n      TracingContext tracingContext)\n      throws IOException {\n    try {\n      getPathStatus(parentPath.toUri().getPath(), false,\n          tracingContext, null);\n    } catch (AbfsRestOperationException ex) {\n      if (ex.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) {\n        throw new FileNotFoundException(\"Cannot create file \"\n            + parentPath.toUri().getPath()\n            + \" because parent folder does not exist.\");\n      }\n      throw ex;\n    } finally {\n      getAbfsCounters().incrementCounter(CALL_GET_FILE_STATUS, 1);\n    }\n  }\n\n  /**\n   * Conditionally creates or overwrites a file at the specified relative path.\n   * This method ensures that the file is created or overwritten based on the provided parameters.\n   *\n   * @param relativePath The relative path of the file to be created or overwritten.\n   * @param statistics The file system statistics to be updated.\n   * @param permissions The permissions to be set on the file.\n   * @param isAppendBlob Specifies if the file is an append blob.\n   * @param contextEncryptionAdapter The encryption context adapter for handling encryption.","sourceCodeStart":471,"sourceCodeEnd":507,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsDfsClient.java#L471-L507","documentation":"Error \"Cannot create file {parentPath} because parent folder does not exist.\" thrown in apache/hadoop.","triggerScenarios":"A create() call targets a path whose parent directory does not exist on the DFS endpoint.","commonSituations":"See trigger scenarios.","solutions":["Create the parent directory first, or enable fs.azure.create.remote.filestore.directory.during.init as appropriate.","Verify the parent path spelling and that it exists in the container."],"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-22T20:17:22.307Z"}