You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by "marios@redhat.com" <ma...@redhat.com> on 2011/02/04 20:12:30 UTC
Issue with S3 API and creating buckets that already exist (and owned
by you)
Hi,
Michal reported an issue with the aws s3 (ec2) in teambox
https://teambox.com/projects/deltacloud:
"
I recently found that when you create a new bucket in EC2 and you use
name which is already taken by another bucket it will always return
'true' instead of throwing an exception. Seems like it's an another bug
in aws gem, because when I checked create_bucket in EC2 driver I got
true in every case.
As a workaround we could check if bucket exists and if so, we can throw
our BackendError.
"
I've spent the best part of today trying to debug this; in the end the
problem is neither our code nor the aws gem. The issue is with the S3
API. See https://forums.aws.amazon.com/thread.jspa?messageID=88947𕭳
Scenarios:
=1=
*Create a bucket that already exists, but you do not own:
===> you get an error from S3 (BucketAlreadyExists) since bucket names
are used as FQDNs (e.g. bucketname.s3.amazonaws.com)
=2=
*Create a bucket that already exists, that you do own AND you set a
location other than the default eu-east-1 (by including a
CreateBucketConfiguration and LocationConstraint elements in your
request body)
====> you get an error from S3 (BucketAlreadyOwnedByYou).
=3=
*Create a bucket that already exists, that you do own but don't specify
a location (so it gets put into eu-east-1)
====> no error, the bucket gets 're-created' which basically means its
'creation time' gets updated (but otherwise nothing else, your blobs
remain intact). THIS IS THE SCENARIO Michal was facing.
===============================
Since this is an issue with the provider API theres not much we can do.
There's no 'bucket_exists' call; the only solution i can see is to get a
list of all bucket names and check these for the bucket you are about to
create, but I don't know if thats acceptable?
marios