Bug 1620734 - [rgw] Not able to create s3 bucket with s3website enabled
Summary: [rgw] Not able to create s3 bucket with s3website enabled
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat
Component: RGW
Version: 3.1
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: z1
: 3.1
Assignee: Matt Benjamin (redhat)
QA Contact: Shreekar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-23 10:53 UTC by Shreekar
Modified: 2018-08-30 15:44 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-08-30 09:43:48 UTC
Target Upstream Version:


Attachments (Terms of Use)
rgw log (2.07 MB, application/x-gzip)
2018-08-23 10:53 UTC, Shreekar
no flags Details

Description Shreekar 2018-08-23 10:53:56 UTC
Created attachment 1478132 [details]
rgw log

Description of problem:
Not able to create s3 bucket with s3website enabled 

ceph.conf:
[client.rgw.magna064]
host = magna064
keyring = /var/lib/ceph/radosgw/ceph-rgw.magna064/keyring
log file = /var/log/ceph/ceph-rgw-magna064.log
rgw frontends = civetweb port=10.8.128.64:8080 num_threads=100
rgw_enable_static_website = true
rgw_enable_apis = s3, swift, s3website
rgw dns s3website name = website.magna064.ceph.redhat.com
rgw_dns_name = magna064.ceph.redhat.com
rgw_resolve_cname = true
debug_rgw = 20

----------------------
/etc/hosts
10.8.128.64 magna064.ceph.redhat.com magna064
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.8.128.64 website.magna064.ceph.redhat.com
----------------------
=====================
boto script with aws2:
---
access_key = 'JA681ZXDB6HPKD9FEH3X'
secret_key = 'PUw1vVjuDKZgkMcYGJ8ziNvVuhEaVmf8TuewKTix'
#boto.config.add_section('s3')
#boto.config.set('s3', 'use-sigv4', 'True')

conn = boto.connect_s3(
    aws_access_key_id=access_key,
    aws_secret_access_key=secret_key,
    host='magna064',
    port=8080,
    is_secure=False,  # uncomment if you are not using ssl

    calling_format=boto.s3.connection.OrdinaryCallingFormat(),
)
#conn.auth_region_name = 'default'


website_bucket = conn.create_bucket("website")
----
[root@magna064 ~]# python s3website.py 
Traceback (most recent call last):
  File "s3website.py", line 22, in <module>
    website_bucket = conn.create_bucket("website")
  File "/usr/lib/python2.7/site-packages/boto/s3/connection.py", line 628, in create_bucket
    response.status, response.reason, body)
boto.exception.S3ResponseError: S3ResponseError: 403 Forbidden
<?xml version="1.0" encoding="UTF-8"?><Error><Code>SignatureDoesNotMatch</Code><RequestId>tx000000000000000000002-005b7e7f64-1087-default</RequestId><HostId>1087-default-default</HostId></Error>
==========================
boto script with aws4:
---
access_key = 'JA681ZXDB6HPKD9FEH3X'
secret_key = 'PUw1vVjuDKZgkMcYGJ8ziNvVuhEaVmf8TuewKTix'
boto.config.add_section('s3')
boto.config.set('s3', 'use-sigv4', 'True')

conn = boto.connect_s3(
    aws_access_key_id=access_key,
    aws_secret_access_key=secret_key,
    host='magna064',
    port=8080,
    is_secure=False,  # uncomment if you are not using ssl

    calling_format=boto.s3.connection.OrdinaryCallingFormat(),
)
conn.auth_region_name = 'default'


website_bucket = conn.create_bucket("website")
---

[root@magna064 ~]# python s3website.py 
Traceback (most recent call last):
  File "s3website.py", line 22, in <module>
    website_bucket = conn.create_bucket("website")
  File "/usr/lib/python2.7/site-packages/boto/s3/connection.py", line 628, in create_bucket
    response.status, response.reason, body)
boto.exception.S3ResponseError: S3ResponseError: 404 Not Found
<?xml version="1.0" encoding="UTF-8"?><Error><Code>NoSuchBucket</Code><BucketName>magna064</BucketName><RequestId>tx000000000000000000001-005b7e7f3a-1087-default</RequestId><HostId>1087-default-default</HostId></Error>
===============================

Version-Release number of selected component (if applicable):

ceph-ansible-3.1.0-0.1.rc21.el7cp.noarch

ceph version 12.2.5-39.el7cp (f12d44e46a54948a86dd27b16c77d97475ba2d4e) luminous (stable)

How reproducible:
Always

Steps to Reproduce:
1.Setup a ceph cluster with rgw. Add 
rgw_enable_static_website = true
rgw_enable_apis = s3, swift, s3website
rgw dns s3website name = s3website.magna064.ceph.redhat.com
rgw_dns_name = magna064.ceph.redhat.com
rgw_resolve_cname = true in ceph.conf, restart the rgw service
Make entries in /etc/hosts:
10.8.128.64 website.magna064.ceph.redhat.com

2. Create rgw user, try to create bucket with s3website using boto2


Actual results:

Not able to create the bucket 
----
boto.exception.S3ResponseError: S3ResponseError: 404 Not Found
<?xml version="1.0" encoding="UTF-8"?><Error><Code>NoSuchBucket</Code><BucketName>magna064</BucketName><RequestId>tx000000000000000000001-005b7e7f3a-1087-default</RequestId><HostId>1087-default-default</HostId></Error>
----
Expected results:

Bucket should get created

Additional info:

Comment 12 Shreekar 2018-08-30 09:43:48 UTC
Using doc https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/3/html-single/object_gateway_guide_for_red_hat_enterprise_linux/#setting_up_the_gateway, was causing the problem which is mentioned in comments 14,15.
'rgw_enable_apis = s3website' was causing the problem, where RGW with s3website enabled , was not able to create the bucket because 's3' api was enabled.

'rgw_enable_apis = s3,s3website' --> is the solution for this problem of not able to create s3webiste bucket. Doc needs to be corrected

Comment 13 Shreekar 2018-08-30 09:44:41 UTC
Using doc https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/3/html-single/object_gateway_guide_for_red_hat_enterprise_linux/#setting_up_the_gateway, was causing the problem which is mentioned in comments 14,15 of bz https://bugzilla.redhat.com/show_bug.cgi?id=1505400
'rgw_enable_apis = s3website' was causing the problem, where RGW with s3website enabled , was not able to create the bucket because 's3' api was enabled.

'rgw_enable_apis = s3,s3website' --> is the solution for this problem of not able to create s3webiste bucket. Doc needs to be corrected


Note You need to log in before you can comment on or make changes to this bug.