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

S3client headObject not possible when streams are enabled after update of aws-sdk-php #107

Open
1 task
johannes85 opened this issue Nov 4, 2024 · 0 comments
Assignees
Labels
bug This issue is a bug. investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-triage This issue or PR still needs to be triaged.

Comments

@johannes85
Copy link

johannes85 commented Nov 4, 2024

Describe the bug

After updating the aws-sdk-php from 3.305.4 to 3.325.2, my code suddenly stopped working.
After testing it further, the problem was introduced in the 3.319.4 version, 3.319.3 still works.

I get an Stream is not seekable exception when doing a S3Client->headObject call.

Streams are enabled via the global bundle setting:

aws:
    http:
      stream: true

It seems to be caused by the new introduced S3Parser which allways trys to rewind the stream when checking if the 2xx result is an error:
https://github.com/yenfryherrerafeliz/aws-sdk-php/blob/bb1c0d42b646bcf4a520fe58d722b8097cc12149/src/S3/Parser/S3Parser.php#L181

Regression Issue

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

Expected Behavior

Returns the head infos.

Current Behavior

A RuntimeException with the Stream is not seekable message is thrown.

Reproduction Steps

Enable streams in the bundle settings:

aws:
    http:
      stream: true

Call headObject on the S3Client instance

Possible Solution

No response

Additional Information/Context

No response

SDK version used

2.7.0

Environment details (OS name and version, etc.)

Linux, PHP 8.2.24 FPM, Symfony 7.0.8

@johannes85 johannes85 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 4, 2024
@yenfryherrerafeliz yenfryherrerafeliz self-assigned this Feb 28, 2025
@yenfryherrerafeliz yenfryherrerafeliz added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Feb 28, 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. investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants