Unable to enable versioning for an Object Storage Service (OSS) bucket
Problem description
When you use Alibaba Cloud Object Storage Service (OSS), you may encounter the following issues when you try to enable versioning to prevent accidental object overwrites or deletions:
In the OSS console, click Bucket List, click the name of the target bucket, and then click Data Security in the navigation pane on the left. The Versioning button is not displayed.
In the OSS console, click Bucket List, click the name of the target bucket, and then click Data Security in the navigation pane on the left. The Versioning button is displayed. However, when you try to enable versioning, an "Invalid request" error message is returned. The error message may contain the following information:
It is forbidden to modify versioning status when having website config in this bucket.It is forbidden to modify versioning status when synchronizing data.Set bucket versioning error, InvalidRequest, It is forbidden to modify versioning status when synchronizing dataA message similar to the following is displayed.
Causes
The error occurs for the following reasons:
The Resource Access Management (RAM) user does not have the `PutBucketVersioning` permission.
Versioning, retention policies, mirroring-based back-to-origin, static website hosting, or cross-region replication cannot be configured at the same time.
Solutions
If you cannot enable versioning, perform the following steps to troubleshoot the issue:
Check the permissions of the current user. Only the bucket owner and RAM users that are granted the `PutBucketVersioning` permission can configure versioning. For more information, see PutBucketVersioning.
For the same bucket, versioning cannot be configured at the same time as retention policies, mirroring-based back-to-origin, static website hosting, or cross-region replication.
Perform the following steps to check whether a retention policy is configured. If a retention policy is configured for the bucket, you cannot enable versioning. For more information about retention policies, see Introduction to retention policies.
Perform the following steps to check whether static website hosting is configured. If static website hosting is configured for the bucket, you cannot enable versioning. For more information about static website hosting, see Introduction to static website hosting.
Perform the following steps to check whether cross-region replication is configured. If cross-region replication is configured for the bucket, you cannot enable versioning. For more information about cross-region replication, see Introduction to cross-region replication.
Applicable to
Object Storage Service (OSS)