0020-00000035
Updated at:
Problem description
A PutBucketInventory request fails when the <SSE-OSS> encryption block contains a <KeyId> element. KeyId is only valid for SSE-KMS encryption and is not accepted for SSE-OSS.
Causes
SSE-OSS encryption is managed entirely by OSS and requires no key ID. Including <KeyId> inside an <SSE-OSS> block is an invalid configuration.
Examples
The following request uses SSE-OSS encryption but incorrectly includes <KeyId>:
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>
<Filter>
<Prefix>filterPrefix/</Prefix>
<LastModifyBeginTimeStamp>1637883649</LastModifyBeginTimeStamp>
<LastModifyEndTimeStamp>1638347592</LastModifyEndTimeStamp>
<LowerSizeBound>1024</LowerSizeBound>
<UpperSizeBound>2048</UpperSizeBound>
<StorageClass>Standard,IA</StorageClass>
</Filter>
<Destination>
<OSSBucketDestination>
<Format>CSV</Format>
<AccountId>1000000000000000</AccountId>
<RoleArn>acs:ram::1000000000000000:role/AliyunOSSRole</RoleArn>
<Bucket>acs:oss:::destination-bucket</Bucket>
<Prefix>prefix1</Prefix>
<Encryption>
<SSE-OSS>
<KeyId>keyId</KeyId>
</SSE-OSS>
</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>
</OptionalFields>
</InventoryConfiguration>Solutions
Choose the encryption mode that matches your intent:
| Encryption mode | Requires KeyId | Managed by |
|---|---|---|
| SSE-OSS | No | OSS (no configuration needed) |
| SSE-KMS | Yes | Key Management Service (KMS) |
To use SSE-OSS, remove the <KeyId> element from the <SSE-OSS> block:
<Encryption>
<SSE-OSS/>
</Encryption>To use SSE-KMS, change the encryption node to <SSE-KMS> and provide a valid KMS key ID:
<Encryption>
<SSE-KMS>
<KeyId>your-kms-key-id</KeyId>
</SSE-KMS>
</Encryption>References
Is this page helpful?