{"record":{"id":"09c9f318db400a95","repo":"apache/hadoop","slug":"path-tostring","errorCode":null,"errorMessage":"path.toString()","messagePattern":"path\\.toString\\(\\)","errorType":"exception","errorClass":"PathIsNotEmptyDirectoryException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/DeleteOperation.java","lineNumber":222,"sourceCode":"    if (status.isDirectory()) {\n      LOG.debug(\"delete: Path is a directory: {}\", path);\n      checkArgument(\n          status.isEmptyDirectory() != Tristate.UNKNOWN,\n          \"File status must have directory emptiness computed\");\n\n      if (!key.endsWith(\"/\")) {\n        key = key + \"/\";\n      }\n\n      if (\"/\".equals(key)) {\n        LOG.error(\"S3A: Cannot delete the root directory.\"\n                + \" Path: {}. Recursive: {}\",\n            status.getPath(), recursive);\n        return false;\n      }\n\n      if (!recursive && status.isEmptyDirectory() == Tristate.FALSE) {\n        throw new PathIsNotEmptyDirectoryException(path.toString());\n      }\n      if (status.isEmptyDirectory() == Tristate.TRUE) {\n        LOG.debug(\"deleting empty directory {}\", path);\n        deleteObjectAtPath(path, key, false);\n      } else {\n        deleteDirectoryTree(path, key);\n      }\n\n    } else {\n      // simple file.\n      LOG.debug(\"deleting simple file {}\", path);\n      deleteObjectAtPath(path, key, true);\n    }\n    LOG.debug(\"Deleted {} objects\", filesDeleted);\n    return true;\n  }\n\n  /**","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/DeleteOperation.java#L204-L240","documentation":"Error \"path.toString()\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/DeleteOperation.java:222 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["This is an internal path-handling error; verify the path being deleted is valid and retry."],"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"}