Bug 2311872

Summary: [rgw] GetObjectAttributes with ObjectParts attribute is failing with invalid xml
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Hemanth Sai <hmaheswa>
Component: RGWAssignee: Matt Benjamin (redhat) <mbenjamin>
Status: CLOSED ERRATA QA Contact: Hemanth Sai <hmaheswa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 8.0CC: ceph-eng-bugs, cephqe-warriors, tserlin
Target Milestone: ---   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ceph-19.2.0-17.el9cp Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-11-25 09:10:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Hemanth Sai 2024-09-12 07:47:48 UTC
Description of problem:
GetObjectAttributes request with ObjectParts attribute is failing with invalid xml

[cephuser@ceph-hsm-reef-pqd722-node6 ~]$ aws --endpoint-url http://10.0.66.18:80 s3api get-object-attributes --bucket bkt1 --key multipart-obj --object-attributes  "ObjectParts"

Unable to parse response (reference to invalid character number: line 1, column 138), invalid XML received. Further retries may succeed:
b'<?xml version="1.0" encoding="UTF-8"?><GetObjectAttributes><ObjectParts><Part><PartNumber>1</PartNumber><Size>7000000</Size><ChecksumNONE>&#x00;&#x00;&#x00;&#x00;</ChecksumNONE></Part><Part><PartNumber>2</PartNumber><Size>6500000</Size><ChecksumNONE>&#x00;&#x00;&#x00;&#x00;</ChecksumNONE></Part><Part><PartNumber>3</PartNumber><Size>6000000</Size><ChecksumNONE>&#x00;&#x00;&#x00;&#x00;</ChecksumNONE></Part><PartsCount>3</PartsCount><TotalPartsCount>3</TotalPartsCount><IsTruncated>false</IsTruncated><MaxParts>22100</MaxParts><NextPartNumberMarker>3</NextPartNumberMarker><PartNumberMarker>0</PartNumberMarker></ObjectParts></GetObjectAttributes>'
[cephuser@ceph-hsm-reef-pqd722-node6 ~]$ 



Version-Release number of selected component (if applicable):
ceph version 19.1.1-21.el9cp

How reproducible:
always

Steps to Reproduce:
1.deploy rhcs8.0 with rgw daemons
2.create a bucket
3.create multipart upload
[cephuser@ceph-hsm-reef-pqd722-node6 ~]$ aws --endpoint-url http://10.0.66.18:80 s3api create-multipart-upload --bucket bkt1 --key multipart-obj
{
    "Bucket": "bkt1",
    "Key": "multipart-obj",
    "UploadId": "2~C1P9UBt1xoAROxtQlgiqjTCp4febxxs"
}
[cephuser@ceph-hsm-reef-pqd722-node6 ~]$

4.upload parts
[cephuser@ceph-hsm-reef-pqd722-node6 ~]$ aws --endpoint-url http://10.0.66.18:80 s3api upload-part --bucket bkt1 --key multipart-obj --upload-id 2~C1P9UBt1xoAROxtQlgiqjTCp4febxxs --part-number 1 --body part1
{
    "ETag": "\"8e5daee75e9a4bb3d912168d5c14f960\""
}
[cephuser@ceph-hsm-reef-pqd722-node6 ~]$ 
[cephuser@ceph-hsm-reef-pqd722-node6 ~]$ aws --endpoint-url http://10.0.66.18:80 s3api upload-part --bucket bkt1 --key multipart-obj --upload-id 2~C1P9UBt1xoAROxtQlgiqjTCp4febxxs --part-number 2 --body part2
{
    "ETag": "\"dcc4fd782a40c1ba4366c0d017ad63e5\""
}
[cephuser@ceph-hsm-reef-pqd722-node6 ~]$ 
[cephuser@ceph-hsm-reef-pqd722-node6 ~]$ aws --endpoint-url http://10.0.66.18:80 s3api upload-part --bucket bkt1 --key multipart-obj --upload-id 2~C1P9UBt1xoAROxtQlgiqjTCp4febxxs --part-number 3 --body part3
{
    "ETag": "\"75c6f06ec40f8063da34fcd7fc2bf17f\""
}
[cephuser@ceph-hsm-reef-pqd722-node6 ~]$ 

