All Products
Search
Document Center

:What do I do if the "The operation is not valid for the object's state" error message is returned when I access a restored Archive object?

Last Updated:May 01, 2025

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:

  1. Restore the Archive object. For more information, see Restore objects.

    Note

    You are charged data retrieval fees when you restore an Archive object. For more information, see Request fees.

  2. After you confirm that the object is restored, access the object again within the duration of the restored state. For more information, see How do I check whether an OSS object is restored?.

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:

  1. Restore the object and confirm that the object can be accessed.

  2. Within the duration of the restored state, convert the storage class of the object to Standard. For more information, see Convert storage classes.

    Note

    To 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.