Skip to content
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

aws s3api get-object-attributes showing whats not supposed to show when using --object-attributes flag #9183

Open
1 task
thiagomarafeli opened this issue Jan 4, 2025 · 1 comment
Assignees
Labels
bug This issue is a bug. documentation This is a problem with documentation. p2 This is a standard priority issue s3api service-api This issue is due to a problem in a service API, not the SDK implementation.

Comments

@thiagomarafeli
Copy link

Describe the bug

When using aws s3api get-object-attributes with --object-attributes "<something>" flag, it is returning a date that stands for LastModified, even when there is nothing to be returned for my option.

In the aws s3api get-object-attributes help command, the option --object-attributes says:

"Specifies the fields at the root level that you want returned in the response. Fields that you do not specify are not returned."
But, it always shows that timestamp, although it says Fields that you do not specify are not returned.

I believe that either that must be more clear on the documentation or this behavior should be removed.
Being clearer in the docs helps knowing what to expect from the response (output) and use it to do other stuff with it.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

I expect to show only what I asked.

Current Behavior

The output shows the LastModified timestamp, as shown below using aws s3api get-object-attributes --bucket "mybucket" --key "my/path" --object-attributes "StorageClass" "ObjectSize" command as example:

{
    "LastModified": "2025-01-03T23:51:28+00:00",
    "StorageClass": "STANDARD",
    "ObjectSize": 21484232
}

Reproduction Steps

  1. Create a dummy file
  2. Upload it to a AWS S3 bucket with standard configuration
  3. Retrieve its attributes using the command:
aws s3api get-object-attributes --bucket "mybucket" --key "my/path" --object-attributes "StorageClass" "ObjectSize"

Possible Solution

Either:

  • Explicit this behavior on its manual
  • Remove this behavior (which, I believe, is more problematic)

Additional Information/Context

No response

CLI version used

aws-cli/2.22.28 Python/3.12.6 Linux/6.8.0-50-generic exe/x86_64.ubuntu.22

Environment details (OS name and version, etc.)

Ubuntu 22.04.5 LTS

@thiagomarafeli thiagomarafeli added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 4, 2025
@RyanFitzSimmonsAK RyanFitzSimmonsAK self-assigned this Jan 8, 2025
@RyanFitzSimmonsAK RyanFitzSimmonsAK added investigating This issue is being investigated and/or work is in progress to resolve the issue. s3api p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Jan 8, 2025
@RyanFitzSimmonsAK
Copy link
Contributor

Hi @thiagomarafeli, thanks for reaching out. I was able to reproduce this behavior. It looks like VersionId is also always returned if versioning is enabled on the bucket. I can see how this would be confusing, since this information is only explicitly mentioned in the output section of the documentation, but it doesn't mentioned that it's returned regardless of what attributes are requested. I've reached out to the service team about potentially clarifying this behavior in the documentation. I'll let you know when I have any updates.

Ticket # for internal reference : P186774199

@RyanFitzSimmonsAK RyanFitzSimmonsAK added documentation This is a problem with documentation. service-api This issue is due to a problem in a service API, not the SDK implementation. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. documentation This is a problem with documentation. p2 This is a standard priority issue s3api service-api This issue is due to a problem in a service API, not the SDK implementation.
Projects
None yet
Development

No branches or pull requests

2 participants