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 · 4 comments · Fixed by #167
Closed

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

weaverryan opened this issue Jan 9, 2020 · 4 comments · Fixed by #167

Comments

@weaverryan
Copy link

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 pushed 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 pushed 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 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

@TomasVotruba
Copy link

TomasVotruba commented Jun 1, 2021

A year later the package is still not taged :/

This took me an hour to figure hour, painful WTF. The dev version packages should not be part of list that provide interface.

@dbu
Copy link
Contributor

dbu commented Jun 1, 2021

i am not exactly sure what you are reporting. afaik the only thing not tagged in php-http/discovery is the removal of puli. which should have been tagged, i am doing that now.

@TomasVotruba
Copy link

I'm sorry, this might not be related to your repository.


This one: #164 (comment)

I'm not sure what repository this is, just reacted to the comments above which hold context shared with my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants