Actions
Bug #977
closedradosgw should provide error code for bad bucket name errors
Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
% Done:
0%
Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Description
s3 test
def check_bad_bucket_name(name): e = assert_raises(boto.exception.S3ResponseError, s3.main.create_bucket, name) eq(e.status, 400) eq(e.reason, 'Bad Request') eq(e.error_code, 'InvalidBucketName') def test_bucket_create_naming_bad_starts_nonalpha(): check_bad_bucket_name('_alphasoup')
fails because rgw does not provide error_code (or any body) in the response:
$ S3TEST_CONF=tv.conf ./virtualenv/bin/nosetests test_s3:test_bucket_create_naming_bad_starts_nonalpha F ====================================================================== FAIL: test_s3.test_bucket_create_naming_bad_starts_nonalpha ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/tv/src/s3-tests.git/virtualenv/lib/python2.6/site-packages/nose/case.py", line 187, in runTest self.test(*self.arg) File "/home/tv/src/s3-tests.git/test_s3.py", line 246, in test_bucket_create_naming_bad_starts_nonalpha check_bad_bucket_name('_alphasoup') File "/home/tv/src/s3-tests.git/test_s3.py", line 237, in check_bad_bucket_name eq(e.error_code, 'InvalidBucketName') File "/home/tv/src/s3-tests.git/virtualenv/lib/python2.6/site-packages/nose/tools.py", line 31, in eq_ assert a == b, msg or "%r != %r" % (a, b) AssertionError: None != 'InvalidBucketName' -------------------- >> begin captured logging << -------------------- boto: DEBUG: path=/ boto: DEBUG: auth_path=/ boto: DEBUG: Canonical: GET Tue, 05 Apr 2011 00:05:58 GMT / boto: DEBUG: Method: GET boto: DEBUG: Path: / boto: DEBUG: Data: boto: DEBUG: Headers: {'Date': 'Tue, 05 Apr 2011 00:05:58 GMT', 'Content-Length': '0', 'Authorization': 'AWS TKKZ1DX83O7ZCTWHE0YD:0zR721JhyORnuoCq5atq6KgdwaI=', 'User-Agent': 'Boto/2.0b4 (linux2)'} boto: DEBUG: Host: localhost:7280 boto: DEBUG: establishing HTTP connection boto: DEBUG: path=/ boto: DEBUG: auth_path=/ boto: DEBUG: Canonical: GET Tue, 05 Apr 2011 00:05:58 GMT / boto: DEBUG: Method: GET boto: DEBUG: Path: / boto: DEBUG: Data: boto: DEBUG: Headers: {'Date': 'Tue, 05 Apr 2011 00:05:58 GMT', 'Content-Length': '0', 'Authorization': 'AWS O54XVCC9MQ9Q72TWP5Y1:okLeEzCDxd+VwYB5zMyA2AfVpGg=', 'User-Agent': 'Boto/2.0b4 (linux2)'} boto: DEBUG: Host: localhost:7280 boto: DEBUG: establishing HTTP connection boto: DEBUG: path=/_alphasoup/ boto: DEBUG: auth_path=/_alphasoup/ boto: DEBUG: Canonical: PUT Tue, 05 Apr 2011 00:05:58 GMT /_alphasoup/ boto: DEBUG: Method: PUT boto: DEBUG: Path: /_alphasoup/ boto: DEBUG: Data: boto: DEBUG: Headers: {'Date': 'Tue, 05 Apr 2011 00:05:58 GMT', 'Content-Length': '0', 'Authorization': 'AWS O54XVCC9MQ9Q72TWP5Y1:4PiClxBCbuIA0DjKyLorZPQUnoI=', 'User-Agent': 'Boto/2.0b4 (linux2)'} boto: DEBUG: Host: localhost:7280 --------------------- >> end captured logging << --------------------- ---------------------------------------------------------------------- Ran 1 test in 0.037s FAILED (failures=1)
Updated by Sage Weil about 13 years ago
- Translation missing: en.field_position set to 2
Updated by Colin McCabe about 13 years ago
An RGW error return for an illegal mkbucket:
send: 'PUT /_vroom_vroom/ HTTP/1.1\r\nHost: rgw-cmccabe.ceph.dreamhost.com\r\nAccept-Encoding: identity\r\nDate: Thu, 14 Apr 2011 18:26:45 GMT\r\nContent-Length: 0\r\nAuthorization: AWS EVMCGB47O71NZP9B25NQ:cb3l4vebXPN+GeDLAkvIxfNIPJg=\r\nUser-Agent: Boto/2.0b5 (linux2)\r\n\r\n' reply: 'HTTP/1.1 400 Bad Request\r\n' header: Date: Thu, 14 Apr 2011 18:26:49 GMT header: Server: Apache/2.2.16 (Debian) header: Connection: close header: Transfer-Encoding: chunked header: Content-Type: application/xml Traceback (most recent call last): File "./boto_tool.py", line 206, in <module> sys.exit(mkbucket(sys.argv[3:])) File "./boto_tool.py", line 62, in mkbucket bucket = conn.create_bucket(bucket_name) File "/usr/local/lib/python2.6/dist-packages/boto-2.0b5-py2.6.egg/boto/s3/connection.py", line 373, in create_bucket response.status, response.reason, body) boto.exception.S3ResponseError: S3ResponseError: 400 Bad Request
An Amazon return for an illegal mkbucket:
creating bucket 'a' ... send: 'PUT /a/ HTTP/1.1\r\nHost: s3.amazonaws.com\r\nAccept-Encoding: identity\r\nDate: Thu, 14 Apr 2011 18:30:49 GMT\r\nContent-Length: 0\r\nAuthorization: AWS AKIAIGR7ZNNBHC5BKSUA:MqbVu51LZnRYiUMd0vl1DxdJZv0=\r\nUser-Agent: Boto/2.0b5 (linux2)\r\n\r\n' reply: 'HTTP/1.1 400 Bad Request\r\n' header: x-amz-request-id: E150A5CA33F69796 header: x-amz-id-2: vB3+5Yrkp44oSYNYUf/r+M+H1p6q6JrxEZhbSL0ZTrZJyJDxPdWY3Li0ZcFRLYeu header: Content-Type: application/xml header: Transfer-Encoding: chunked header: Date: Thu, 14 Apr 2011 18:30:53 GMT header: Connection: close header: Server: AmazonS3 Traceback (most recent call last): File "./boto_tool.py", line 206, in <module> sys.exit(mkbucket(sys.argv[3:])) File "./boto_tool.py", line 62, in mkbucket bucket = conn.create_bucket(bucket_name) File "/usr/local/lib/python2.6/dist-packages/boto-2.0b5-py2.6.egg/boto/s3/connection.py", line 373, in create_bucket response.status, response.reason, body) boto.exception.S3ResponseError: S3ResponseError: 400 Bad Request <?xml version="1.0" encoding="UTF-8"?> <Error><Code>InvalidBucketName</Code><Message>The specified bucket is not valid.</Message><BucketName>a</BucketName><RequestId>E150A5CA33F69796</RequestId><HostId>vB3+5Yrkp44oSYNYUf/r+M+H1p6q6JrxEZhbSL0ZTrZJyJDxPdWY3Li0ZcFRLYeu</HostId></Error>So the differences I see are:
- RGW doesn't return any XML body
- Amazon returns an x-amz-request-id and x-amz-id-2 header
Updated by Colin McCabe about 13 years ago
- Status changed from New to Resolved
fixed by commit:b5f6eb12e1004888bf9dec6aa9c4b0499093ebfb
Updated by Sage Weil about 13 years ago
- Target version changed from v0.28 to v0.27
Updated by Sage Weil about 13 years ago
- Translation missing: en.field_story_points set to 0
- Translation missing: en.field_position deleted (
5) - Translation missing: en.field_position set to 3
Updated by John Spray over 6 years ago
- Project changed from Ceph to rgw
- Category deleted (
22) - Target version deleted (
v0.27)
Bulk reassign of radosgw category to RGW project.
Actions