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

Cannot install symfony/messenger #1169

Open
Stefan39 opened this issue Jun 12, 2019 · 12 comments
Open

Cannot install symfony/messenger #1169

Stefan39 opened this issue Jun 12, 2019 · 12 comments

Comments

@Stefan39
Copy link

Hi,

for an user-bundle i need symfony/messenger but I cannot install it

# composer require symfony/messenger
Restricting packages listed in "symfony/symfony" to "4.3.*"
./composer.json has been updated
Restricting packages listed in "symfony/symfony" to "4.3.*"
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install symfony/messenger v4.3.1
    - symfony/messenger v4.3.0 conflicts with api-platform/core[v2.4.4].
    - symfony/messenger v4.3.0 conflicts with api-platform/core[v2.4.4].
    - symfony/messenger v4.3.0 conflicts with api-platform/core[v2.4.4].
    - Installation request for symfony/messenger 4.3.* -> satisfiable by symfony/messenger[v4.3.0, v4.3.1].
    - Installation request for api-platform/core (locked at v2.4.4) -> satisfiable by api-platform/core[v2.4.4].


Installation failed, reverting ./composer.json to its original content.

What's wrong here?

Thanks, Stefan

@dunglas
Copy link
Member

dunglas commented Jun 12, 2019

Hi,

Unfortunately, it's a known issue. Messenger 4.3 contains some BC breaks that will not be fixed (because this component is still considered experimental). API Platform 2.5 will support Messenger 4.3. In the meantime, you can downgrade to Messenger 4.2, or try this pull request (that isn't ready yet): api-platform/core#2784

@Stefan39
Copy link
Author

Hi,

thanks for your reply. I have try it, but got the same message:

composer require symfony/messenger "~4.2"
Restricting packages listed in "symfony/symfony" to "4.3.*"
./composer.json has been updated
Restricting packages listed in "symfony/symfony" to "4.3.*"
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install symfony/messenger v4.3.1
    - symfony/messenger v4.3.0 conflicts with api-platform/core[v2.4.4].
    - symfony/messenger v4.3.0 conflicts with api-platform/core[v2.4.4].
    - symfony/messenger v4.3.0 conflicts with api-platform/core[v2.4.4].
    - Installation request for symfony/messenger ~4.2 -> satisfiable by symfony/messenger[v4.3.0, v4.3.1].
    - Installation request for api-platform/core (locked at v2.4.4) -> satisfiable by api-platform/core[v2.4.4].


Installation failed, reverting ./composer.json to its original content.

How to install the version 4.2?

@teohhanhui
Copy link
Contributor

teohhanhui commented Jun 13, 2019

Change "extra.symfony.require" in composer.json to "^4.2"

We made a mistake here:

https://github.com/api-platform/api-platform/blob/v2.4.4/api/composer.json#L64

@dunglas This is another reason why we should switch back to semver.

@Stefan39
Copy link
Author

Hi

thanks, but this also not works because it has conflicts with framework-bundle

composer require symfony/messenger "~4.2"
Restricting packages listed in "symfony/symfony" to "^4.2"
./composer.json has been updated
Restricting packages listed in "symfony/symfony" to "^4.2"
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install symfony/messenger v4.3.1
    - Conclusion: don't install symfony/messenger v4.3.0
    - Conclusion: remove symfony/framework-bundle v4.3.1
    - Installation request for api-platform/core (locked at v2.4.4) -> satisfiable by api-platform/core[v2.4.4].
    - Conclusion: don't install symfony/framework-bundle v4.3.1
    - symfony/messenger v4.2.0 conflicts with symfony/framework-bundle[v4.3.1].
    - symfony/messenger v4.2.1 conflicts with symfony/framework-bundle[v4.3.1].
    - symfony/messenger v4.2.2 conflicts with symfony/framework-bundle[v4.3.1].
    - symfony/messenger v4.2.3 conflicts with symfony/framework-bundle[v4.3.1].
    - symfony/messenger v4.2.4 conflicts with symfony/framework-bundle[v4.3.1].
    - symfony/messenger v4.2.5 conflicts with symfony/framework-bundle[v4.3.1].
    - symfony/messenger v4.2.6 conflicts with symfony/framework-bundle[v4.3.1].
    - symfony/messenger v4.2.7 conflicts with symfony/framework-bundle[v4.3.1].
    - symfony/messenger v4.2.8 conflicts with symfony/framework-bundle[v4.3.1].
    - symfony/messenger v4.2.9 conflicts with symfony/framework-bundle[v4.3.1].
    - Installation request for symfony/framework-bundle (locked at v4.3.1, required as 4.3.*) -> satisfiable by symfony/framework-bundle[v4.3.1].
    - Installation request for symfony/messenger ~4.2 -> satisfiable by symfony/messenger[v4.2.0, v4.2.1, v4.2.2, v4.2.3, v4.2.4, v4.2.5, v4.2.6, v4.2.7, v4.2.8, v4.2.9, v4.3.0, v4.3.1].


Installation failed, reverting ./composer.json to its original content.

It's ok, I'd rather not do that and don't want to downgrade so much that nothing works afterwards.

I wanted to install msgphp/user-bundle, but it doesn't work and I have to use FOSUserBundle.

@teohhanhui
Copy link
Contributor

teohhanhui commented Jun 13, 2019

Yes, you need to add "symfony/messenger": "^4.2" to the composer.json manually and do composer update symfony/* (I think)

composer require is only appropriate for simple cases.

@teohhanhui
Copy link
Contributor

teohhanhui commented Jun 13, 2019

@Stefan39 As an aside, you don't need FOSUserBundle (we don't recommend it). You may refer to our docs on JWT authentication.

@Stefan39
Copy link
Author

@teohhanhui Thanks for your hints... also to add symfony/messenger manually to the composer.json and update symfony/* not works (same error).

I use the Lexik JWT authentication bundle, but i need to secure the api with at least an api user.

@teohhanhui
Copy link
Contributor

We have a complete tutorial on how to do that here: https://api-platform.com/docs/core/jwt/

@teohhanhui
Copy link
Contributor

teohhanhui commented Jun 13, 2019

@Stefan39 You're right. I forgot that composer is not very good at downgrading packages when resolving dependencies. So it's a more manual process than that.

@Stefan39
Copy link
Author

Yes i know.. with this tutorial i have installed lexik :-)

My / Our problem is, that the api documentation are visible for everyone. Of couse it could not use without credentials, but see all the methods and so on. Therefore i want to use FOSUserBundle or msgphp/user-bundle to protect this.

@teohhanhui
Copy link
Contributor

Those bundles will not help you in this case. If you want to restrict access to the docs, you need to add the correct rules in the access_control section of the security configuration.

@Stefan39
Copy link
Author

Ah ok.. thanks. Now it protected, but haven't a login form or anything. But this is a new construction side, thanks.

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

No branches or pull requests

3 participants