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(postgres): block invalid S3 bucket name #182

Closed
wants to merge 1 commit into from

Conversation

greglearns
Copy link

Using a period in an S3 BUCKET_NAME causes helm install -f values.yaml deis/workflow --namespace=deis to fail.

REPRODUCING THE BUG

Using a period in BUCKET_NAME causes helm install -f values.yaml deis/workflow --namespace=deis to fail with this error:

ssl.CertificateError: hostname 'deis.subdomain.domain.com-registry.s3-us-west-2.amazonaws.com' doesn't match either of 's3-us-west-2.amazonaws.com', '*.s3-us-west-2.amazonaws.com', 's3.us-west-2.amazonaws.com', '*.s3.us-west-2.amazonaws.com', 's3.dualstack.us-west-2.amazonaws.com', '*.s3.dualstack.us-west-2.amazonaws.com', '*.s3.amazonaws.com'
2017/01/14 07:20:04 Error creating the registry bucket: exit status 1

A POSSIBLE FIX

Not sure how to create a test for this (I just started using Deis 4 days ago), but, a hacky test is this:

echo "a.bad.thing-mixed-with-a-good-thing" | sed "s/[.]/-/g"

RELATED ISSUES

deis/workflow#700
deis/workflow#701 (documentation fix)

Note: this bug also exists for https://github.com/deis/registry/blob/master/rootfs/bin/create-bucket#L27

Using a period in an S3 BUCKET_NAME causes `helm install -f values.yaml deis/workflow --namespace=deis` to fail.

REPRODUCING THE BUG

Using a period in BUCKET_NAME causes `helm install -f values.yaml deis/workflow --namespace=deis` to fail with this error:
```
ssl.CertificateError: hostname 'deis.subdomain.domain.com-registry.s3-us-west-2.amazonaws.com' doesn't match either of 's3-us-west-2.amazonaws.com', '*.s3-us-west-2.amazonaws.com', 's3.us-west-2.amazonaws.com', '*.s3.us-west-2.amazonaws.com', 's3.dualstack.us-west-2.amazonaws.com', '*.s3.dualstack.us-west-2.amazonaws.com', '*.s3.amazonaws.com'
2017/01/14 07:20:04 Error creating the registry bucket: exit status 1
```

A POSSIBLE FIX

Not sure how to create a test for this (I just started using Deis 4 days ago), but, a hacky test is this:
```
echo "a.bad.thing-mixed-with-a-good-thing" | sed "s/[.]/-/g"
```

RELATED ISSUES

deis/workflow#700
deis/workflow#701 (documentation fix)

Note: this bug also exists for https://github.com/deis/registry/blob/master/rootfs/bin/create-bucket#L27
@deis-admin
Copy link

Thanks for the contribution! Please ensure your commits follow our style guide. This code will be tested once a Deis maintainer reviews it.

@deis-bot
Copy link

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

@bacongobbler
Copy link
Member

This doesn't block invalid S3 bucket names, just substitutes periods for hyphens. Personally I'd prefer we keep the bucket name explicit and point out the S3 issue in the docs with deis/workflow#701. There may be some edge case where a user has worked around this and somehow has periods working.

What do you think?

@greglearns
Copy link
Author

Agreed, that perhaps people have a work around that solves it. This PR solves one possible mistake, but not all. The issue still remains that a valid S3 name can still cause problems because of how Deis uses it, which is a bummer. Not sure how to solve that.

@bacongobbler
Copy link
Member

bacongobbler commented Jan 25, 2017

I think the documentation should be more than enough for now. I don't think we should prevent users from using dots as it's an issue on S3's end which hopefully will get fixed. Until then the documentation should suffice, I think :)

Thanks for the PR!

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.

4 participants