Skip to content

[HttpClient] A chunk passthru yields null instead of ChunkInterface instances #40639

Closed
@pepe358

Description

@pepe358

symfony/http-client version: 5.2.4
symfony/messenger version: 5.2.4
symfony/amazon-sqs-messenger version: 5.2.4

Description
I'm receiving A chunk passthru must yield instances of "Symfony\Contracts\HttpClient\ChunkInterface", "null" yielded error on Symfony messenger worker container, which handles messages from Amazon SQS queue:

Fatal error: Uncaught LogicException: A chunk passthru must yield instances of "Symfony\Contracts\HttpClient\ChunkInterface", "null" yielded. in /app/vendor/symfony/http-client/Response/AsyncResponse.php:349

Stack trace:
#0 /app/vendor/symfony/http-client/Response/AsyncResponse.php(320): Symfony\Component\HttpClient\Response\AsyncResponse::passthruStream(Object(Symfony\Component\HttpClient\Response\CurlResponse), Object(Symfony\Component\HttpClient\Response\AsyncResponse), NULL, Object(SplObjectStorage)) | 
#1 /app/vendor/symfony/http-client/Response/AsyncResponse.php(275): Symfony\Component\HttpClient\Response\AsyncResponse::passthru(Object(Symfony\Component\HttpClient\CurlHttpClient), Object(Symfony\Component\HttpClient\Response\AsyncResponse), Object(Symfony\Component\HttpClient\Chunk\LastChunk), Object(SplObjectStorage)) |  
#2 /app/vendor/symfony/http-client/Response/AsyncResponse.php(63): Symfony\Component\HttpClient\Response\AsyncResponse::stream(Array) |  
#3 /app/vendor/symfony/http-client/Response/CommonResponseTrait.php(1 in /app/vendor/symfony/http-client/Response/AsyncResponse.php on line 349

Additional context
The AsyncResponse::passthru (line 275) is getting Symfony\Component\HttpClient\Chunk\LastChunk as third argument. Shouldn't this be denied by https://github.com/symfony/http-client/blob/5.x/Response/AsyncResponse.php#L309?

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