facebookarchive / rocks-strata

Other
133 stars 24 forks source link

Failed to use an existing s3 bucket for backup #38

Open zenhao opened 6 years ago

zenhao commented 6 years ago

I get this error message when I am trying to use an existing bucket with strata.

"Your previous request to create the named bucket succeeded and you already own it." I think this is caused by BucketAlreadyOwnedByYou error. (more)

Is there a flag I can use to avoid this behavior: always try to create a new bucket?

// New creates a new S3.
func New(auth aws.Auth, region aws.Region) *S3 {
    return &S3{auth, region, 0, 0, aws.V2Signature, 0}
}

// Bucket returns a Bucket with the given name.
func (s3 *S3) Bucket(name string) *Bucket {
    if s3.Region.S3BucketEndpoint != "" || s3.Region.S3LowercaseBucket {
        name = strings.ToLower(name)
    }
    return &Bucket{s3, name}
}

Seems like New will always create a bucket. Also can we support aws.V4Signature as well somehow?

Thanks

zenhao commented 6 years ago

I resolved this by providing aws region. Is there a way to support aws.V4Signature? some EU regions only support v4.

cross posted: https://github.com/AdRoll/goamz/issues/441