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

Added a fix for handling invalid_schema_error returning with invalid status value for bucket lifecycle configuration rule #8664

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

achouhan09
Copy link
Member

@achouhan09 achouhan09 commented Jan 8, 2025

Explain the changes

  1. This fix ensures that when an INVALID_SCHEMA_PARAMS error occurs due to an incorrect Status value (other than "Enabled" or "Disabled") in a bucket lifecycle configuration rule, the appropriate AWS S3 error (MalformedXML) is returned.

Below is the aws output:
Screenshot from 2025-01-08 19-12-26

Issues: Fixed #xxx / Gap #xxx

  1. Fixed: NSFS | S3 | Lifecycle: Invalid rule status returns http error 500 #8553

Testing Instructions:

  1. create s3 backingstore>bucketclass>obc.
  2. Apply below policy on the bucket created with obc:
    $ AWS_ACCESS_KEY_ID=<access-key> AWS_SECRET_ACCESS_KEY=<secret-key> aws s3api --no-verify-ssl --endpoint-url <endpoint-url> put-bucket-lifecycle-configuration --bucket <bucket-name> --lifecycle-configuration '{ "Rules": [ { "ID": "rule_id", "Status": "enabled", "Filter": { "Prefix": "test/" }, "Expiration": { "Date": "2020-01-02T00:00:00.000Z" } } ] }'
  3. Check for the similar error as AWS S3:
    An error occurred (MalformedXML) when calling the PutBucketLifecycleConfiguration operation: The XML you provided was not well-formed or did not validate against our published schema
  • Tests added

@achouhan09 achouhan09 requested review from liranmauda, romayalon, shirady, naveenpaul1, a team and tangledbytes and removed request for a team January 8, 2025 13:55
@pull-request-size pull-request-size bot added size/M and removed size/S labels Jan 8, 2025
@achouhan09 achouhan09 changed the title Added a fix for handling invalid_schema_error returning with wrong status value Added a fix for handling invalid_schema_error returning with invalid status value Jan 8, 2025
src/endpoint/s3/ops/s3_put_bucket_lifecycle.js Outdated Show resolved Hide resolved
src/test/lifecycle/common.js Outdated Show resolved Hide resolved
src/endpoint/s3/s3_constants.js Outdated Show resolved Hide resolved
src/endpoint/s3/s3_constants.js Outdated Show resolved Hide resolved
src/endpoint/s3/s3_errors.js Show resolved Hide resolved
src/endpoint/s3/s3_utils.js Outdated Show resolved Hide resolved
src/endpoint/s3/s3_utils.js Outdated Show resolved Hide resolved
src/endpoint/s3/ops/s3_put_bucket_lifecycle.js Outdated Show resolved Hide resolved
src/endpoint/s3/ops/s3_put_bucket_lifecycle.js Outdated Show resolved Hide resolved
src/endpoint/s3/ops/s3_put_bucket_lifecycle.js Outdated Show resolved Hide resolved
@achouhan09 achouhan09 requested a review from shirady January 13, 2025 15:49
src/endpoint/s3/s3_errors.js Outdated Show resolved Hide resolved
src/endpoint/s3/s3_utils.js Outdated Show resolved Hide resolved
src/endpoint/s3/s3_errors.js Outdated Show resolved Hide resolved
src/endpoint/s3/ops/s3_put_bucket_lifecycle.js Outdated Show resolved Hide resolved
@achouhan09 achouhan09 requested a review from shirady January 15, 2025 13:26
@achouhan09 achouhan09 force-pushed the status-fix branch 2 times, most recently from 75157a4 to 8160d13 Compare January 15, 2025 16:44
@achouhan09 achouhan09 requested a review from shirady January 16, 2025 07:23
@achouhan09 achouhan09 changed the title Added a fix for handling invalid_schema_error returning with invalid status value Added a fix for handling invalid_schema_error returning with invalid status value for bucket lifecycle configuration rule Jan 16, 2025
@achouhan09 achouhan09 force-pushed the status-fix branch 2 times, most recently from d90d00b to 584d8f8 Compare January 16, 2025 07:55
Copy link
Contributor

@shirady shirady left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@achouhan09 achouhan09 merged commit dacfe8e into noobaa:master Jan 16, 2025
11 checks passed
@achouhan09 achouhan09 deleted the status-fix branch January 24, 2025 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NSFS | S3 | Lifecycle: Invalid rule status returns http error 500
2 participants