noobaa/noobaa-core

versioning suspend mode An error occurred (MalformedXML)

Closed this issue · 2 comments

Environment info

  • NooBaa Version: VERSION
    c83f2-dan9-hs200.test.net:  noobaa-core-5.17.0-20240926.el9.x86_64
    c83f2-dan10-hs200.test.net:  noobaa-core-5.17.0-20240926.el9.x86_64
    c83f2-dan8-hs200.test.net:  noobaa-core-5.17.0-20240926.el9.x86_64

Actual behavior

AWS_ACCESS_KEY_ID=accesskey AWS_SECRET_ACCESS_KEY=secretkey aws  --endpoint https://cesip:6443/ --no-verify-ssl s3api put-bucket-versioning --bucket bucket1 --versioning-configuration Status=suspend

An error occurred (MalformedXML) when calling the PutBucketVersioning operation: This happens when the user sends malformed xml (xml that doesn't conform to the published xsd) for the configuration. The error message is, "The XML you provided was not well-formed or did not validate against our published schema."

Expected behavior

Steps to reproduce

1.AWS_ACCESS_KEY_ID=accesskey AWS_SECRET_ACCESS_KEY=secretkey aws  --endpoint https://cesip:6443/ --no-verify-ssl s3api put-bucket-versioning --bucket bucket1 --versioning-configuration Status=suspend

More information - Screenshots / Logs / Other output

noobaa log error:
Oct  2 11:28:30 c83f2-dan8 [3510231]: [nsfs/3510231] ESC[36m   [L1]ESC[39m core.endpoint.s3.s3_rest:: S3 REQUEST PUT /bucket1?versioning op put_bucket_versioning request_id m1s0vepq-285fxw-qis { host: ESC[32m'172.20.100.60:6443'ESC[39m, ESC[32m'accept-encoding'ESC[39m: ESC[32m'identity'ESC[39m, ESC[32m'user-agent'ESC[39m: ESC[32m'aws-cli/2.9.23 Python/3.9.11 Linux/5.14.0-427.35.1.el9_4.x86_64 exe/x86_64.rhel.9 prompt/off command/s3api.put-bucket-versioning'ESC[39m, ESC[32m'content-md5'ESC[39m: ESC[32m'7uykTv7NfbC4+duVxtvPwA=='ESC[39m, ESC[32m'x-amz-date'ESC[39m: ESC[32m'20241002T154232Z'ESC[39m, ESC[32m'x-amz-content-sha256'ESC[39m: ESC[32m'a539d20ae8db9792283f1dd80917816dc6a40bfa5223732c7babd466dfb71257'ESC[39m, authorization: ESC[32m'AWS4-HMAC-SHA256 Credential=wzsc8Ti23jYxcBxENYQh/20241002/us-east-1/s3/aws4_request, SignedHeaders=content-md5;host;x-amz-content-sha256;x-amz-date, Signature=1c159a13c2c85528de39dcf65683f003652cee0a7d3ab57bde9c7ce026c3091e'ESC[39m, ESC[32m'content-length'ESC[39m: ESC[32m'123'ESC[39m }
Oct  2 11:28:30 c83f2-dan8 [3510231]: [nsfs/3510231] ESC[31m[ERROR]ESC[39m core.endpoint.s3.s3_rest:: S3 ERROR <?xml version="1.0" encoding="UTF-8"?><Error><Code>MalformedXML</Code><Message>This happens when the user sends malformed xml (xml that doesn&apos;t conform to the published xsd) for the configuration. The error message is, &quot;The XML you provided was not well-formed or did not validate against our published schema.&quot;</Message><Resource>/bucket1?versioning</Resource><RequestId>m1s0vepq-285fxw-qis</RequestId></Error> PUT /bucket1?versioning {"host":"172.20.100.60:6443","accept-encoding":"identity","user-agent":"aws-cli/2.9.23 Python/3.9.11 Linux/5.14.0-427.35.1.el9_4.x86_64 exe/x86_64.rhel.9 prompt/off command/s3api.put-bucket-versioning","content-md5":"7uykTv7NfbC4+duVxtvPwA==","x-amz-date":"20241002T154232Z","x-amz-content-sha256":"a539d20ae8db9792283f1dd80917816dc6a40bfa5223732c7babd466dfb71257","authorization":"AWS4-HMAC-SHA256 Credential=wzsc8Ti23jYxcBxENYQh/20241002/us-east-1/s3/aws4_request, SignedHeaders=content-md5;host;x-amz-content-sha256;x-amz-date, Signature=1c159a13c2c85528de39dcf65683f003652cee0a7d3ab57bde9c7ce026c3091e","content-length":"123"} Error: This happens when the user sends malformed xml (xml that doesn't conform to the published xsd) for the configuration. The error message is, "The XML you provided was not well-formed or did not validate against our published schema."    at Object.put_bucket_versioning [as handler] (/usr/local/noobaa-core/src/endpoint/s3/ops/s3_put_bucket_versioning.js:14:15)    at handle_request (/usr/local/noobaa-core/src/endpoint/s3/s3_rest.js:161:28)    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)    at async Object.s3_rest [as handler] (/usr/local/noobaa-core/src/endpoint/s3/s3_rest.js:66:9)

Yes, i also tested and getting same error. @romayalon @naveenpaul1 Please take a look and fix this.

An error occurred (MalformedXML) when calling the PutBucketVersioning operation: This happens when the user sends malformed xml (xml that doesn't conform to the published xsd) for the configuration. The error message is, "The XML you provided was not well-formed or did not validate against our published schema."

@javieramirez1 @PravinRanjan10

  1. This is an incorrect command, you should use run s3api put-bucket-versioning --bucket your.bucket --versioning-configuration Status=Suspended, notice the capital S and that it's Suspended. please check the examples section of the CLI documentation - https://docs.aws.amazon.com/cli/latest/reference/s3api/put-bucket-versioning.html#examples.
  2. I tried it against AWS to check if we throw an incorrect error message and here is the response -
s3api put-bucket-versioning --bucket my-bucket --versioning-configuration Status=suspend
// failure
An error occurred (MalformedXML) when calling the PutBucketVersioning operation (reached max retries: 1): The XML you provided was not well-formed or did not validate against our published schema

s3api put-bucket-versioning --bucket romy-buck --versioning-configuration Status=suspended
// failure
An error occurred (MalformedXML) when calling the PutBucketVersioning operation (reached max retries: 1): The XML you provided was not well-formed or did not validate against our published schema

s3api put-bucket-versioning --bucket romy-buck --versioning-configuration Status=Suspended
// success

Therefore, closing the issue, please check my suggestion and if needed re-open.