5.complete multipart upload
[cephuser@ceph-hsm-reef-pqd722-node6 ~]$ cat parts.json 
{
  "Parts": [
    {
      "ETag": "\"8e5daee75e9a4bb3d912168d5c14f960\"",
      "PartNumber": 1
    },
    {
      "ETag": "\"dcc4fd782a40c1ba4366c0d017ad63e5\"",
      "PartNumber": 2
    },
    {
      "ETag": "\"75c6f06ec40f8063da34fcd7fc2bf17f\"",
      "PartNumber": 3
    }
  ]
}
[cephuser@ceph-hsm-reef-pqd722-node6 ~]$ 
[cephuser@ceph-hsm-reef-pqd722-node6 ~]$ aws --endpoint-url http://10.0.66.18:80 s3api complete-multipart-upload --bucket bkt1 --key multipart-obj --upload-id 2~C1P9UBt1xoAROxtQlgiqjTCp4febxxs --multipart-upload file://parts.json
{
    "Location": "http://10.0.66.18/bkt1/multipart-obj",
    "Bucket": "bkt1",
    "Key": "multipart-obj",
    "ETag": "\"1c7cfdc53825e01d7040127b7d2f3e51-3\""
}
[cephuser@ceph-hsm-reef-pqd722-node6 ~]$

6.get object attributes with ObjectParts as object-attribute. its failing with invalid xml
[cephuser@ceph-hsm-reef-pqd722-node6 ~]$ aws --endpoint-url http://10.0.66.18:80 s3api get-object-attributes --bucket bkt1 --key multipart-obj --object-attributes  "ObjectParts"

Unable to parse response (reference to invalid character number: line 1, column 138), invalid XML received. Further retries may succeed:
b'<?xml version="1.0" encoding="UTF-8"?><GetObjectAttributes><ObjectParts><Part><PartNumber>1</PartNumber><Size>7000000</Size><ChecksumNONE>&#x00;&#x00;&#x00;&#x00;</ChecksumNONE></Part><Part><PartNumber>2</PartNumber><Size>6500000</Size><ChecksumNONE>&#x00;&#x00;&#x00;&#x00;</ChecksumNONE></Part><Part><PartNumber>3</PartNumber><Size>6000000</Size><ChecksumNONE>&#x00;&#x00;&#x00;&#x00;</ChecksumNONE></Part><PartsCount>3</PartsCount><TotalPartsCount>3</TotalPartsCount><IsTruncated>false</IsTruncated><MaxParts>22100</MaxParts><NextPartNumberMarker>3</NextPartNumberMarker><PartNumberMarker>0</PartNumberMarker></ObjectParts></GetObjectAttributes>'
[cephuser@ceph-hsm-reef-pqd722-node6 ~]$ 

7.but with other object attributes, the request is successful
[cephuser@ceph-hsm-reef-pqd722-node6 ~]$ aws --endpoint-url http://10.0.66.18:80 s3api get-object-attributes --bucket bkt1 --key multipart-obj --object-attributes "StorageClass" "ETag" "ObjectSize" "Checksum"
{
    "LastModified": "Wed, 11 Sep 2024 14:33:00 GMT",
    "ETag": "1c7cfdc53825e01d7040127b7d2f3e51-3",
    "Checksum": {},
    "StorageClass": "STANDARD",
    "ObjectSize": 19500000
}
[cephuser@ceph-hsm-reef-pqd722-node6 ~]$ 


Actual results:
GetObjectAttributes request with ObjectParts attribute is failing with invalid xml.

Expected results:
expected GetObjectAttributes request with ObjectParts attribute is successful.

Additional info:

Comment 7 errata-xmlrpc 2024-11-25 09:10:01 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat Ceph Storage 8.0 security, bug fix, and enhancement updates), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2024:10216