Skip to content
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

Multipart PUT - XML you provided was not well-formed - HCP for Cloud Scale #1731

Closed
alex5517 opened this issue Nov 29, 2022 · 3 comments · Fixed by #1732
Closed

Multipart PUT - XML you provided was not well-formed - HCP for Cloud Scale #1731

alex5517 opened this issue Nov 29, 2022 · 3 comments · Fixed by #1732

Comments

@alex5517
Copy link

alex5517 commented Nov 29, 2022

Hi,

I have an issue when using Minio-go against HCP for Cloud Scale.

Here's how i put my object in my tests.

_, err = client.PutObject(ctx, bucket, name, r, size, 	minio.PutObjectOptions{
			NumThreads: 4,
		},
	)

The resulting error is The XML you provided was not well-formed or did not validate against our published schema..

I think the issue might be that xmlns is included in CompleteMultipartUpload

I also tried testing using aws-sdk-go which works just fine.

Here is the differences between the two:

AWS SDK GO:


<CompleteMultipartUpload xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <Part><ETag>&#34;a8199196f91603aeeee899cee01b7ae6&#34;</ETag>
    <PartNumber>1</PartNumber></Part>
    <Part><ETag>&#34;7edf0e8a6bae1d1c9baa03971cdb690a&#34;</ETag>
    <PartNumber>2</PartNumber></Part>
</CompleteMultipartUpload>

MINIO-GO:

<CompleteMultipartUpload xmlns="">
    <Part xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <PartNumber>1</PartNumber><ETag>5f0cc9778afe6dc19dc364e2673f8d03</ETag></Part>
    <Part xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <PartNumber>2</PartNumber><ETag>bf2ebedc90103f013f7e95f8abc10e5f</ETag></Part>
</CompleteMultipartUpload>

In an attempt to try and get the requests closer to how aws-sdk-go i tried removing http://s3.amazonaws.com/doc/2006-03-01/ from https://github.com/minio/minio-go/blob/master/api-s3-datatypes.go#L319 - After doing this it seems to be working?

@alex5517
Copy link
Author

It also does not seem like the xmlns should be within the part section based on Amazon S3 docs: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html#API_CompleteMultipartUpload_RequestSyntax

@alex5517 alex5517 changed the title XML you provided was not well-formed - HCP for Cloud Scale Multipart PUT - XML you provided was not well-formed - HCP for Cloud Scale Nov 29, 2022
@harshavardhana
Copy link
Member

However this should work xmlns has nothing to do with schema, almost all servers including AWS S3 work perfectly fine here.

play.min.io [REQUEST s3.CompleteMultipartUpload] [2022-11-28T23:24:37.856] [Client IP: 174.160.4.87]
play.min.io POST /testbucket/initrd.img?uploadId=ZjkwOWExMTctMzFmMi00MGM1LTk4NWQtYWQ0ZGQwMmExZmRhLjA0NGYyNmI2LTc3ZTgtNDUwYy05YzhhLWRhOWU2YzMxMGQwOA
play.min.io Proto: HTTP/1.1
play.min.io Host: play.min.io
play.min.io X-Amz-Date: 20221129T072437Z
play.min.io Authorization: AWS4-HMAC-SHA256 Credential=Q3AM3UQ867SPQQA43P2F/20221129/us-east-1/s3/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=98903436629dada7ab9d2aa4a41f04b7c2fa94fe1187b29e1043ff2f035dfc0c
play.min.io Content-Length: 1131
play.min.io Content-Type: application/octet-stream
play.min.io User-Agent: MinIO (linux; amd64) minio-go/v7.0.41 mc/DEVELOPMENT.2022-11-19T05-42-48Z
play.min.io X-Amz-Content-Sha256: 683930c423592ee7d41ed75a85e393090241b8893ca6187ac6918a409fcbf92f
play.min.io X-Forwarded-For: 174.160.4.87
play.min.io X-Forwarded-Proto: https
play.min.io X-Real-Ip: 174.160.4.87
play.min.io <CompleteMultipartUpload xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Part xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><PartNumber>1</PartNumber><ETag>0b3b4cf4b12d5f954ceafedd6aa75e9b</ETag><ChecksumCRC32></ChecksumCRC32><ChecksumCRC32C></ChecksumCRC32C><ChecksumSHA1></ChecksumSHA1><ChecksumSHA256></ChecksumSHA256></Part><Part xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><PartNumber>2</PartNumber><ETag>88a2f260df9f00fb60370328de172eaf</ETag><ChecksumCRC32></ChecksumCRC32><ChecksumCRC32C></ChecksumCRC32C><ChecksumSHA1></ChecksumSHA1><ChecksumSHA256></ChecksumSHA256></Part><Part xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><PartNumber>3</PartNumber><ETag>0d2210f6a86fd6ddd0a21001b1c2cf5c</ETag><ChecksumCRC32></ChecksumCRC32><ChecksumCRC32C></ChecksumCRC32C><ChecksumSHA1></ChecksumSHA1><ChecksumSHA256></ChecksumSHA256></Part><Part xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><PartNumber>4</PartNumber><ETag>43ebd784ab7664354c236e2a601b10c2</ETag><ChecksumCRC32></ChecksumCRC32><ChecksumCRC32C></ChecksumCRC32C><ChecksumSHA1></ChecksumSHA1><ChecksumSHA256></ChecksumSHA256></Part></CompleteMultipartUpload>

HCP must understand that clients can choose to implement this either way, there are no specific rules here to follow.

@alex5517
Copy link
Author

Yea i agree that it is most likely just some strict XML checking from HCP...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants