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

handle GetBucketWebsite <NotImplemented> errors gracefully #3620

Closed
wants to merge 4 commits into from

Conversation

tlawrence
Copy link

Fixes #3603

@ghost ghost added the size/S Managed by automation to categorize the size of a PR. label Mar 5, 2018
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/s3 Issues and PRs that pertain to the s3 service. labels Mar 6, 2018
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. and removed size/S Managed by automation to categorize the size of a PR. labels Mar 8, 2018
Daniel Grant and others added 2 commits March 14, 2018 17:16
Added handler for 'NoSuchWebsiteConfiguration' error for S3 endpoints…
@tlawrence
Copy link
Author

This PR broke creation of native AWS S3 buckets. commit a900f5f resolves this.
We have now tested against both S3 & non-S3 endpoints.

return err
}
log.Printf("[WARN] S3 bucket: %s, website configuration not supported by storage server.", d.Id())
return nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Returning here will prevent the rest of the Read function from working (versioning, acceleration, request payer, logging, lifecycle rules, etc.)

Copy link
Author

Choose a reason for hiding this comment

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

should it be err := nil instead?
Sorry, Go n00b :-)

Copy link
Contributor

Choose a reason for hiding this comment

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

The line shouldn't be present at all 😄

Copy link
Author

Choose a reason for hiding this comment

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

surely if we remove it all together then the error object will be passed back and cause an exception?

Copy link
Contributor

Choose a reason for hiding this comment

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

What error are you seeing? I briefly looked at the code below this and it seemed fine.

Copy link
Author

Choose a reason for hiding this comment

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

Oops, I thought I was returning from the 'if' rather than the function.
I think rather than this I probably need to reset the error object to nil to prevent it being caught later on.

so rather than return nil
we should have err = nil

Is that correct?

Copy link
Contributor

Choose a reason for hiding this comment

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

You could do that, but its unnecessary. The line does not need to be there at all. The function will continue just fine since line 721 already does the right thing and err is overwritten at line 774.

@ghost
Copy link

ghost commented Apr 3, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/s3 Issues and PRs that pertain to the s3 service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CreateBucket fails on non-aws endpoint due to non implemented feature
2 participants