aws-sdk-js-v3: Invalid command "CompletedMultipartUpload" (should be CompleteMultipartUpload)
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 the d
in Completed
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
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (3 by maintainers)
Commits related to this issue
- fix(client-s3,aws-models): change CompleteMultipartUpload to match doc See issue #1814 , I just did a search and replace so everything is consistent: $ find . -exec sed s/CompletedMultipartUploa... — committed to paulreece42/aws-sdk-js-v3 by paulreece42 3 years ago
- * fixme CompletedMultipartUpload bug: https://github.com/aws/aws-sdk-js-v3/issues/1814 — committed to lonllua/aws-sdk-js-v3 by lonllua 3 years ago
Here’s a hacky workaround I’ve used to get
@aws-sdk/lib-storage
working with DigitalOcean spaces. I’ve used the SDK’s middleware to search-and-replace the tag. Hope this helps somebody until the library gets a fix: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
AllowedHeaders
,AllowedMethods
, andAllowedOrigins
But I didn’t configuredExposeHeaders
. Everything went well after I addedExposeHeaders: ["etag"]
in CORS configuration.I want SDK v3 to give more verbose error messages in this case, because I guess it’s a common mistake anyone would make.
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
patch-package
for anyone else running into this issue@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
priority: 'high'
to the middleware options.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: https://github.com/aws/aws-sdk-go-v2/pull/965. I will create a fix soon referring to their PR.
@nurdism has the fix, by patching the package to fix AWS’ bug using
patch-package
. It’s working great for me after bumping the version to apply it to the newest SDKbecause it produces invalid XML and other S3 compatible services (like DigitalOcean spaces) can throw an error (MalformedXML) the correct xml should be:
but
@aws-sdk/client-s3
along with@aws-sdk/lib-storage
producesessentially, changing
const bodyNode = new __XmlNode("CompletedMultipartUpload");
toconst bodyNode = new __XmlNode("CompleteMultipartUpload");
here will produce the correct XML.this might be a bug in the codegen? (just speculaiting) as its correctly named here