archetype-digital / aws-sqs-extended

The Amazon SQS Extended Client Library for Python for sending and receiving large messages via S3
MIT License
2 stars 1 forks source link

[ERROR] ClientError: An error occurred (OperationAborted) when calling the CreateBucket operation: A conflicting conditional operation is currently in progress against this resource. Please try again #3

Closed shahidashraff closed 2 years ago

shahidashraff commented 2 years ago

[ERROR] ClientError: An error occurred (OperationAborted) when calling the CreateBucket operation: A conflicting conditional operation is currently in progress against this resource. Please try again. Traceback (most recent call last):   File "/var/lang/lib/python3.7/imp.py", line 234, in load_module     return load_source(name, filename, file)   File "/var/lang/lib/python3.7/imp.py", line 171, in load_source     module = _load(spec)   File "", line 696, in _load   File "", line 677, in _load_unlocked   File "", line 728, in exec_module   File "", line 219, in _call_with_frames_removed   File "/var/task/lambda_function.py", line 19, in     session.extend_sqs(S3_EXTENDED_BUCKET)   File "/opt/python/aws_sqs_ext_client/session.py", line 76, in extend_sqs     s3.create_bucket(**s3_bucket_params)   File "/opt/python/botocore/client.py", line 391, in _api_call     return self._make_api_call(operation_name, kwargs)   File "/opt/python/botocore/client.py", line 719, in _make_api_call     raise error_class(parsed_response, operation_name)


shahidashraff commented 2 years ago

I have already bucket present in S3, why are we still making this call.

hiroshi-nakagoe commented 2 years ago

@shahidashraff I guess you ran SQSExtendedSession.extend_sqs right after deleting the target S3 bucket, didn't you? See https://aws.amazon.com/premiumsupport/knowledge-center/s3-conflicting-conditional-operation/ why this happened.

rishi-dhar commented 2 years ago

I'm also attempted to use this with an existing S3 bucket. We don't need to create the bucket each time.

hiroshi-nakagoe commented 2 years ago

this module doesn't always create the S3 bucket. Once creating a bucket, it just checks whether the bucket exists or not. But, I agree this module doesn't need to support its creation so I'll add an option

hiroshi-nakagoe commented 2 years ago

@rishi-dhar without checking whether the s3 bucket exists, please specify s3_bucket_params=None when calling extend_sqs