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

PutBucketReplicationRequest doesn't work if ReplicationRuleFilter contains and filter variant #1998

Open
JusSergey opened this issue Mar 23, 2023 · 0 comments

Comments

@JusSergey
Copy link

In the documentation of ReplicationRuleFilter is described that one of the prefix, tag or and has to be specified. Actually, put-bucket-replication proceeds successfully only if one of the prefix or tag is specified, if I try to specify only and then the request always fails with "The XML you provided was not well-formed or did not validate against our published schema".

In docs PutBucketReplication examples it is shown that tags in and variant have to be specified as:

    <Filter>
       <And>
           <Prefix>TaxDocs</Prefix>
           <Tag>
             <Key>key1</Key>
             <Value>value1</Value>
           </Tag>
           <Tag>
             <Key>key1</Key>
             <Value>value1</Value>
           </Tag>
       </And>
    </Filter>

but if I pass a filter like:

ReplicationRuleFilter {
    and: ReplicationRuleAndOperator {
        prefix: Some("PrefixName".to_string()),
        tags: vec![Tag { key: "key1".to_string(), value: "value1".to_string() }],
    },
    prefix: None,
    tag: None
}

then it fails, and in CloudTrail I see the next:
rusoto_s3

It seems like there's extra Tag{} wrapper that leads to this error. So in this case the XML looks like:

<Filter>
  <And>
    <Prefix>PrefixName</Prefix>
    <Tag>
      <Tag>
        <Value>value1</Value>
        <Key>key1</Key>
      </Tag>
    </Tag>
  </And>
</Filter>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant