Bug #75770
closedbucket replication returns duplicate ARN for destination bucket
0%
Description
The replication configuration of a bucket currently duplicates the ARN formatting for the destination bucket.
This makes it impossible to GET the configuration of a bucket and then PUT that same replication again, as the target ARN is technically invalid.
Checking the awscli examples for get-bucket-replication this does not seem to be bug-for-bug compatibility rather than a genuine bug.
For instance taking the following configuration:
{
"Role": "",
"Rules": [
{
"ID": "repl",
"Priority": 0,
"Status": "Enabled",
"Destination": {
"Bucket": "arn:aws:s3:::bucket.example.com"
}
}
]
}
When used via awscli's put-bucket-replication will yield the following upon being retrieved using get-bucket-replication:
{
"ReplicationConfiguration": {
"Role": "",
"Rules": [
{
"ID": "repl",
"Priority": 0,
"Status": "Enabled",
"Destination": {
"Bucket": "arn:aws:s3:::arn:aws:s3:::bucket.example.com"
}
}
]
}
}
While the ReplicationConfiguration "wrapper" is correct, the bucket ARN includes the arn:aws:s3::: prefix twice rendering it invalid.
LS Updated by Lumir Sliva 8 months ago
Working on a fix for this.
LS Updated by Lumir Sliva 8 months ago
Root cause:
Commit b8f89327e1a ("rgw: handle destination bucket as an ARN in ReplicationConfiguration") fixed the PUT path to parse the ARN and store only the bare bucket name, and changed the GET path to reconstruct the ARN via `ARN.to_string()`. However, data written by older releases (e.g. squid) stored the full ARN string (`arn:aws:s3:::bucket`) as the bucket name in the sync policy. When the GET path wraps this in another ARN it produces `arn:aws:s3:::arn:aws:s3:::bucket`.
How to reproduce:
1. On a squid (or older) cluster, set up a realm with endpoints and a zonegroup-level sync group so the S3 Replication API is enabled.
2. Create two buckets, enable versioning on the source, and call PutBucketReplication with destination `arn:aws:s3:::dest-bucket`.
3. Verify the sync policy stores the full ARN as the bucket name: `radosgw-admin metadata get bucket.instance:<source>:<id>` shows `dest.bucket = "arn:aws:s3:::dest-bucket"` in the sync_policy.
4. Upgrade to tentacle/main (which includes b8f89327e1a).
5. Call GetBucketReplication — the destination bucket ARN is now `arn:aws:s3:::arn:aws:s3:::dest-bucket`.
Fix: In `from_sync_policy_pipe`, check if the stored bucket name is already a valid S3 ARN before wrapping it in another one.
CB Updated by Casey Bodley 8 months ago
- Status changed from New to Fix Under Review
- Backport set to squid tentacle
- Regression changed from No to Yes
- Pull request ID set to 68137
CB Updated by Casey Bodley 8 months ago
- Blocks Backport #70268: squid: handle destination bucket as an ARN in ReplicationConfiguration added
JI Updated by J. Eric Ivancich 8 months ago
- Assignee set to Lumir Sliva
CB Updated by Casey Bodley 7 months ago
- Status changed from Fix Under Review to Pending Backport
UB Updated by Upkeep Bot 7 months ago
- Merge Commit set to a7304789d5efe34855e114313c80362d855f04b6
- Fixed In set to v21.0.0-1557-ga7304789d5
- Upkeep Timestamp set to 2026-05-19T13:39:16+00:00
UB Updated by Upkeep Bot 7 months ago
- Copied to Backport #76702: tentacle: bucket replication returns duplicate ARN for destination bucket added
UB Updated by Upkeep Bot 7 months ago
- Copied to Backport #76703: squid: bucket replication returns duplicate ARN for destination bucket added
UB Updated by Upkeep Bot 7 months ago
- Tags (freeform) set to backport_processed
UB Updated by Upkeep Bot 3 months ago
- Status changed from Pending Backport to Resolved
- Tags (freeform) deleted (
backport_processed) - Upkeep Timestamp changed from 2026-05-19T13:39:16+00:00 to 2026-08-27T18:32:37+00:00
UB Updated by Upkeep Bot about 1 month ago
- Released In set to v21.2.0~427
- Upkeep Timestamp changed from 2026-08-27T18:32:37+00:00 to 2026-10-24T01:49:50+00:00