Similar issue to
https://github.com/aws/aws-sdk-ruby/issues/357
I'm sure I'm missing required parameters, but a more descriptive error should be returned by the client.
require 'aws-sdk'
client = Aws::S3::Client.new()
resp = client.put_bucket_lifecycle_configuration({
bucket: "bktname", # required
lifecycle_configuration: {
rules: [ # required
{
id: "BlahDeprecation",
status: "Enabled", # required, accepts Enabled, Disabled
transitions: [
{
date: Time.now,
days: 30,
storage_class: "GLACIER", # Move data to glacier
},
],
noncurrent_version_expiration: {
noncurrent_days: 30, # Delete versioned data
},
abort_incomplete_multipart_upload: {
days_after_initiation: 1, # Kill orphaned uploads
},
},
],
},
use_accelerate_endpoint: false,
})
(FWIW I did figure out what I was doing wrong with this call :wink:, issue still remains)
@mike-bailey Appreciate your patience and thank you for the feedback!
Since SDK can only validate params based on their shapes or required or not, and it's difficult to validate correct behavior, such as in this case, some params in rule as descriptions and some are actions etc. And it might take a while to tell the combination for those params inside one rule from current documentation.
I'll reach out to service team for better documentation or better error handling behavior for the API, and keep updated :) Thanks
Closing due to this is a service API enhancement feature request.
And soft updates, I just had this tracked in their backlog, will keep updated.
Feel free to reopen with further questions , or if similar experience happens again and frustrates you feel free to cut a ticket for AWS Support for better experience, your feedback will always be highly appreciated : )
I'm getting the same error with put_bucket_logging and would appreciate any help.
I've tried like ten different formats, all similar to the example, including:
resp = client.put_bucket_logging({
bucket: "oursourcebucket",
bucket_logging_status: {
logging_enabled: {
target_bucket: "outdstbucket",
},
},
})
Closing due to this is a service API enhancement feature request.
When you work through the console, you do not need a prefix. When you do it through the AWS Ruby SDK, you need a prefix. Am I wrong in assuming this means it's probably an SDK issue and not a service API bug?
I got this error when I passed an empty value to deleteObjects method.
That happened because I forgot to handle cases where no objects to be deleted from S3 was provided.
Can this be reopened? You said feel free to reopen but I can鈥檛 :)
Thank you for your help!
This is related to #1664 root cause, and is a service issue that we are working on with them. As for differences in console behavior, it's possible the console is pre-populating default values for you. For example, if there is a prefix field, and it's left blank, a blank string is a valid prefix for put_bucket_logging - it is not the same as null. I do agree that this should be more clear in the API documentation and we're pushing the service team for that update as well.
Closing this as well, since next actions are underway and outside the SDK. Sorry for the ongoing churn with this.
No problem, thank you for the clarification!
Please check the provider path for Uri file
Most helpful comment
I got this error when I passed an empty value to
deleteObjectsmethod.That happened because I forgot to handle cases where no objects to be deleted from S3 was provided.