Skip to content

rgw/multisite: fix user admin api actions like create/remove keys from secondary zone - #64490

Open
smanjara wants to merge 3 commits into
ceph:mainfrom
smanjara:wip-fix-user-api-multisite
Open

smanjara wants to merge 3 commits into
ceph:mainfrom
smanjara:wip-fix-user-api-multisite

Conversation

@smanjara

@smanjara smanjara commented Jul 14, 2025 •

Copy link
Copy Markdown
Contributor

fixes https://tracker.ceph.com/issues/70570

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

@smanjara
smanjara requested a review from a team as a code owner July 14, 2025 21:39
@smanjara smanjara changed the title rgw/multisite: fix user admin api actions like create/remove from secondary zone rgw/multisite: fix user admin api actions like create/remove keys from secondary zone Jul 14, 2025
Comment thread src/rgw/driver/rados/rgw_rest_user.cc Resolved
@cbodley

cbodley commented Jul 17, 2025

Copy link
Copy Markdown
Contributor

@smanjara
smanjara force-pushed the wip-fix-user-api-multisite branch from 32b88f7 to 4b027b6 Compare July 30, 2025 23:22
@smanjara

Copy link
Copy Markdown
Contributor Author

@cbodley the pr now handles forwarding of request to master along with changing RGWOp_Key_Create's response. I have added a line to document the change in PendingReleaseNotes. can you please review? thanks!

@smanjara

smanjara commented Jul 31, 2025 •

Copy link
Copy Markdown
Contributor Author

the response from PUT key&uid= now looks like this instead of listing all the keys present:

{
"user": "admin",
"access_key": "QCAKT41JU7N9E04NM6SC",
"secret_key": "SfhzMdelzv0o1B1HjNHSRdI0ZAXvKAjttEI3faPa",
"active": true,
"create_date": "2025-07-31T00:37:23.681750Z"
}

but a GET user request can still show all the keys along with their timestamps:

"keys": [
{
"user": "admin",
"access_key": "4NE7U1WS0FC3APXP4XER",
"secret_key": "Z8AfiYDAbLwFmKZlRw3ZmCnaGvO1VYdX2tAXvZab",
"active": true,
"create_date": "2025-07-31T00:18:39.654983Z"
},
{
"user": "admin",
"access_key": "QCAKT41JU7N9E04NM6SC",
"secret_key": "SfhzMdelzv0o1B1HjNHSRdI0ZAXvKAjttEI3faPa",
"active": true,
"create_date": "2025-07-31T00:37:23.681750Z"
}
],

@cbodley

cbodley commented Jul 31, 2025

Copy link
Copy Markdown
Contributor

the api test failure looks potentially related? the dashboard may be relying on the current format

2025-07-31T00:42:03.374+0000 7f619112b640  0 log_channel(audit) log [DBG] : from='client.24247 -' entity='client.admin' cmd=[{"prefix": "dashboard set-rgw-api-secret-key", "target": ["mon-mgr", ""]}]: dispatch
2025-07-31T00:42:04.350+0000 7f619112b640  0 log_channel(audit) log [DBG] : from='client.24180 -' entity='client.admin' cmd=[{"prefix": "dashboard set-rgw-api-access-key", "target": ["mon-mgr", ""]}]: dispatch
2025-07-31T00:42:04.554+0000 7f6164fd3640  0 [dashboard INFO rgw_client] Found RGW daemon with configuration: host=172.21.3.227, port=8000, ssl=False
2025-07-31T00:42:04.570+0000 7f6164fd3640  0 [dashboard ERROR rest_client] RGW REST API failed GET req status: 403
2025-07-31T00:42:04.570+0000 7f6164fd3640  0 [dashboard ERROR rgw_client] RGW REST API failed request with status code 403
(b'{"Code":"AccessDenied","Message":"","RequestId":"tx00000499d9d106ef02a60-006'
 b'88abbdc-4556-default","HostId":"4556-default-default"}')
