Description
An Object Storage Service (OSS) bucket is configured with a lifecycle rule that transitions objects from the Standard or Infrequent Access (IA) storage class to the Archive storage class after a specified period. 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
When an Archive object is restored, its accessible 'restored' state is temporary. By default, this state lasts for one day. This period can be extended up to a maximum of seven days using ossutil or an SDK. After this period expires, the object transitions back to the Archive storage class and cannot be accessed directly until it is restored again.
Solution
Select a solution based on how frequently you need to access the object.
For temporary access
If you need to read the object temporarily, perform the following steps:
For frequent access
If you need to access the object regularly, convert its storage class to Standard to avoid repeated restorations.
Restore the object and confirm that it can be accessed.
Change the storage class to Standard while the object is in the restored state. For instructions, see Convert storage classes.
NoteTo prevent the lifecycle rule from transitioning the object back to the Archive storage class, create a new Standard bucket without this rule and migrate the object to it.