Description
Symfony version(s) affected
5.3.11
Description
Hello there ; we recently upgrade from 5.2.12
to 5.3.11
.
I'm not really sure what's happening... but logging in ES with curl
+ ElasticsearchLogstashHandler
is now causing some trouble.
Our usecase
In our case, while running doctrine:fixture:load --append
, some (info level) logs are generated. However, we now got an error related to the http-client
package (because of those logs).
Our investigation
The issue seems to happen when the stack tries to push logs through the curl
+ ElasticsearchLogstashHandler
package in monolog-bridge
+ http-client
.
The error is introduced because of / thanks to symfony/http-client@cf34137, but I doubt this commit is the real issue.
Sometimes, we even get the following error:
Could not push logs to Elasticsearch:
Symfony\Component\HttpClient\Exception\TimeoutException: Idle timeout reached for "http://elastic:changeme@elasticsearch:9200/_bulk". in /srv/api/vendor/symfony/http-client/Chunk/ErrorChunk.php:65
Stack trace:
#0 /srv/api/vendor/symfony/monolog-bridge/Handler/ElasticsearchLogstashHandler.php(157): Symfony\Component\HttpClient\Chunk\ErrorChunk->isFirst()
#1 /srv/api/vendor/symfony/monolog-bridge/Handler/ElasticsearchLogstashHandler.php(147): Symfony\Bridge\Monolog\Handler\ElasticsearchLogstashHandler->wait(true)
#2 [internal function]: Symfony\Bridge\Monolog\Handler\ElasticsearchLogstashHandler->__destruct()
#3 {main}
I made a repository https://github.com/adaniloff/symfony-http-client-issue/blob/main/README.md with a docker stack to reproduce, since the case is not easy to setup (... it requires a specific version of SF5 + ES + POSTing logs to ES...).
How to reproduce
Reproducing the issue requires:
- SF http-client 5.3.11 + monolog-bridge ^3.0
- an elasticsearch client
- a monolog handler which forward info level logs to the elasticsearch client
See https://github.com/adaniloff/symfony-http-client-issue/blob/main/README.md for an easy setup (requires docker/docker-compose).
Possible Solution
No response
Additional Context
No response