Skip to content

rgw: return proper error code and message when creating an existing bucket - #68722

Open
jzhu116-bloomberg wants to merge 4 commits into
ceph:mainfrom
jzhu116-bloomberg:wip-76398
Open

jzhu116-bloomberg wants to merge 4 commits into
ceph:mainfrom
jzhu116-bloomberg:wip-76398

Conversation

@jzhu116-bloomberg

@jzhu116-bloomberg jzhu116-bloomberg commented May 1, 2026 •

Copy link
Copy Markdown
Contributor

Make the behavior consistent with the following docs (except the reseting acl part for s3)

AWS s3: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html#API_CreateBucket_Errors

BucketAlreadyExists
The requested bucket name is not available. The bucket namespace is shared by all users of the system.
Select a different name and try again.

HTTP Status Code: 409

BucketAlreadyOwnedByYou
The bucket you tried to create already exists, and you own it. Amazon S3 returns this error in all AWS
Regions except in the North Virginia Region. For legacy compatibility, if you re-create an existing bucket
that you already own in the North Virginia Region, Amazon S3 returns 200 OK and resets the bucket access
control lists (ACLs).

HTTP Status Code: 409

Swift create container (PUT): https://docs.openstack.org/api-ref/object-store/#create-container

You do not need to check whether a container already exists before issuing a PUT operation because the
operation is idempotent: It creates a container or updates an existing container, as appropriate.

Fixes: https://tracker.ceph.com/issues/76398
Signed-off-by: Jane Zhu [email protected]

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

made changes on some existing s3 test cases to test the error code part of this PR: ceph/s3-tests#744

@ivancich

ivancich commented May 7, 2026

Copy link
Copy Markdown
Member

@jzhu116-bloomberg Is this ready for a review? If so, please add the needs-review labe.

@cbodley

cbodley commented May 7, 2026

Copy link
Copy Markdown
Contributor

cc @mattbenjamin since this relates to rgw_bucket_eexist_override

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

Gentle ping @mattbenjamin. Can you please take a look at this PR when you have a chance? Thanks!

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Config Diff Tool Output

! changed: rgw_bucket_eexist_override: old: Overrides the documented RGW behavior that treats multiple CreateBucket operations by the same owner as idempotent (rgw.yaml.in)
! changed: rgw_bucket_eexist_override: new: Overrides the documented RGW behavior that treats multiple CreateBucket operations by the same owner as idempotent. Applies to the S3 API only; Swift container PUT stays idempotent. (rgw.yaml.in)
! changed: rgw_bucket_eexist_override: old: CreateBucket on an existing bucket of the same owner returns 409/EEXIST, regardless of region. (rgw.yaml.in)
! changed: rgw_bucket_eexist_override: new: CreateBucket on an existing bucket of the same owner returns 409 BucketAlreadyOwnedByYou, regardless of region. (rgw.yaml.in)

The above configuration changes are found in the PR. Please update the relevant release documentation if necessary.
Ignore this comment if docs are already updated. To make the "Check ceph config changes" CI check pass, please comment /config check ok and re-run the test.

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

Some new changes have been committed:

  • combined s3-tests changed to this PR
  • some doc and config changes

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

/config check ok

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@anthonyeleven anthonyeleven left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

docs lgtm

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