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

"No PSR-17 request factory found" incorrectly suggests guzzlehttp/psr7 #164

Closed
weaverryan opened this issue Jan 9, 2020 · 1 comment
Closed

Comments

@weaverryan
Copy link

@weaverryan weaverryan commented Jan 9, 2020

PHP version: 7.3

Description
Hi!

This seems related to #156 and #149.

I received the error:

No PSR-17 request factory found. Install a package from this list: https://packagist.org/providers/psr/http-factory-implementation

But when I go to https://packagist.org/providers/psr/http-factory-implementation, the first item on the list is guzzlehttp/psr7. When I installed it, I got the same error. After some deep digging, If found out that I actually needed http-interop/http-factory-guzzle. Installing that package does fix things - it's just the recommendation that was wrong (and tough to debug!).

Am I correct that guzzlehttp/psr7 should not be shown on the list of "http factory implementations"? If so, why is it there? Is it a bug in that package's metadata? Something on Packagist? I don't know much about this - I'm just trying to get a bundle that is a few layers above this to work :).

Thanks!

mitchhentges added a commit to mozilla-services/phabricator-extensions that referenced this issue Mar 5, 2020
Sentry depends on an HTTP implementation. They recently changed implementations from
zendframework/zend-diactoros to guzzlehttp/psr7 in their 2.3.0 release:
https://github.com/getsentry/sentry-php/releases/tag/2.3.0

However, the tool they use to detect HTTP implementations can't actually detect
guzzlehttp: php-http/discovery#164

By providing the "http-interop/http-factory-guzzle" interop library between guzzlehttp
and the detection tool, we can ensure that Sentry is able to perform HTTP requests again.

Differential Revision: https://phabricator.services.mozilla.com/D65425
dklawren added a commit to mozilla-services/phabricator-extensions that referenced this issue Mar 5, 2020
Sentry depends on an HTTP implementation. They recently changed implementations from
zendframework/zend-diactoros to guzzlehttp/psr7 in their 2.3.0 release:
https://github.com/getsentry/sentry-php/releases/tag/2.3.0

However, the tool they use to detect HTTP implementations can't actually detect
guzzlehttp: php-http/discovery#164

By providing the "http-interop/http-factory-guzzle" interop library between guzzlehttp
and the detection tool, we can ensure that Sentry is able to perform HTTP requests again.

Differential Revision: https://phabricator.services.mozilla.com/D65425
@ste93cry
Copy link
Contributor

@ste93cry ste93cry commented Mar 7, 2020

Am I correct that guzzlehttp/psr7 should not be shown on the list of "http factory implementations"? If so, why is it there? Is it a bug in that package's metadata? Something on Packagist?

No you aren't: the guzzlehttp/psr7 package is providing all PSR-17 factories but only starting from version 2.0.x-dev which is currently in development (the change is already in master), thus Packagist is correctly showing this package as a provider for the psr/http-factory-implementation virtual package. The error you got is due to the reason explained above: the version you have installed is not supporting PSR-17 and anyway the php-http/discovery package is not able to discover the newest version. I opened a PR to fix this, but if you want to stop requiring the http-interop/http-factory-guzzle package you will also have to update to an unstable version of the guzzlehttp/psr7 package

@dbu dbu closed this in #167 May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.