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

HashingStream incompatible with Psr\Http\Message\StreamInterface still failing #2681

Closed
martinzaleski opened this issue Apr 21, 2023 · 13 comments
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@martinzaleski
Copy link

Describe the bug

I'd like to re-open this issue: #2644

I strongly believe there's actually a bug that has been unresolved.
The signature of the latest versions of psr/http-message and aws-sdk-php do not match and I'm still getting the same error.
I fixed it pinning to version 1.0.1 of psr/http-message but of course that's not the optimal solution.

Expected Behavior

Not throw the exception.

Current Behavior

It runs the same exception due to incompatibility between signatures:

Declaration of Aws\HashingStream::seek($offset, $whence = Aws\SEEK_SET) must be compatible with Psr\Http\Message\StreamInterface::seek(int $offset, int $whence = Psr\Http\Message\SEEK_SET): void in /app/vendor/aws/aws-sdk-php/src/HashingStream.php on line 53

Reproduction Steps

It's a compilation error so no steps to reproduce. I use the latest version of psr/http-message

Possible Solution

No response

Additional Information/Context

No response

SDK version used

3.263.15

Environment details (Version of PHP (php -v)? OS name and version, etc.)

PHP 8.1 OS

@martinzaleski martinzaleski added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 21, 2023
@SamRemis
Copy link
Member

Hi @martinzaleski,
Unfortunately, we can't fix this for now since this repository supports PHP versions down to 5.5 and this would be a breaking change. We have started a deprecation campaign announcing that we will no longer support versions below 7.2.5 after the minor version bump that will happen on August 15th, 2023.

Once that happens, we will be able to add return types without breaking customers code.

-Sam

@martinzaleski
Copy link
Author

Hello @SamRemis, thank you for your prompt response.
I totally understand. In that case, wouldn't it be fair from you to pin psr/http-message yourselves in the SDK code?

If I'm not missing anything, the multipart upload to S3 right now is completely broken unless you pin to the aforementioned dependency version. It took us quite some time to understand the issue and we had some bugs in production due to this.

Warm regards,
Martin

@jo0natan
Copy link

I also had the same error, to solve the error for now I rolled back some previous versions of league/flysystem-aws-s3-v3

@jo0natan
Copy link

here my composer.json for temporary solution:

"require": {
    "guzzlehttp/guzzle": "^7.0.1",
    "illuminate/mail": "*",
    "illuminate/view": "^8.65",
    "laravel/legacy-factories": "^1.3",
    "laravel/lumen-framework": "^8.0",
    "laravel/tinker": "^2.7",
    "league/csv": "^9.8",
    "league/flysystem-aws-s3-v3": "^1.0"
},

@walkonthemarz
Copy link

walkonthemarz commented Apr 26, 2023

Hello @SamRemis, thank you for your prompt response. I totally understand. In that case, wouldn't it be fair from you to pin psr/http-message yourselves in the SDK code?

If I'm not missing anything, the multipart upload to S3 right now is completely broken unless you pin to the aforementioned dependency version. It took us quite some time to understand the issue and we had some bugs in production due to this.

Warm regards, Martin

I'm having the same issue. If I understand correctly, upgrading to psr/http-message:^2.0 will cause the AWS-SDK broken.
@SamRemis, I see this repo has pinned "psr/http-message" to version ^1.0 in "require-dev", shouldn't it be in the "require" section?

@stobrien89
Copy link
Member

Hi all,

Sorry for the issues. I've submitted a PR to pin this, but our next release won't be until tomorrow (we are blocked today).

@stobrien89
Copy link
Member

stobrien89 commented Apr 27, 2023

#2684 has been merged, which should resolve this. Our latest release will contain this change. Feel free to open another issue if anything else comes up!

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@asterism612
Copy link

How to solve this?

@stobrien89
Copy link
Member

@asterism612,

This should not be an issue if you're using the latest version of the SDK.

@yodaylay22
Copy link

I am not using it because I am on Laravel 8, how can I solve this? (when installing with composer the version ~1.0 was installed)

@washeul-pixpa
Copy link

washeul-pixpa commented Jul 3, 2023

@yodaylay22 @asterism612 @stobrien89

I was facing the same issue although all of my composer packages are up-to-date.
I am abale to resolve this issue by downgrading http-message to version 1 issue was in version 2

"psr/http-message" : "^1.0", installing this resolved in my end

@hmemar
Copy link

hmemar commented Aug 21, 2024

@yodaylay22 @asterism612 @stobrien89

I was facing the same issue although all of my composer packages are up-to-date.
I am abale to resolve this issue by downgrading http-message to version 1 issue was in version 2

"psr/http-message" : "^1.0", installing this resolved in my end

How do you do this. Steps please

This issue was closed.
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. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

9 participants