Traceback (most recent call last):
  File "/home/jenkins-build/build/workspace/ceph-api/src/pybind/mgr/dashboard/services/rgw_client.py", line 402, in __init__
    self.userid = self._get_user_id(self.admin_path) if self.got_keys_from_config \
  File "/home/jenkins-build/build/workspace/ceph-api/src/pybind/mgr/dashboard/rest_client.py", line 538, in func_wrapper
    return func(
  File "/home/jenkins-build/build/workspace/ceph-api/src/pybind/mgr/dashboard/services/rgw_client.py", line 437, in _get_user_id
    response = request()
  File "/home/jenkins-build/build/workspace/ceph-api/src/pybind/mgr/dashboard/rest_client.py", line 324, in __call__
    resp = self.rest_client.do_request(method, self._gen_path(), params,
  File "/home/jenkins-build/build/workspace/ceph-api/src/pybind/mgr/dashboard/rest_client.py", line 422, in do_request
    raise RequestException(
dashboard.rest_client.RequestException: RGW REST API failed request with status code 403
(b'{"Code":"AccessDenied","Message":"","RequestId":"tx00000499d9d106ef02a60-006'
 b'88abbdc-4556-default","HostId":"4556-default-default"}')

Comment thread src/rgw/driver/rados/rgw_rest_user.cc Resolved
Comment on lines +18 to +20
- radosgw-admin-rest:
admin-client: c1.client.0 # create user on master zone
rest-client: c2.client.0 # send admin api requests to secondary zone

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.

very cool idea 👍 but does qa/tasks/radosgw_admin_rest.py support those options?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oops this shouldn't be here. i was trying to add these options in the radosgw_admin_rest.py task but its still incomplete.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added support to radosgw-admin-rest.py. will have to run it through teuthology to see if it works.

Comment thread src/rgw/rgw_common.h Resolved
@smanjara
smanjara force-pushed the wip-fix-user-api-multisite branch 3 times, most recently from 1250d43 to f1f5503 Compare August 13, 2025 20:13
@smanjara

Copy link
Copy Markdown
Contributor Author

@smanjara

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@github-actions

Copy link
Copy Markdown

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

@adamemerson

Copy link
Copy Markdown
Contributor

@smanjara Is this still in progress? If you'll rebase it we can run it through another QA round.

@smanjara

Copy link
Copy Markdown
Contributor Author

@smanjara Is this still in progress? If you'll rebase it we can run it through another QA round.

hi @adamemerson, the pr is ready, but I was trying to add support to be able to run the admin api test suite on the secondary zone to test this pr, because our current admin_api suite, which runs only on primary zone, won't be sufficient to validate. i'll soon give it another shot. thanks for asking!

@smanjara
smanjara force-pushed the wip-fix-user-api-multisite branch from 365f879 to bf8e16d Compare October 23, 2025 22:23
Shilpa Jagannath added 3 commits October 23, 2025 18:32
…created key

and store it on secondary. also, include 'create_date' in the user info response to
help identify timestamp of each key.

Signed-off-by: Shilpa Jagannath <[email protected]>
depending on primary zone's version.
decode primary's response only when generate-key is true.

Signed-off-by: Shilpa Jagannath <[email protected]>
Signed-off-by: Shilpa Jagannath <[email protected]>
@smanjara
smanjara force-pushed the wip-fix-user-api-multisite branch from bf8e16d to 3490763 Compare October 23, 2025 22:34
@smanjara

Copy link
Copy Markdown
Contributor Author

@thotz added 3490763 to fix swift keys.
@cbodley removed the testing changes so that I can get the existing suite pass without regressions first.

@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 added the stale label Dec 23, 2025
@github-actions

Copy link
Copy Markdown

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@github-actions github-actions Bot closed this Jan 22, 2026
@smanjara smanjara reopened this Mar 26, 2026
@github-actions github-actions Bot removed the stale label Mar 26, 2026
@adamemerson adamemerson added the pinned Use this label if you want to exempt a PR from being stalled label Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation pinned Use this label if you want to exempt a PR from being stalled rgw tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants