-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BucketLifecycleConfiguration Resource doesn't gets refreshed rules. #2491
Comments
@luvk1412 - Thank you for your post. If you are using load() operation after putting a new rule to your bucket then you should get all the rules if put operation is successful. I am not able to reproduce the behavior by calling load() after putting a new rule. |
Hi @swetashre , Below is the code. If i run this code on my staging bucket, all 40 rules are not added in the bucket.
|
@luvk1412 - Thank you for providing me the sample code. There can be only one configuration per bucket but the configuration can have multiple rules. So can you please try the below code and see if that works for you ? I just concatenated all the rules before sending so that each rule will fall under same configuration. import boto3
s3 = boto3.resource('s3')
bucket_lifecycle = s3.BucketLifecycleConfiguration('bucketname')
rules = bucket_lifecycle.rules
def add_s3_rule(event):
new_rule = get_lifecycle_rule(event)
rules.append(new_rule)
for ad, eve in events_lst:
add_s3_rule(ad+':'+eve)
# so in this case each rule falls under same configuration
response = bucket_lifecycle.put(LifecycleConfiguration={'Rules': rules}) |
@swetashre I know this will work but in my application each rule addition is dependent on some task A, and task A and the rule addition for it are a part of a transaction. So i cannot combine this, the way you told. But shouldn't the load call update the configuration and then configuration.rules provide latest rules after each put ? I mean i am thinking this way that each time i fetch the configuration and put a new configuration and fetch should get the latest configuration. I am aware that each bucket has single configuration but put is changing whole configuration in my code right doing put of each role and updating the whole configuration. Am i missing something here, isn't load supposed to work this way according to documentation ? |
@luvk1412 - When we use load method it uses |
I am also stuck with the same issue. |
Get bucket lifecycle configuration a few times to make sure it is stable. It was observed that shortly (~30s) after setting the rules a method get-bucket-lifecycle-configuration returns alternatively new and old rules in a random manner. Similar issue reported for boto3 library: boto/boto3#2491
Get bucket lifecycle configuration a few times to make sure it is stable. It was observed that shortly (~30s) after setting the rules a method get-bucket-lifecycle-configuration returns alternatively new and old rules in a random manner. Similar issue reported for boto3 library: boto/boto3#2491
Get bucket lifecycle configuration a few times to make sure it is stable. It was observed that shortly (~30s) after setting the rules a method get-bucket-lifecycle-configuration returns alternatively new and old rules in a random manner. Similar issue reported for boto3 library: boto/boto3#2491
Get bucket lifecycle configuration a few times to make sure it is stable. It was observed that shortly (~30s) after setting the rules a method get-bucket-lifecycle-configuration returns alternatively new and old rules in a random manner. Similar issue reported for boto3 library: boto/boto3#2491
Get bucket lifecycle configuration a few times to make sure it is stable. It was observed that shortly (~30s) after setting the rules a method get-bucket-lifecycle-configuration returns alternatively new and old rules in a random manner. Similar issue reported for boto3 library: boto/boto3#2491
…1085) s3_lifecycle: reassure that configuration is complete before returning. Get bucket lifecycle configuration a few times to make sure it is stable. It was observed that shortly (~30s) after setting the rules a method get-bucket-lifecycle-configuration returns alternatively new and old rules in a random manner. Similar issue reported for boto3 library: boto/boto3#2491 SUMMARY Fixes #1084 ISSUE TYPE Bugfix Pull Request COMPONENT NAME s3_lifecycle Reviewed-by: Mark Chappell <None> Reviewed-by: Lukasz Rubaszewski <None> Reviewed-by: Mark Woolley <[email protected]> Reviewed-by: Alina Buzachis <None> Reviewed-by: Joseph Torcasso <None>
…1085) s3_lifecycle: reassure that configuration is complete before returning. Get bucket lifecycle configuration a few times to make sure it is stable. It was observed that shortly (~30s) after setting the rules a method get-bucket-lifecycle-configuration returns alternatively new and old rules in a random manner. Similar issue reported for boto3 library: boto/boto3#2491 SUMMARY Fixes #1084 ISSUE TYPE Bugfix Pull Request COMPONENT NAME s3_lifecycle Reviewed-by: Mark Chappell <None> Reviewed-by: Lukasz Rubaszewski <None> Reviewed-by: Mark Woolley <[email protected]> Reviewed-by: Alina Buzachis <None> Reviewed-by: Joseph Torcasso <None> (cherry picked from commit d802749)
…1085) s3_lifecycle: reassure that configuration is complete before returning. Get bucket lifecycle configuration a few times to make sure it is stable. It was observed that shortly (~30s) after setting the rules a method get-bucket-lifecycle-configuration returns alternatively new and old rules in a random manner. Similar issue reported for boto3 library: boto/boto3#2491 SUMMARY Fixes #1084 ISSUE TYPE Bugfix Pull Request COMPONENT NAME s3_lifecycle Reviewed-by: Mark Chappell <None> Reviewed-by: Lukasz Rubaszewski <None> Reviewed-by: Mark Woolley <[email protected]> Reviewed-by: Alina Buzachis <None> Reviewed-by: Joseph Torcasso <None> (cherry picked from commit d802749)
…1085) (#1132) [PR #1085/d802749f backport][stable-3] s3_lifecycle: reassure that configuration is complete before returning. This is a backport of PR #1085 as merged into main (d802749). Get bucket lifecycle configuration a few times to make sure it is stable. It was observed that shortly (~30s) after setting the rules a method get-bucket-lifecycle-configuration returns alternatively new and old rules in a random manner. Similar issue reported for boto3 library: boto/boto3#2491 SUMMARY Fixes #1084 ISSUE TYPE Bugfix Pull Request COMPONENT NAME s3_lifecycle Reviewed-by: Alina Buzachis <None>
…1085) (#1131) [PR #1085/d802749f backport][stable-2] s3_lifecycle: reassure that configuration is complete before returning. This is a backport of PR #1085 as merged into main (d802749). Get bucket lifecycle configuration a few times to make sure it is stable. It was observed that shortly (~30s) after setting the rules a method get-bucket-lifecycle-configuration returns alternatively new and old rules in a random manner. Similar issue reported for boto3 library: boto/boto3#2491 SUMMARY Fixes #1084 ISSUE TYPE Bugfix Pull Request COMPONENT NAME s3_lifecycle Reviewed-by: Alina Buzachis <None>
…nsible-collections#1085) s3_lifecycle: reassure that configuration is complete before returning. Get bucket lifecycle configuration a few times to make sure it is stable. It was observed that shortly (~30s) after setting the rules a method get-bucket-lifecycle-configuration returns alternatively new and old rules in a random manner. Similar issue reported for boto3 library: boto/boto3#2491 SUMMARY Fixes ansible-collections#1084 ISSUE TYPE Bugfix Pull Request COMPONENT NAME s3_lifecycle Reviewed-by: Mark Chappell <None> Reviewed-by: Lukasz Rubaszewski <None> Reviewed-by: Mark Woolley <[email protected]> Reviewed-by: Alina Buzachis <None> Reviewed-by: Joseph Torcasso <None>
…nsible-collections#1085) s3_lifecycle: reassure that configuration is complete before returning. Get bucket lifecycle configuration a few times to make sure it is stable. It was observed that shortly (~30s) after setting the rules a method get-bucket-lifecycle-configuration returns alternatively new and old rules in a random manner. Similar issue reported for boto3 library: boto/boto3#2491 SUMMARY Fixes ansible-collections#1084 ISSUE TYPE Bugfix Pull Request COMPONENT NAME s3_lifecycle Reviewed-by: Mark Chappell <None> Reviewed-by: Lukasz Rubaszewski <None> Reviewed-by: Mark Woolley <[email protected]> Reviewed-by: Alina Buzachis <None> Reviewed-by: Joseph Torcasso <None>
Describe the bug
BucketLifecycleConfiguration.rules doesn't fetches refreshed rules after performing a put operation.
I am talking about this resource : https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#bucketlifecycleconfiguration
Steps to reproduce
Just try to insert several rules in a loop one by one. Basic steps.
Loop :
Performing above in loop even for 20+ rules would result in not adding all of them to bucket lifecycle configuration.
Expected behavior
All the rules i am trying to add should be added.
The text was updated successfully, but these errors were encountered: