阅读背景:

AWS错误消息:针对此资源的冲突条件操作正在进行中

来源:互联网 

I'm getting this error intermittently.

我间歇性地得到这个错误。

I have a program that uses the java aws sdk and loads over the 10s of thousands of small files to s3. I see this error intermittently.

我有一个程序,它使用java aws sdk,并将成千上万个小文件加载到s3。我断断续续地看到这个错误。

Could not find any helpful answer after doing a quick search on the internet.

在网上快速搜索后找不到任何有用的答案。

Note the calling program is single threaded. The underlying aws java sdk does seem to use worker threads.

注意,调用程序是单线程的。底层的aws java sdk似乎确实使用了工作线程。

Status Code: 409, AWS Service: Amazon S3, AWS Request ID: 75E16E8DE2193CA6, AWS Error Code: OperationAborted, AWS Error Message: A conflicting conditional operation is currently in progress against this resource. Please try again., S3 Extended Request ID: 0uquw2YEoFamLldm+c/p412Lzd8jHJGFBDz3h7wN+/4I0f6hnGLkPMe+5LZazKnZ
    at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:552)
    at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:289)
    at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:170)
    at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:2648)
    at com.amazonaws.services.s3.AmazonS3Client.createBucket(AmazonS3Client.java:578)
    at com.amazonaws.services.s3.AmazonS3Client.createBucket(AmazonS3Client.java:503)

5 个解决方案

#1


327  

I got the same error message, when I did following:

我得到了同样的错误信息,当我这样做的时候:

  1. created a bucket - it went by default to US region (used AWSCLI)

    创建了一个桶——它默认进入了US区域(使用AWSCLI)

  2. realized, the bucket shall go to EU region and deleted it (used AWS console)

    意识到桶应该去EU区域删除(使用AWS控制台)

  3. (few minutes later) tried to create the bucket, specifying the EU region

    (几分钟后)尝试创建桶,指定欧盟地区

At step 3, AWS console has shown me the error message from title of your question.

在步骤3,AWS控制台向我显示了您的问题标题中的错误消息。

So I guess, that the bucket in US was deleted, but there are possibly some synchronization processes, which are taking time. And I hope, that waiting few hours I will find the bucket name again available for creation - this time in proper (EU) region.

我猜,我们的桶被删除了,但是可能有一些同步进程,这需要时间。我希望,再等几个小时,我就能再次找到可以用于创作的桶名——这次是在合适的(欧盟)地区。

FIX :- Edit: About an hour later, my attempt to create the bucket (in EU region) succeeded.

修正:-编辑:大约一个小时后,我创建桶(在欧盟地区)的尝试成功了。

#2


16  

The request in your example is to create a bucket. If you are trying to create too many buckets or replace buckets, it is not healthy.

示例中的请求是创建一个bucket。如果你想制造太多的桶或更换水桶,那是不健康的。

Note that you have a limit of 100 buckets for an account (see here). EDIT: Now this limit is a "soft limit" and you can increase it if needed.

注意,您对一个帐户有100个存储段的限制(参见这里)。编辑:现在这个限制是一个“软限制”,如果需要你可以增加它。

Also note that a creation of a bucket takes time and:

还要注意,创建一个bucket需要时间,并且:

...it is not appropriate to make bucket create or delete calls on the high availability code path of your application...

…在应用程序的高可用性代码路径上创建bucket创建或删除调用是不合适的。

It is better to create your buckets once and then, you can put as many objects that you like in your existing buckets (or even a single one).

最好是一次性创建您的bucket,然后可以将您喜欢的对象放入现有的bucket(甚至是单个bucket中)。

Anyway, when working with a system that is bound to fail any now and then, you should be able to handle errors and slow down your process when receiving such an error. See more details in AWS Docs.

无论如何,当使用一个系统时,该系统会不时地出现故障,您应该能够处理错误,并在接收到此类错误时降低进程的速度。请参阅AWS文档中的更多细节。

#3


14  

For all others who stumble upon this thread from google, as 1st result in search for this error message:

对于所有在谷歌上偶然发现这个线程的人,第一个结果就是搜索这个错误消息:

If you deleted bucket, to recreate in new region, do not wait "manually" until this background sync will be complete, instead put a small bash script to run and retry your needed bucket creation every 5 seconds or so.

如果您删除了bucket,要在新的区域重新创建,不要“手动”等待这个后台同步完成,而是每5秒放置一个小bash脚本运行并重试所需的bucket创建。

Example:

例子:

#!/bin/bash 
RESULT=2 
until [  $RESULT -eq 0 ]; do
    aws s3 mb s3://your.bucket.name --region us-west-2
    RESULT=$?
    sleep 5 
done 
echo "Bucket created!"

it will retry the "create bucket" operation for you, every few seconds (depend on 'sleep' ) and as soon as it's possible - will create it for you, so no one can steal your bucket name by mistake :)

它将每隔几秒钟为您重试“创建桶”操作(取决于“睡眠”),并尽快为您创建它,因此没有人会误取您的桶名:

hope it helps :)

希望它能帮助:)

#4


6  

This error usually occurs when a Bucket is deleted and a new bucket is created in the same name as the old bucket.

这个错误通常发生在删除一个Bucket并且以旧Bucket的名称创建一个新的Bucket的时候。

I believe we would need to wait for certain amount of time until we can create a new bucket in the same name.

我相信我们需要等待一定的时间,直到我们可以用相同的名字创建一个新的bucket。

#5


2  

Simple and straightforward: Change the new bucket name or wait 1 hour.

简单而直接:更改新的bucket名称或等待1小时。


分享到: