Why Does My Lifecycle Rule Not Take Effect?
If your lifecycle rule does not take effect, perform the following checks:
- Check whether your lifecycle rule was created more than 24 hours ago.
Lifecycle rule actions usually complete within 24 hours. Depending on when the lifecycle rule starts counting, storage class transitions or deletions of expired objects may be delayed, but the total time generally does not exceed 48 hours.
For example, assume an object is uploaded at 09:00 on June 1, 2024 (UTC). OBS starts counting its lifecycle rule at 00:00 on June 2, 2024 (UTC). If the rule deletes expired objects after one day, OBS starts deleting the object at 00:00 on June 3, 2024 (UTC). Because the execution delay does not exceed 24 hours, the deletion is completed by 00:00 on June 4, 2024 (UTC).
- Check whether the prefix or tag filters in the rule are correct.
Example:
- To expire and delete all objects in the test folder, set the prefix to test/ instead of test. If you set the prefix to test, the rule will also apply to objects in the bucket's root directory whose names start with test.
- If the rule is intended to delete objects with the tag key testobs and tag value testvalue, check that both the tag key and value are specified correctly.
- Check whether the object's last modification time meets the rule's time requirements.
OBS starts calculating an object's lifecycle at 00:00 (UTC) on the day after the object is last modified. For example, assume an object is uploaded at 09:00 on June 1, 2024 (UTC). OBS starts calculating its lifecycle at 00:00 on June 2, 2024 (UTC). If the rule is configured to expire objects after one day, the object meets the expiration condition at 00:00 on June 3, 2024 (UTC), and OBS starts deleting it. If you check before that time, you may mistakenly think the rule has not taken effect because the object has not yet been deleted.