Skip to content

[HttpClient] Error when using Psr18Client: Unable to seek to stream position 0 with whence 0 #37393

@Jeroeny

Description

@Jeroeny

Symfony version(s) affected: 5.1

Description
For a third-party library that I am using I have to inject a Psr\Http\Client\ClientInterface. I am using the Symfony\Component\HttpClient\Psr18Client for this. The framework even autowired this, which is nice.
Unfortunately after upgrading from 5.0 to 5.1, it's no longer working. The error that is thrown is not thrown by the Symfony client, but in GuzzleHttp\Psr7\Stream: Unable to seek to stream position 0 with whence 0 (see reproducer for full trace). Which is only thrown when on symfony/http-client:5.1.*. Maybe someone has any insights in 5.1 changes that could be related to this?

How to reproduce
https://github.com/Jeroeny/reproduce/tree/psr18-client

Possible Solution
Not sure if the solution would even be in Symfony's http-client, but it seems related to changes in 5.1 (coming from 5.0).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions