Amazon S3 error- A conflicting conditional operation is currently in progress against this resource.
Amazon S3Amazon S3 Problem Overview
Why I got this error when I try to create a bucket in amazon S3?
Amazon S3 Solutions
Solution 1 - Amazon S3
This error means that, the bucket was recently deleted and is queued for delete in S3. You must wait until the name is available again.
Solution 2 - Amazon S3
This error means that, the bucket was recently deleted and is queued for delete in S3. You must wait until the Bucket name is available again.
Kindly note, I received this error when my access-priviliges were blocked.
The error means your Operation for creating new bucket at S3 is aborted.
There can be multiple reasons for this, you can check the below points for rectifying this error:
- Is this Bucket available or is Queued for Deletion
- Do you have adequate access privileges for this operation
- Your Bucket Name must be unique
P.S: Edited this answer to add more details as shared by Sanity below, and his answer is more accurate with updated information.
You can view the related errors for this operation here. I am editing my asnwer so that correct answer posted below can be selected as correct answer to this question.
Solution 3 - Amazon S3
Creating a S3 bucket policy and the S3 public access block for a bucket at the same time will cause the error.
Terraform example
resource "aws_s3_bucket_policy" "allow_alb_access_bucket_elb_log" {
bucket = local.bucket_alb_log_id
policy = data.aws_iam_policy_document.allow_alb_access_bucket_elb_log.json
}
resource "aws_s3_bucket_public_access_block" "lb_log" {
bucket = local.bucket_alb_log_id
block_public_acls = true
block_public_policy = true
}
Solution
resource "aws_s3_bucket_public_access_block" "lb_log" {
bucket = local.bucket_alb_log_id
block_public_acls = true
block_public_policy = true
#--------------------------------------------------------------------------------
# To avoid OperationAborted: A conflicting conditional operation is currently in progress
#--------------------------------------------------------------------------------
depends_on = [
aws_s3_bucket_policy.allow_alb_access_bucket_elb_log
]
}
Solution 4 - Amazon S3
We have also observed this error several times when we try to move bucket from one account to other. In order to achieve this you should do the following :
- Backup content of the S3 bucket you want to move.
- Delete S3 bucket on the account.
- Wait for 1/2 hours
- Create a bucket with the same name in another account
- Restore s3 bucket backup
Solution 5 - Amazon S3
I received this error running a terraform apply
with the error:
> Error: error creating public access block policy for S3 bucket > (bucket-name): OperationAborted: A conflicting > conditional operation is currently in progress against this resource. > Please try again. > status code: 409, request id: 30B386F1FAA8AB9C, host id: M8flEj6+ncWr0174ftzHd74CXBjhlY8Ys70vTyORaAGWA2rkKqY6pUECtAbouqycbAZs4Imny/c=
It said to "please try again" which I did and it worked the second time. It seems there wasn't enough wait time when provisioning the initial resource with Terraform.
Solution 6 - Amazon S3
To fully resolve this error, I inserted a 5 second sleep between multiple requests. There is nothing else that I had to do.