When calling ClientBuilder->getClient(), it would fail because:
No PSR-17 request factory found. Install a package from this list: https://packagist.org/providers/psr/http-factory-implementation
This is thrown all the way down in php-http/discovery here, which is failing because it can't find a library to do HTTP with.
There's two reasons for this:
sentry-php changed to use guzzlehttp/psr7 instead of zendframework/zend-diactoros in v2.3.0Replace dependency to zendframework/zend-diactoros with guzzlehttp/psr7 (#945)
php-http/discoverycan't actually discoverguzzlehttp/psr7(their issue reported here).
weaverryan has pointed out in the php-http/discovery ticket that an interop library for guzzle exists called http-interop/http-factory-guzzle. By depending on that library instead of guzzle directly, then discovery will work and cheers will be had.
However, the interop library hasn't been updated in a hot minute, so perhaps Sentry would want to define the interop itself so it can use a newer version of guzzle? Perhaps you'd like to ping upstream to get them to update? I'm not sure, you call the shot :)
Since Sentry 2.3.0, Sentry fails to run unless Sentry users happen to install the right HTTP library.
To solve this, depend on http-interop/http-factory-guzzle or implement its behaviour within sentry-php
sentry-php-sdk already requires the http-interop/http-factory-guzzle package in its composer.json. This package instead contains the source code of the core SDK, and should not force any implementation of an HTTP client because it's up to you to decide which you want to use: if you don't want to make this choice then the first package is the right one to pick.
Makes sense to me!
After re-reading with more attention your first comment and the referenced issue in the php-http/discovery repository I now see the root cause of the problem and I think that it should be indeed fixed upstream. I will try to open a PR to get this fixed and see how it goes. I also just noticed that guzzlehttp/psr7 is exposing to Composer that it provides an implementation for psr/http-factory-implementation, thus making http-interop/http-factory-guzzle useless, but this change has not been released yet and this is why you get that error. It used to work in the past because zendframework/zend-diactoros did this from the beginning, so no extra package to make it working was needed
Most helpful comment
After re-reading with more attention your first comment and the referenced issue in the
php-http/discoveryrepository I now see the root cause of the problem and I think that it should be indeed fixed upstream. I will try to open a PR to get this fixed and see how it goes. I also just noticed thatguzzlehttp/psr7is exposing to Composer that it provides an implementation forpsr/http-factory-implementation, thus makinghttp-interop/http-factory-guzzleuseless, but this change has not been released yet and this is why you get that error. It used to work in the past becausezendframework/zend-diactorosdid this from the beginning, so no extra package to make it working was needed