0020-00000029

问题描述

PutBucketInventory请求中Destination/OSSBucketDestination/RoleArn节点取值不合法。

问题原因

PutBucketInventory请求中Destination/OSSBucketDestination/RoleArn节点取值为空,或者角色填写有误,导致请求错误。

问题示例

以下请求中Destination/OSSBucketDestination/RoleArn节点配置的角色策略有误,无法通过扮演该角色向您指定的Bucket写入清单结果文件。

  PUT /?inventory&inventoryId=report1 HTTP/1.1
  Host: BucketName.oss.aliyuncs.com
  Date: Mon, 31 Oct 2016 12:00:00 GMT
  Authorization: authorization string
  Content-Length: length

  <?xml version="1.0" encoding="UTF-8"?>
    <InventoryConfiguration>
     <Id>report1</Id>
     <IsEnabled>true</IsEnabled>
     <Destination>
        <OSSBucketDestination>
           <Format>CSV</Format>
           <AccountId>1000000000000000</AccountId>
           <RoleArn>acs:ram::1000000000000000:role/AliyunOSSInvalidRole</RoleArn>
           <Bucket>acs:oss:::destination-bucket</Bucket>
           <Prefix>prefix1</Prefix>
           <Encryption>
              <SSE-KMS>
                 <KeyId>keyId</KeyId>
              </SSE-KMS>
           </Encryption>
        </OSSBucketDestination>
     </Destination>
     <Schedule>
        <Frequency>Daily</Frequency>
     </Schedule>
     <IncludedObjectVersions>All</IncludedObjectVersions>
     <OptionalFields>
        <Field>Size</Field>
        <Field>LastModifiedDate</Field>
        <Field>ETag</Field>
        <Field>StorageClass</Field>
        <Field>IsMultipartUploaded</Field>
        <Field>EncryptionStatus</Field>
     </OptionalFields>
  </InventoryConfiguration>

解决方案

  1. 通过OSS控制台创建默认服务角色。更多信息,请参见注意事项

  2. Destination/OSSBucketDestination/RoleArn节点取值填写步骤1创建的服务角色名称。

相关文档

PutBucketInventory