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

Setting lifecycle rule with AbortIncompleteMultipartUpload not working #16120

Closed
magnushakansson opened this issue Nov 24, 2022 · 4 comments
Closed

Comments

@magnushakansson
Copy link

NOTE

If this case is urgent, please subscribe to Subnet so that our 24/7 support team may help you faster.

When I send in a request like this:

172.18.2.42:9000 [REQUEST s3.PutBucketLifecycle] [2022-11-24T09:45:25.038] [Client IP: 172.18.2.1]
172.18.2.42:9000 PUT /mybucket?lifecycle
172.18.2.42:9000 Proto: HTTP/1.1
172.18.2.42:9000 Host: 172.18.2.42:9000
172.18.2.42:9000 Amz-Sdk-Request: attempt=1
172.18.2.42:9000 User-Agent: aws-sdk-cpp/1.9.257 Linux/4.19.0-6-amd64 x86_64 Clang/10.0.1
172.18.2.42:9000 X-Amz-Content-Sha256: 34ab54d32cd58cec559897d8ecfa8ddb119ae8e3aa478b1a683f2979f0649d43
172.18.2.42:9000 Expect: 100-continue
172.18.2.42:9000 Accept: */*
172.18.2.42:9000 Amz-Sdk-Invocation-Id: 87D46C5C-B9C4-4E8F-8B67-6A785F899176
172.18.2.42:9000 Authorization: AWS4-HMAC-SHA256 Credential=minioadmin/20221124/us-west-1/s3/aws4_request, SignedHeaders=amz-sdk-invocation-id;amz-sdk-request;content-length;content-md5;content-type;host;x-amz-api-version;x-amz-content-sha256;x-amz-date, Signature=d908f38ef7980e46206bae5e57cbc00ecadaa3ced59f34fb617d6ef2a3f56384
172.18.2.42:9000 Content-Length: 419
172.18.2.42:9000 Content-Md5: WHm3mAVQCRBkoeRkYVU/Xw==
172.18.2.42:9000 Content-Type: application/xml
172.18.2.42:9000 X-Amz-Api-Version: 2006-03-01
172.18.2.42:9000 X-Amz-Date: 20221124T094525Z
172.18.2.42:9000 <?xml version="1.0"?>
<LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <Rule>
        <ID>abort-upload</ID>
        <Filter>
            <Prefix></Prefix>
        </Filter>
        <Status>Enabled</Status>
        <AbortIncompleteMultipartUpload>
            <DaysAfterInitiation>1</DaysAfterInitiation>
        </AbortIncompleteMultipartUpload>
    </Rule>
</LifecycleConfiguration>

I get the response:

172.18.2.42:9000 [RESPONSE] [2022-11-24T09:45:25.039] [ Duration 790µs  ↑ 591 B  ↓ 344 B ]
172.18.2.42:9000 400 Bad Request
172.18.2.42:9000 Accept-Ranges: bytes
172.18.2.42:9000 Server: MinIO
172.18.2.42:9000 Vary: Origin,Accept-Encoding
172.18.2.42:9000 X-Content-Type-Options: nosniff
172.18.2.42:9000 Content-Length: 344
172.18.2.42:9000 Content-Security-Policy: block-all-mixed-content
172.18.2.42:9000 Content-Type: application/xml
172.18.2.42:9000 Strict-Transport-Security: max-age=31536000; includeSubDomains
172.18.2.42:9000 X-Amz-Request-Id: 172A7C28717D43B0
172.18.2.42:9000 X-Xss-Protection: 1; mode=block
172.18.2.42:9000 <?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>mybucket</BucketName><Resource>/mybucket</Resource><RequestId>172A7C28717D43B0</RequestId><HostId>ddbf6d3c-e859-4c0d-8ba8-2c7dbb2c527d</HostId></Error>
172.18.2.42:9000 

Expected Behavior

According to the example in https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-configuration-examples.html#lc-expire-mpu this should work and the rule be created.
Even if there seems to be an automatic rule created that purge after 3 days, reference #10255 (comment)

Current Behavior

Error as shown above.

Possible Solution

Return ok even if the lifecycle rule is not actually used.

Steps to Reproduce (for bugs)

Just create the rule and send the request.

Context

I use Minio for local/CI testing and then AWS S3 in production. It would be great if I can avoid different code paths for the different environments.

Regression

No

Your Environment

  • Version used (minio --version):
    minio/minio:RELEASE.2022-10-29T06-21-33Z

  • Server setup and configuration:
    Docker container as above.

  • Operating System and version (uname -a):
    Linux gho-debian 4.19.0-6-amd64 Full restructure in accordance with #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 GNU/Linux

@klauspost
Copy link
Contributor

@magnushakansson MinIO automatically deletes non-aborted multipart uploads after 24 hours.

You can adjust it globally using mc admin config get ALIAS api / mc admin config set ALIAS api stale_uploads_expiry=24h.

@magnushakansson
Copy link
Author

My main concern is not 1day or 3 days. It's the API incompatibility as it seems.

@harshavardhana
Copy link
Member

My main concern is not 1day or 3 days. It's the API incompatibility as it seems.

We don't implement it because it's not useful, we don't want this configurable at bucket level and it has nothing to do with ILM on MinIO.

We deviated on purpose here.

@magnushakansson
Copy link
Author

My main concern is not 1day or 3 days. It's the API incompatibility as it seems.

We don't implement it because it's not useful, we don't want this configurable at bucket level and it has nothing to do with ILM on MinIO.

We deviated on purpose here.

Understood. Thank you for the clarification.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants