-
Notifications
You must be signed in to change notification settings - Fork 603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MalformedXML error trying to deleteObjects from S3 #6857
Comments
I can reproduce this issue with For ETag issue - If you use const input = {
Bucket: "test-s3-explorer-maggie",
Delete: {
Objects: [
{
ETags: "xxxxx",
Key: "example.txt",
// Size: 956.0
},
],
Quiet: false
}
}; I also added client.middlewareStack.add(
(next, context) => async (args) => {
// Safely access command name
const commandName = args.command?.constructor?.name || 'Unknown';
console.log('Request's Delete object::', {
input: args.input.Delete.Objects,
command: commandName
});
const response = await next(args);
console.log('Response:', {
metadata: response.response.body,
});
return response;
},
{
step: 'build'
}
); And it will display the request and response after running the code -
I will talk about it with the team to see if it's the |
Thanks @zshzbh I just double-checked one of our buckets and this is what is returned from a list API call:
So the API seems to be using From looking at the type definitions, it looks like the ObjectIdentifier. used to be just a Key and a VersionId. Starting sometime around the time it broke for us, it's now:
|
Thanks. That makes sense as well. I missed that facet of the docs. We had just been blindly passing in the response to a list call directly to the delete call. This used to work in the past because it looks like delete only cared about Key and VersionId. Now that it potentially uses ETag, LastModifiedTime, and Size as well, it's definitely correct behavior for us to make sure we only pass in Key and VersionId. So I think most of this issue is probably more user error now. Though maybe the ETag part of it might still be legit? |
Hey @spdaley , I tried to use cli for this action and saw the same error, it seems the error comes from the service team.
In Version V3.698, we introduced ETag I will check with the team and cut a ticket to the service team and keep you updated! |
Checkboxes for prior research
Describe the bug
I'm executing a node.js script to delete some files from an S3 bucket and I'm getting the following error:
MalformedXML: The XML you provided was not well-formed or did not validate against our published schema
This can be observed with the latest @aws-sdk/client-s3 and seems to have started with v3.698.0 (at least my sample script passes before that version).
Regression Issue
SDK version number
@aws-sdk/[email protected]
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v20.17.0
Reproduction Steps
If you comment out Size, it will work. If you enable either ETag or Size it will fail.
Observed Behavior
Expected Behavior
The script should not blow up with a MalformedXML error.
Possible Solution
No response
Additional Information/Context
In the sample program I provided, if you comment out Size, it will work. If you enable either ETag or Size it will fail.
The text was updated successfully, but these errors were encountered: