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

fix(create_bucket): try default s3 region on create error #176

Merged
merged 2 commits into from
Dec 5, 2016

Conversation

bacongobbler
Copy link
Member

continuation of #175. If we fail to create the bucket in the specified region, it means the user has created the bucket in us-east-1 (see #173). We can then assume that we want wal-e to connect to said bucket in us-east-1. I've added a note that we'll want to remove this code once we drop support for v2.8.0 and earlier versions.

closes #173
closes #175

@deis-bot
Copy link

deis-bot commented Dec 2, 2016

@kmala and @paulczar are potential reviewers of this pull request based on my analysis of git blame information. Thanks @bacongobbler!

@mboersma
Copy link
Member

mboersma commented Dec 2, 2016

Nice! I'll test now. You can squash or remove the first commit to clean it up--this is much simpler.

@bacongobbler
Copy link
Member Author

I figured I'd keep your commit in there for credit :) I shall do so now.

@bacongobbler
Copy link
Member Author

bacongobbler commented Dec 2, 2016

fwiw I just manually tested this on an upgrade from v2.8.0 to v2.9.0 + this image and it seems to be working for me.

@mboersma
Copy link
Member

mboersma commented Dec 2, 2016

I also tested on a broken upgraded S3 cluster and this seems to do the trick. Wal-e found its backup and everything recovered (after flapping for two hours with my previous attempt at fixing this).

@mboersma mboersma added the LGTM1 label Dec 2, 2016
if region != 'us-east-1':
print('Failed to create bucket in {}. We are now assuming that the bucket was created in us-east-1.'.format(region))
with open(os.path.join(os.environ['WALE_ENVDIR'], "WALE_S3_ENDPOINT"), "w+") as file:
file.write('https+path://s3.amazonaws.com:443')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should re raise the error if the region is us-east-1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point.

@bacongobbler
Copy link
Member Author

I'm going to go ahead and merge this as two of us have manually tested these changes and everything works as intended. CI's breaking due to unrelated changes.

@bacongobbler bacongobbler merged commit 1ef7a37 into deis:master Dec 5, 2016
@bacongobbler bacongobbler deleted the fixup-bucket-create branch December 5, 2016 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

upgrading from v2.8.0 to v2.9.0 on S3 causes BucketAlreadyOwnedByYou error
5 participants