All Products
Search
Document Center

Object Storage Service:0031-00000001

Last Updated:Jul 21, 2023

Problem description

The XML request body of the data replication rule in the PutBucketReplication request is invalid.

Causes

You initiated a PutBucketReplication request, but the root node ReplicationConfiguration does not exist in the XML request body.

Examples

In the following example, the root node ReplicationConfiguration does not exist in the XML request body.

POST /?replication&comp=add HTTP/1.1
Date: GMT Date
Content-Length: ContentLength
Content-Type: application/xml
Authorization: SignatureValue
Host: BucketName.oss-cn-hangzhou.aliyuncs.com

<?xml version="1.0" encoding="UTF-8"?>
<Rule>     
     <RTC>
         <Status>enabled or disabled</Status>
     </RTC>
     <PrefixSet>
         <Prefix>prefix_1</Prefix>
         <Prefix>prefix_2</Prefix>
     </PrefixSet>
     <Action>ALL,PUT</Action>
     <Destination>
         <Bucket>destbucket</Bucket>
         <Location>oss-cn-hangzhou</Location>
         <TransferType>oss_acc</TransferType>
     </Destination>
     <HistoricalObjectReplication>enabled or disabled</HistoricalObjectReplication>
<Rule>     

Solutions

Add the root node ReplicationConfiguration to the XML request body.

POST /?replication&comp=add HTTP/1.1
Date: GMT Date
Content-Length: ContentLength
Content-Type: application/xml
Authorization: SignatureValue
Host: BucketName.oss-cn-hangzhou.aliyuncs.com

<?xml version="1.0" encoding="UTF-8"?>
<ReplicationConfiguration>
   <Rule>     
        <RTC>
            <Status>enabled or disabled</Status>
        </RTC>
        <PrefixSet>
            <Prefix>prefix_1</Prefix>
            <Prefix>prefix_2</Prefix>
        </PrefixSet>
        <Action>ALL,PUT</Action>
        <Destination>
            <Bucket>destbucket</Bucket>
            <Location>oss-cn-hangzhou</Location>
            <TransferType>oss_acc</TransferType>
        </Destination>
        <HistoricalObjectReplication>enabled or disabled</HistoricalObjectReplication>
   </Rule>
</ReplicationConfiguration>

References

PutBucketReplication