Project

General

Profile

Actions

Bug #75770

closed
BK LS

bucket replication returns duplicate ARN for destination bucket

Bug #75770: bucket replication returns duplicate ARN for destination bucket

Added by benaryorg Katze 8 months ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
Due date:
% Done:

0%

Source:
Community (user)
Backport:
squid tentacle
Regression:
Yes
Severity:
4 - irritation
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Fixed In:
v21.0.0-1557-ga7304789d5
Released In:
v21.2.0~427
Upkeep Timestamp:
2026-10-24T01:49:50+00:00

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.


Related issues 3 (1 open — 2 closed)

Blocks rgw - Backport #70268: squid: handle destination bucket as an ARN in ReplicationConfigurationNew

Actions
Copied to rgw - Backport #76702: tentacle: bucket replication returns duplicate ARN for destination bucketResolvedLumir Sliva

Actions
Copied to rgw - Backport #76703: squid: bucket replication returns duplicate ARN for destination bucketRejectedLumir Sliva

Actions

LS Updated by Lumir Sliva 8 months ago Actions #1

Working on a fix for this.

LS Updated by Lumir Sliva 8 months ago Actions #2

PR: https://github.com/ceph/ceph/pull/68137

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 Actions #3

  • 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 Actions #4

  • Blocks Backport #70268: squid: handle destination bucket as an ARN in ReplicationConfiguration added

JI Updated by J. Eric Ivancich 8 months ago Actions #5

  • Assignee set to Lumir Sliva

CB Updated by Casey Bodley 7 months ago Actions #6

  • Status changed from Fix Under Review to Pending Backport

UB Updated by Upkeep Bot 7 months ago Actions #7

  • 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 Actions #8

  • Copied to Backport #76702: tentacle: bucket replication returns duplicate ARN for destination bucket added

UB Updated by Upkeep Bot 7 months ago Actions #9

  • Copied to Backport #76703: squid: bucket replication returns duplicate ARN for destination bucket added

UB Updated by Upkeep Bot 7 months ago Actions #10

  • Tags (freeform) set to backport_processed

UB Updated by Upkeep Bot 3 months ago Actions #11

  • 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 Actions #12

  • 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
Actions

Also available in: PDF Atom