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

rgw/sfs: specifying a region triggers location constraint errors #848

Closed
jecluis opened this issue Nov 28, 2023 · 2 comments · Fixed by aquarist-labs/ceph#261
Closed

rgw/sfs: specifying a region triggers location constraint errors #848

jecluis opened this issue Nov 28, 2023 · 2 comments · Fixed by aquarist-labs/ceph#261
Labels
area/rgw-sfs RGW & SFS related kind/enhancement Change that positively impacts existing code priority/1 Should be fixed for next release severity/normal Regular issue, some non-major loss of functionality under specific circumstances
Milestone

Comments

@jecluis
Copy link
Contributor

jecluis commented Nov 28, 2023

We've had reports that users require specifying --rgw-relaxed-region-enforcement to be able to create buckets.

I suspect this happens when the user specifies a region where to create said bucket.

During RGWCreateBucket::execute() we hit a series of checks for whether a location_constraint is set, and, if so, it relies on the SAL driver to assess whether said location_constraint is valid. Given we have only stubbed zone/zonegroup APIs, we are likely hitting this issue by returning false on has_zonegroup_api() or a similar function.

This can potentially be addressed by assuming that whatever region the user specifies is valid, given we don't particularly care about whether a region is set or not.

@jecluis jecluis added kind/enhancement Change that positively impacts existing code priority/1 Should be fixed for next release area/rgw-sfs RGW & SFS related severity/normal Regular issue, some non-major loss of functionality under specific circumstances labels Nov 28, 2023
@jecluis jecluis added this to the v0.24.0 milestone Nov 28, 2023
@jecluis jecluis added this to S3GW Nov 28, 2023
@github-project-automation github-project-automation bot moved this to Backlog in S3GW Nov 28, 2023
@github-actions github-actions bot added the triage/waiting Waiting for triage label Nov 28, 2023
@jecluis
Copy link
Contributor Author

jecluis commented Nov 29, 2023

Couldn't reproduce this with boto3, but managed to do it with the rust sdk.

For a request like this:

url: http://127.0.0.1:7480/foobar-a4cpf/
method: PUT
header content-type: application/xml
header content-length: 154
header user-agent: aws-sdk-rust/1.0.1 os/linux lang/rust/1.74.0-nightly
header x-amz-user-agent: aws-sdk-rust/1.0.1 api/s3/1.4.0 os/linux lang/rust/1.74.0-nightly
body len: 154
body:
<CreateBucketConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><LocationConstraint>af-south-1</LocationConstraint></CreateBucketConfiguration>
---- 8< ----
Error: service error

We get rgw complaining about a location constraint not being met:

2023-11-29T08:37:19.135+0000 7f0ecda356c0  2 req 0 0.004000047s s3:create_bucket normalizing buckets and tenants               
2023-11-29T08:37:19.135+0000 7f0ecda356c0 10 req 0 0.004000047s s->object=<NULL> s->bucket=foobar-a4cpf                        
2023-11-29T08:37:19.135+0000 7f0ecda356c0  2 req 0 0.004000047s s3:create_bucket init permissions                              2023-11-29T08:37:19.135+0000 7f0ecda356c0  2 req 0 0.004000047s s3:create_bucket recalculating target                          
2023-11-29T08:37:19.135+0000 7f0ecda356c0  2 req 0 0.004000047s s3:create_bucket reading permissions                           2023-11-29T08:37:19.135+0000 7f0ecda356c0  2 req 0 0.004000047s s3:create_bucket init op                                       
2023-11-29T08:37:19.135+0000 7f0ecda356c0  2 req 0 0.004000047s s3:create_bucket verifying op mask                             
2023-11-29T08:37:19.135+0000 7f0ecda356c0  2 req 0 0.004000047s s3:create_bucket verifying op permissions                      2023-11-29T08:37:19.139+0000 7f0ecda356c0  2 req 0 0.008000094s s3:create_bucket verifying op params                           
2023-11-29T08:37:19.139+0000 7f0ecda356c0  2 req 0 0.008000094s s3:create_bucket pre-executing                                 2023-11-29T08:37:19.139+0000 7f0ecda356c0  2 req 0 0.008000094s s3:create_bucket check rate limiting                           
2023-11-29T08:37:19.139+0000 7f0ecda356c0  2 req 0 0.008000094s s3:create_bucket executing                                     
2023-11-29T08:37:19.139+0000 7f0ecda356c0  5 req 0 0.008000094s s3:create_bucket NOTICE: call to do_aws4_auth_completion       
2023-11-29T08:37:19.139+0000 7f0ecda356c0 10 req 0 0.008000094s s3:create_bucket v4 auth ok -- do_aws4_auth_completion         
2023-11-29T08:37:19.139+0000 7f0ecda356c0 10 req 0 0.008000094s s3:create_bucket create bucket location constraint: af-south-1 
2023-11-29T08:37:19.139+0000 7f0ecda356c0  0 req 0 0.008000094s s3:create_bucket location constraint (af-south-1) can't be foun
d.
2023-11-29T08:37:19.139+0000 7f0ecda356c0  2 req 0 0.008000094s s3:create_bucket completing
2023-11-29T08:37:19.139+0000 7f0ecda356c0  2 req 0 0.008000094s s3:create_bucket op status=-2208
2023-11-29T08:37:19.139+0000 7f0ecda356c0  2 req 0 0.008000094s s3:create_bucket http status=400
2023-11-29T08:37:19.139+0000 7f0ecda356c0  1 ====== req done req=0x7f0fbe704448 op status=-2208 http_status=400 latency=0.00800
0094s ======

@jecluis jecluis removed the triage/waiting Waiting for triage label Nov 29, 2023
@jecluis
Copy link
Contributor Author

jecluis commented Nov 29, 2023

turns out it's reproducible with boto3 (need to specify the CreateBucketConfiguration parameter), as well as with the aws tool:

aws --region "foobar" --endpoint-url http://127.0.0.1:7480 s3api create-bucket --bucket bucketb --create-bucket-configuration "LocationConstraint=af-south-1"

An error occurred (InvalidLocationConstraint) when calling the CreateBucket operation: The specified location-constraint is not valid

jecluis referenced this issue in jecluis/ceph Nov 29, 2023
We don't deal with zones, all zones are welcome zones. So, when someone
wants to store something on a given location, welcome them by allowing
all zones.

Fixes: aquarist-labs/s3gw#848

Signed-off-by: Joao Eduardo Luis <joao@suse.com>
@github-project-automation github-project-automation bot moved this from Backlog to Done in S3GW Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rgw-sfs RGW & SFS related kind/enhancement Change that positively impacts existing code priority/1 Should be fixed for next release severity/normal Regular issue, some non-major loss of functionality under specific circumstances
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant