-
Notifications
You must be signed in to change notification settings - Fork 16
S3 DeleteObjects API returns MalformedXML...
error when trying to delete >1000 objects
#602
Comments
Hi @sdarwin thanks for reaching out. Here is the The 1000 limit you referenced is mentioned there:
I could reproduce the import json
data = {
"Objects": [
{
"Key":f"Key_{i}",
} for i in range(1, 1002)
],
"Quiet": True
}
with open('data.json', 'w') as outfile:
json.dump(data, outfile, indent=4)
(The I also think that the error message could be improved. That error message is returned by the S3 DeleteObjects API, so we'll need to reach out to the S3 team to request a better error message. I'll go ahead and transfer this to our cross-SDK repository for further tracking as service APIs like this are used across SDKs. I'll also note a few related issues I found: |
MalformedXML...
error when trying to delete >1000 objects
P99874682 |
Just retesting now. Ok, there is a different reason for the SSL error. It isn't the 1000 item limit, which I had thought.
That is caused by not specifying the region. Notice how https://s3.amazonaws.com/ seems to be a generic endpoint, without mentioning a region. If I add Well, that is another one to consider then? The user does not see a message such as "You should set the region." Simply a unknown SSL error. |
The SSL validation error doesn't seem directly related to S3. A few other issues have reported that error and it could be caused by various things. If you add |
This is a going off track now. :-) I will post the info, just to be complete, anyway. Collecting a list of items, that will later be deleted:
Because that is over 1000, it causes an error. In this case, (MalformedXML) What if the number of items is larger, 10,000 instead?
Now, it seems that a combination of all these factors:
Gets this error:
It can be resolved by reducing the number of items or adding the --region. Either one. That at least gets back to "MalformedXML". |
Thanks for your patience. I don't have any updates as of now, but the S3 team is continuing to track the request to improve the error message in their backlog for consideration. We're going to close this on our end as the service team would need to take the next steps here. Please refer to the CHANGELOG for updates, or feel free to reach out through support if you have a support plan. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the feature
Improve the accuracy of the error messages during certain failures.
Use Case
Clear error messages assist in debugging.
Here is the problem I encountered. When running this command to delete objects in S3:
It supposedly has a limit of 1000 items. If you provide a million items to delete, the error messages are mysterious:
or
As evidence for MalformedXML error, consider this stackexchange article
"+1 for number of keys. I did not check the go code but for us in python boto3 over 1000 keys in the request caused the error. You would think they would document this is the documentation for MalformedXML on the sdk client, but you did find api documentation. We chunked the keys and it works perfect – vfrank66"
Proposed Solution
The problem is that neither message explains the actual cause of the problem, which is the input is over 1000 items in length. The errors should be more specific about the real reason.
Other Information
No response
Acknowledgements
CLI version used
aws-cli/2.13.17 Python/3.11.5 Linux/6.2.0-1013-gcp exe/x86_64.ubuntu.22 prompt/off
Environment details (OS name and version, etc.)
Ubuntu 22.04
The text was updated successfully, but these errors were encountered: