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

"The XML you provided was not well-formed" error when using set_bucket_lifecycle #1093

Closed
nevesenin opened this issue Mar 5, 2021 · 4 comments · Fixed by #1094
Closed

"The XML you provided was not well-formed" error when using set_bucket_lifecycle #1093

nevesenin opened this issue Mar 5, 2021 · 4 comments · Fixed by #1094

Comments

@nevesenin
Copy link

nevesenin commented Mar 5, 2021

Hi!

I tried to do this on play:

from minio import Minio
from minio.commonconfig import ENABLED
from minio.lifecycleconfig import LifecycleConfig, Rule, AbortIncompleteMultipartUpload, NoncurrentVersionExpiration
import sys

client = Minio(
    'play.min.io:9000',
    access_key="Q3AM3UQ867SPQQA43P2F",
    secret_key="zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG",
    secure=True,
    http_client=None,
    region="foo"
)

if not client.bucket_exists('foobar'):
    client.make_bucket('foobar')

lifecycle_config = LifecycleConfig(
    [
        Rule(
            ENABLED,
            rule_id="DeleteIncompleteMultipartUploadsAfter1Day",
            abort_incomplete_multipart_upload=AbortIncompleteMultipartUpload(days_after_initiation=1)
        )
    ]
)

client.trace_on(sys.stdout)
client.set_bucket_lifecycle('foobar', lifecycle_config)

Results in:

---------START-HTTP---------
PUT /foobar?lifecycle= HTTP/1.1
Content-Md5: XSfEFJ/19OyEUR9Wl5g4oQ==
Host: play.min.io:9000
User-Agent: MinIO (Linux; x86_64) minio-py/7.0.3
Content-Length: 293
X-Amz-Content-Sha256: UNSIGNED-PAYLOAD
X-Amz-Date: 20210305T061354Z
Authorization: AWS4-HMAC-SHA256 Credential=*REDACTED*/20210305/foo/s3/aws4_request, SignedHeaders=content-md5;host;x-amz-content-sha256;x-amz-date, Signature=*REDACTED*

<LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Rule><Status>Enabled</Status><AbortIncompleteMultipartUpload><DaysAfterInitiation>1</DaysAfterInitiation></AbortIncompleteMultipartUpload><ID>DeleteIncompleteMultipartUploadsAfter1Day</ID></Rule></LifecycleConfiguration>

HTTP/1.1 400
Accept-Ranges: bytes
Content-Length: 340
Content-Security-Policy: block-all-mixed-content
Content-Type: application/xml
Server: MinIO
Vary: Origin
X-Amz-Request-Id: 16695D949FFC8ABB
X-Xss-Protection: 1; mode=block
Date: Fri, 05 Mar 2021 06:13:54 GMT
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidRequest</Code><Message>The XML you provided was not well-formed or did not validate against our published schema</Message><BucketName>foobar</BucketName><Resource>/foobar</Resource><RequestId>16695D949FFC8ABB</RequestId><HostId>129c19c9-4cf6-44ff-9f2d-4cb7611be894</HostId></Error>
----------END-HTTP----------

I try to figure out if I did something wrong but I'm stuck. Could you please help?

@balamurugana
Copy link
Member

@nevesenin You must provide Rule filter. Refer PR #1094

@nevesenin
Copy link
Author

nevesenin commented Mar 5, 2021

Thanks for the quick reply.

I added a filter. Unfortunately this also does not work:

---------START-HTTP---------
PUT /foobar?lifecycle= HTTP/1.1
Content-Md5: 5Pvr7NQKn/1LvLnYBNBRDA==
Host: play.min.io:9000
User-Agent: MinIO (Linux; x86_64) minio-py/7.0.3
Content-Length: 337
X-Amz-Content-Sha256: UNSIGNED-PAYLOAD
X-Amz-Date: 20210305T080611Z
Authorization: AWS4-HMAC-SHA256 Credential=*REDACTED*/20210305/foo/s3/aws4_request, SignedHeaders=content-md5;host;x-amz-content-sha256;x-amz-date, Signature=*REDACTED*

<LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Rule><Status>Enabled</Status><AbortIncompleteMultipartUpload><DaysAfterInitiation>1</DaysAfterInitiation></AbortIncompleteMultipartUpload><Filter><Prefix>documents/</Prefix></Filter><ID>DeleteIncompleteMultipartUploadsAfter1Day</ID></Rule></LifecycleConfiguration>

HTTP/1.1 400
Accept-Ranges: bytes
Content-Length: 340
Content-Security-Policy: block-all-mixed-content
Content-Type: application/xml
Server: MinIO
Vary: Origin
X-Amz-Request-Id: 166963B5587EBE7C
X-Xss-Protection: 1; mode=block
Date: Fri, 05 Mar 2021 08:06:11 GMT
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidRequest</Code><Message>The XML you provided was not well-formed or did not validate against our published schema</Message><BucketName>foobar</BucketName><Resource>/foobar</Resource><RequestId>166963B5587EBE7C</RequestId><HostId>129c19c9-4cf6-44ff-9f2d-4cb7611be894</HostId></Error>
----------END-HTTP----------

@vadmeste
Copy link
Member

vadmeste commented Mar 5, 2021

@nevesenin we don't support AbortIncompleteMultipartUpload, that's why you have that error message.

MinIO server self cleanups them already each 24 hours

@nevesenin
Copy link
Author

@vadmeste Thanks. Tried a different rule and it worked.

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.

3 participants