{"record":{"id":"a80f16e68ee3fa6e","repo":"apache/hadoop","slug":"failed-to-delete-aliyun-oss-objects-for-tries-ti","errorCode":null,"errorMessage":"Failed to delete Aliyun OSS objects for {tries} times.","messagePattern":"Failed to delete Aliyun OSS objects for (.+?) times\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSFileSystemStore.java","lineNumber":245,"sourceCode":"      // 1. verbose mode: A list of all deleted objects is returned.\n      // 2. quiet mode: No message body is returned.\n      // Here, we choose the verbose mode to do batch delete.\n      deleteRequest.setQuiet(false);\n      DeleteObjectsResult result = ossClient.deleteObjects(deleteRequest);\n      statistics.incrementWriteOps(1);\n      final List<String> deletedObjects = result.getDeletedObjects();\n      keysToDelete = keysToDelete.stream().filter(item -> !deletedObjects.contains(item))\n          .collect(Collectors.toList());\n      tries++;\n      if (tries == retry) {\n        break;\n      }\n    }\n\n    if (tries == retry && CollectionUtils.isNotEmpty(keysToDelete)) {\n      // Most of time, it is impossible to try 10 times, expect the\n      // Aliyun OSS service problems.\n      throw new IOException(\"Failed to delete Aliyun OSS objects for \" + tries + \" times.\");\n    }\n  }\n\n  /**\n   * Delete a directory from Aliyun OSS.\n   *\n   * @param key directory key to delete.\n   * @throws IOException if failed to delete directory.\n   */\n  public void deleteDirs(String key) throws IOException {\n    OSSListRequest listRequest = createListObjectsRequest(key,\n        maxKeys, null, null, true);\n    while (true) {\n      OSSListResult objects = listObjects(listRequest);\n      statistics.incrementReadOps(1);\n      List<String> keysToDelete = new ArrayList<String>();\n      for (OSSObjectSummary objectSummary : objects.getObjectSummaries()) {\n        keysToDelete.add(objectSummary.getKey());","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSFileSystemStore.java#L227-L263","documentation":"Error \"Failed to delete Aliyun OSS objects for {tries} times.\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSFileSystemStore.java:245 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check OSS permissions: the configured credentials must have DeleteObject on the target objects.","Verify network connectivity to the OSS endpoint and retry; inspect the logged cause for the underlying SDK error."],"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"}