Problem description
The bucket of Alibaba Cloud Object Storage Service (OSS) is configured with a lifecycle rule that specifies files of Standard or Infrequent Access storage class to be converted to Archive storage class after a specified number of days. Some Archive objects still fail to be accessed after they are restored, and the following error message is returned:
StatusCode=403, ErrorCode=InvalidObjectState, ErrorMessage="The operation is not valid for the object's state"
Cause
After an Archive object is restored, the restored state lasts for one day by default. You can extend the duration of the restored state to up to seven days by using the ossutil tool or SDK. After the duration ends, the object returns to the frozen state and cannot be accessed, which triggers the preceding error.
Solution
Select a solution based on your requirements:
Temporarily access an Archive object
If you need to temporarily read the file, perform the following steps:
Frequently access an Archive object
If you need to frequently access the object in the future, we recommend that you convert the object to Standard storage class to avoid repeated restoration:
Restore the object and confirm that the object can be accessed.
Within the duration of the restored state, convert the storage class of the object to Standard. For more information, see Convert storage classes.
NoteTo prevent the Standard object from being converted to Archive storage class again by the lifecycle rule, we recommend that you create a new bucket of Standard storage class and migrate the Standard object to the new bucket.