S3: DeleteObjects
Creates File Versions and Delete Markers Regardless of File Existence with ObjectLockEnabledForBucket
Set to True
#2607
Labels
closing-soon
This issue will automatically close in 4 days unless further comments are made.
guidance
Question that needs advice or information.
p3
This is a minor priority issue
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Acknowledgements
go get -u github.com/aws/aws-sdk-go-v2/...
)Describe the bug
When creating a new S3 bucket with ObjectLockEnabledForBucket set to true, executing DeleteObjects on any resource name ( regardless of its existence ) results in the creation of some versions in the bucket. Consequently, I am unable to delete the bucket.
Expected Behavior
I expected no versions to be created since the file was never uploaded or otherwise created in the bucket.
Current Behavior
No errors occurred when executing the DeleteObjects operation, even though the specified objects did not exist. The output from the DeleteObjects call is as follows:
the code I write below, output shows like this
Output:
Subsequent Error:
When attempting to delete the bucket, an error occurred indicating that the bucket could not be deleted because it was not empty. The API error BucketNotEmpty was returned with a status code of 409, suggesting that all versions within the bucket need to be deleted first.
Reproduction Steps
The value of bucketName should be changed to a unique name before running this code to avoid conflicts.
Possible Solution
No response
Additional Information/Context
No response
AWS Go SDK V2 Module Versions Used
Compiler and Version used
go version go1.22.2 darwin/amd64
Operating System and version
MacOS 14.4.1
The text was updated successfully, but these errors were encountered: