Project

General

Profile

Actions

Bug #65794

open

Ceph Reef RGW error response fails to be parsed during awscli create-bucket

Added by Peter Razumovsky 15 days ago. Updated 3 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

Source:
Community (dev)
Tags:
s3 low-hanging-fruit
Backport:
reef squid
Regression:
Yes
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Using Ceph Reef v18.2.2 (with Rook v1.13.5 but it is not important here). Running tests with RGW bucket quota exceed and got the following message from aws cli:

# aws --endpoint-url https://rook-ceph-rgw-openstack-store.rook-ceph.svc:8443/ --ca-bundle /etc/rgwcerts/cacert s3api create-bucket --bucket quota

argument of type 'NoneType' is not iterable

 It seems this is due to RGW starts returning message tag with empty body since Ceph Reef:

2024-05-03 14:48:59,116 - MainThread - botocore.parsers - DEBUG - Response body:
b'<?xml version="1.0" encoding="UTF-8"?><Error><Code>TooManyBuckets</Code><Message></Message><BucketName>quota</BucketName><RequestId>tx000003a27407b65589525-006634f95a-47cc-openstack-store</RequestId><HostId>47cc-openstack-store-openstack-store</HostId></Error>'

(see full debug log in error-message-reef.log)

When using Ceph Quincy v17.2.7 - nothing unexpected, I got TooManyBuckets error as always:

# aws --endpoint-url https://rook-ceph-rgw-openstack-store.rook-ceph.svc:8443/ --ca-bundle /etc/rgwcerts/cacert s3api create-bucket --bucket quota-bucket 

An error occurred (TooManyBuckets) when calling the CreateBucket operation: Unknow

And here is corresponding RGW response for over-quota bucket creation in Ceph Quincy:

2024-05-03 15:01:06,069 - MainThread - botocore.parsers - DEBUG - Response body:
b'<?xml version="1.0" encoding="UTF-8"?><Error><Code>TooManyBuckets</Code><BucketName>quota-bucket</BucketName><RequestId>tx000004f549f743c0fcb7f-006634fc32-d524-openstack-store</RequestId><HostId>d524-openstack-store-openstack-store</HostId></Error>'

(full debug log could be found in error-message-quincy.log)

awscli and botocore versions are the same for Ceph Quincy and Ceph Reef tests so the version diff has no effect here.


Files

error-message-reef.log (21.1 KB) error-message-reef.log Peter Razumovsky, 05/03/2024 03:03 PM
error-message-quincy.log (20.2 KB) error-message-quincy.log Peter Razumovsky, 05/03/2024 03:03 PM
proving-example.py (1.46 KB) proving-example.py Peter Razumovsky, 05/07/2024 12:50 PM

Related issues 2 (2 open0 closed)

Related to rgw - Bug #59433: s3 error response missing Message fieldPending BackportCasey Bodley

Actions
Blocks rgw - Backport #59615: quincy: s3 error response missing Message fieldIn ProgressMykola GolubActions
Actions #1

Updated by Casey Bodley 11 days ago

  • Related to Bug #59433: s3 error response missing Message field added
Actions #2

Updated by Casey Bodley 11 days ago

  • Blocks Backport #59615: quincy: s3 error response missing Message field added
Actions #3

Updated by Casey Bodley 11 days ago

  • Tags set to s3
  • Backport set to reef squid
  • Regression changed from No to Yes

Peter Razumovsky wrote:

 It seems this is due to RGW starts returning message tag with empty body since Ceph Reef:

can't win, i guess. before, some clients failed to decode the response because there was no Message element (https://tracker.ceph.com/issues/59433). https://github.com/ceph/ceph/pull/51052 added the empty Message element for that case

i guess boto interprets empty as NoneType? maybe we should return a space character instead

Actions #4

Updated by Peter Razumovsky 11 days ago

Yep, this is behaviour of boto, it parses xml response with

import xml.etree.cElementTree as ETree

and produces a dict with item.text values as a result. In that case, xml parser returns `None` for empty Message tag, you're right:

{'Code': 'TooManyBuckets', 'Message': None, 'BucketName': 'quota', 'RequestId': 'tx000003a27407b65589525-006634f95a-47cc-openstack-store', 'HostId': '47cc-openstack-store-openstack-store'}

See full proving example in attachment. The code is taken from https://github.com/boto/botocore/blob/develop/botocore/parsers.py#L500 and https://github.com/boto/botocore/blob/develop/botocore/parsers.py#L477.

Actions #5

Updated by Casey Bodley 9 days ago

  • Tags changed from s3 to s3 low-hanging-fruit
Actions #6

Updated by Ilya Dryomov 3 days ago

  • Target version deleted (v18.2.3)
Actions

Also available in: Atom PDF