0031-00000002

Updated at:

Problem description

The PutBucketReplication request body is missing the replication rule configuration.

Causes

The XML request body contains an empty <ReplicationConfiguration> element with no <Rule> child element.

Examples

The following request triggers this error because <ReplicationConfiguration> contains no <Rule> element:

POST /?replication&comp=add HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Content-Type: application/xml
Content-Length: 186
Date: Thu, 24 Sep 2015 15:39:12 GMT
Authorization: OSS qn6q**************:77Dv****************
<?xml version="1.0" encoding="UTF-8"?>
<ReplicationConfiguration>
</ReplicationConfiguratio>

Solutions

Add a <Rule> element to the <ReplicationConfiguration> body. The following example shows a complete request with a valid replication rule:

POST /?replication&comp=add HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Content-Type: application/xml
Content-Length: 186
Date: Thu, 24 Sep 2015 15:39:12 GMT
Authorization: OSS qn6q**************:77Dv****************
<?xml version="1.0" encoding="UTF-8"?>
<ReplicationConfiguration>
  <Rule>
     <RTC>
        <Status>enabled</Status>
     </RTC>
     <PrefixSet>
        <Prefix>source1</Prefix>
        <Prefix>video</Prefix>
     </PrefixSet>
     <Action>PUT</Action>
     <Destination>
        <Bucket>destbucket</Bucket>
        <Location>oss-cn-beijing</Location>
        <TransferType>oss_acc</TransferType>
     </Destination>
     <HistoricalObjectReplication>enabled</HistoricalObjectReplication>
     <SyncRole>aliyunramrole</SyncRole>
     <SourceSelectionCriteria>
        <SseKmsEncryptedObjects>
          <Status>Enabled</Status>
        </SseKmsEncryptedObjects>
     </SourceSelectionCriteria>
     <EncryptionConfiguration>
          <ReplicaKmsKeyID>c4d49f85-ee30-426b-a5ed-95e9139d****</ReplicaKmsKeyID>
     </EncryptionConfiguration>
  </Rule>
</ReplicationConfiguration>

References

PutBucketReplication