Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buckets created with boto cannot be listed #61

Open
mmgaggle opened this issue Jun 21, 2018 · 1 comment
Open

Buckets created with boto cannot be listed #61

mmgaggle opened this issue Jun 21, 2018 · 1 comment

Comments

@mmgaggle
Copy link
Member

mmgaggle commented Jun 21, 2018

example.py

#!/usr/bin/env python

access_key = 'xxx' # Add your S3 Access Key here
secret_key = 'xxx' # Add your S3 Secret Key here
bucket_name = "foobar"

ceph_host = '192.168.7.27' # Add your rgw0 Ceph host here
ceph_port = 8000

import boto
import boto.s3.connection

conn = boto.connect_s3(
        aws_access_key_id = access_key,
        aws_secret_access_key = secret_key,
        host = ceph_host,
        port = ceph_port,
        is_secure=False,
        calling_format = boto.s3.connection.OrdinaryCallingFormat()
        )

bucket = conn.create_bucket("broken")

print "Bucket {} created!".format("broken")

from boto.s3.key import Key

object_key = "spark-test"
object_value = "./foo"

bucket = conn.get_bucket("broken")

k = Key(bucket)
k.key = object_key
k.set_contents_from_filename(object_value)

print "Object {} added in bucket {}!".format(object_key, "broken")

This doesn't work -

kyle@kyle-mini ~ $ > ./cn s3 ls my-first-cluster s3://broken
ERROR: S3 error: 403 (SignatureDoesNotMatch)

This does work -

kyle@kyle-mini ~ $ > ./cn s3 la my-first-cluster
2018-06-21 15:52         4   s3://broken/spark-test

Using the Sree web interface, I get a "Failed to list objects: Network Failure" error for this bucket.

@mmgaggle
Copy link
Member Author

mmgaggle commented Jun 21, 2018

You can "fix" this by enabling CORS on the bucket created with boto. Perhaps when you use the web interface it does this automatically when it creates the bucket. Is this expected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant