{"record":{"id":"808b99f50fa32761","repo":"apache/hadoop","slug":"directorynotempty","errorCode":"DirectoryNotEmpty","errorMessage":"The recursive query parameter value must be true to delete a non-empty directory","messagePattern":"The recursive query parameter value must be true to delete a non-empty directory","errorType":"http","errorClass":"AbfsRestOperationException","httpStatus":409,"severity":"error","filePath":"hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/BlobDeleteHandler.java","lineNumber":111,"sourceCode":"    deleteCount.incrementAndGet();\n    return true;\n  }\n\n  /**\n   * Orchestrate the delete operation.\n   *\n   * @return true if the delete operation is successful.\n   * @throws AzureBlobFileSystemException if deletion fails due to server error or path doesn't exist.\n   */\n  public boolean execute() throws AzureBlobFileSystemException {\n    /*\n     * ABFS is not aware if it's a file or directory. So, we need to list the\n     * path and delete the listed objects. The listing returns the children of\n     * the path and not the path itself.\n     */\n    listRecursiveAndTakeAction();\n    if (nonRecursiveDeleteDirectoryFailed) {\n      throw new AbfsRestOperationException(HTTP_CONFLICT,\n          NON_EMPTY_DIRECTORY_DELETE.getErrorCode(),\n          NON_EMPTY_DIRECTORY_DELETE.getErrorMessage(),\n          new PathIOException(path.toString(),\n              \"Non-recursive delete of non-empty directory\"));\n    }\n    tracingContext.setOperatedBlobCount(deleteCount.get() + 1);\n    /*\n     * If path is actually deleted.\n     */\n    boolean deleted;\n    try {\n      /*\n       * Delete the required path.\n       * Directory should be safely deleted as the path might be implicit.\n       */\n      deleted = recursive ? safeDelete(path) : deleteInternal(path);\n    } finally {\n      tracingContext.setOperatedBlobCount(0);","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/BlobDeleteHandler.java#L93-L129","documentation":"Error \"The recursive query parameter value must be true to delete a non-empty directory\" thrown in apache/hadoop.","triggerScenarios":"A non-recursive delete targets a non-empty directory on the Blob endpoint.","commonSituations":"See trigger scenarios.","solutions":["Call delete(path, true) with recursive=true for non-empty directories.","Empty the directory first if a non-recursive delete is intended."],"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"}