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

Error during setting .WithLifecycleConfiguration #656

Closed
peterczabanski opened this issue Jun 28, 2022 · 2 comments
Closed

Error during setting .WithLifecycleConfiguration #656

peterczabanski opened this issue Jun 28, 2022 · 2 comments

Comments

@peterczabanski
Copy link

Hi, settings like:
SetBucketLifecycleArgs args = new SetBucketLifecycleArgs() .WithBucket(bucketName) .WithLifecycleConfiguration( new LifecycleConfiguration(new List<LifecycleRule>(new[] { new LifecycleRule { AbortIncompleteMultipartUploadObject = null, ID = "Delete imagines after 31 days", Expiration = null, TransitionObject = null, Filter = null, NoncurrentVersionExpirationObject = new NoncurrentVersionExpiration(31), NoncurrentVersionTransitionObject = null, Status = LifecycleRule.LIFECYCLE_RULE_STATUS_ENABLED } })));

return error:

API: PutBucketLifecycle(bucket=trackingid) Time: 11:59:46 UTC 06/28/2022 DeploymentID: 3b10a44d-fa41-434a-a056-ffef5d19d9f3 RequestID: 16FCC704C6A47418 RemoteHost: 172.17.0.1 Host: 10.170.44.31:19000 UserAgent: MinIO (Linux 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021;X64) minio-dotnet/4.0.3.0 Error: The XML you provided was not well-formed or did not validate against our published schema (lifecycle.Error) 5: internal/logger/logger.go:278:logger.LogIf() 4: cmd/api-errors.go:2123:cmd.toAPIErrorCode() 3: cmd/api-errors.go:2148:cmd.toAPIError() 2: cmd/bucket-lifecycle-handlers.go:78:cmd.objectAPIHandlers.PutBucketLifecycleHandler() 1: net/http/server.go:2084:http.HandlerFunc.ServeHTTP()

@yadanilov19
Copy link

yadanilov19 commented Jul 21, 2022

Hi! I have the same problem.
Code:

 var lifeCycle = new SetBucketLifecycleArgs()
                .WithBucket("test")
                .WithLifecycleConfiguration(
                    new LifecycleConfiguration()
                    {
                        Rules = new List<LifecycleRule>()
                        {
                            new()
                            {
                                ID = "AutoRemoveOldFiles",
                                Status = LifecycleRule.LIFECYCLE_RULE_STATUS_ENABLED,
                                NoncurrentVersionExpirationObject = new NoncurrentVersionExpiration(1),
                                Expiration = new Expiration()
                                {
                                    Days = 1,
                                    ExpiredObjectDeleteMarker = true
                                }
                            }
                        }
                    });
            await _client.SetBucketLifecycleAsync(lifeCycle, cancellationToken);

Then a had a log like this

- - - - - - - - - - BEGIN REQUEST - - - - - - - - - -

PUT http://localhost:9000/test/?lifecycle= HTTP/1.1
Host: System.String[]
x-amz-content-sha256: System.String[]
x-amz-date: System.String[]
Authorization: System.String[]
User-Agent: System.String[]
traceparent: System.String[]
body: <LifecycleConfiguration><Rule><ID>AutoRemoveOldFiles</ID><Expiration><Days>1</Days></Expiration><NoncurrentVersionExpiration /><Status>Enabled</Status></Rule></LifecycleConfiguration>

- - - - - - - - - - END REQUEST - - - - - - - - - -

- - - - - - - - - - BEGIN RESPONSE - - - - - - - - - -

HTTP/1.1 400 BadRequest
Content-Length: 337
Content-Type: application/xml
Accept-Ranges: bytes
Content-Security-Policy: block-all-mixed-content
Server: MinIO
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Origin
X-Amz-Request-Id: 1703CD810A9653C9
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Date: Thu, 21 Jul 2022 09:17:21 GMT


<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidRequest</Code><Message>The XML you provided was not well-for
med or did not validate against our published schema</Message><BucketName>test</
BucketName><Resource>/test/</Resource><RequestId>1703CD810A9653C9</RequestId><Ho
stId>b6aeb5f2-6fc5-4a0d-92b8-0064bbe3c37f</HostId></Error>

- - - - - - - - - - END RESPONSE - - - - - - - - - -

@andreqGavMineral
Copy link

Hello! I have the same problem. Will this be fixed in upcoming releases or is there a workaround?

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

No branches or pull requests

4 participants