-
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
Invalid command "CompletedMultipartUpload" (should be CompleteMultipartUpload) #1814
Comments
HI @nurdism The functions in |
because it produces invalid XML and other S3 compatible services (like DigitalOcean spaces) can throw an error (MalformedXML) the correct xml should be: <CompleteMultipartUpload>
<Part>
<PartNumber>1</PartNumber>
<ETag>"..."</ETag>
</Part>
</CompleteMultipartUpload> but <CompletedMultipartUpload>
<Part>
<PartNumber>1</PartNumber>
<ETag>"..."</ETag>
</Part>
</CompletedMultipartUpload> essentially, changing this might be a bug in the codegen? (just speculaiting) as its correctly named here |
@AllanZhengYP This is an issue with how payload shapes use |
Here's a hacky workaround I've used to get client.middlewareStack.add(
(next, _context) => (args: any) => {
if (
args.request &&
args.request.body &&
args.request.body.includes('CompletedMultipartUpload')
) {
args.request.body = args.request.body.replace(
/CompletedMultipartUpload/g,
'CompleteMultipartUpload'
)
}
return next(args)
},
{
step: 'build',
}
) |
I tried @tomjrees solution but for some reason it would cause the upload promise to not resolve, so I ended up just creating a patch for this to be used with |
I tried @tomjrees solution as well and got the same result as @nurdism. So two questions to the AWS folks:
|
See issue aws#1814 , I just did a search and replace so everything is consistent: $ find . -exec sed s/CompletedMultipartUpload/CompleteMultipartUpload/g {} \;
I have the same issue that seems a showstopper for us. Any hint to implement workaround or use prerelease package would be highly appreciated. |
@nurdism has the fix, by patching the package to fix AWS' bug using |
@thenickdude Patching on deployed systems before they start up is not a solution... Sorry. I like @tomjrees solution as I can apply that in my code to workaround the issue. Unfortunately though I couldn't get it to work. That said, there is a fix in the system if the AWS devs accept it: #2434 |
@thenickdude I've used @tomjrees's middleware as a temporary workaround but got the same failed to resolve promise. It started working for me when I've added {
step: 'build',
priority: 'high',
} |
Wow, luckily found this thread and @tomjrees solution "works" (for me) in the sense that the FWIW, I tried uploading directly to S3 without adding |
I've just run into the same issue, and tried SDK v2, which gave me meaningful error messages. And I figured out the reason why it didn't work. The issue turned out to be mis-configuration of CORS settings. I specified I want SDK v3 to give more verbose error messages in this case, because I guess it's a common mistake anyone would make. |
Hi, the mentioned PR doesn't fix the problem because it roots in the service model. Go SDK also has the same issue and fixed: aws/aws-sdk-go-v2#965. I will create a fix soon referring to their PR. |
I find we cannot port the fix from Go v2 SDK directly. There's a design flaw that our shape serializers don't have reference to the parent XML node. I cannot fix it without a refactor to our serializer generation. For this particular issue, the request's root node name is
However, in this case(when shape is document payload), we should have used the operation's member's xml name as name of the root node: aws-sdk-js-v3/codegen/sdk-codegen/aws-models/s3.2006-03-01.json Lines 1251 to 1258 in afeccd7
When generating the seriliazer for the shape |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Not sure if I am just out of the loop or the documentation is wrong or what is up, but I am running into
MalformedXML
when using DigitalOcean spaces (which is supposed to be s3 compatible), in my debugging I noticed CompletedMultipartUpload doesn't have thed
inCompleted
in the s3 documentation I am not sure if this does not work on an actual s3 instance. If the s3 API has changed can you please provide me a link to the change/notice so I can bug DigitalOcean to update spaces.SDK version number
@aws-sdk/client-s3 3.0.0
Details of the browser/Node.js/ReactNative version
v14.8.0
The text was updated successfully, but these errors were encountered: