core: 2.4.0 beta is not compatible with symfony 4.2
I was too excited to test 2.4.0 so I updated it, but it failed:
In CheckExceptionOnInvalidReferenceBehaviorPass.php line 86:
The service "api_platform.messenger.data_persister" has a dependency on a non-existent service "message_bus".
We are using
symfony/symfony v4.2.1 The Symfony PHP framework
(yes, no flex, because it’s an “old” application, but we get new releases anyway)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 17 (15 by maintainers)
Commits related to this issue
- Check messenger service is available Fix #2461 — committed to soyuka/core by soyuka 5 years ago
- Check messenger service is available Fix #2461 — committed to soyuka/core by soyuka 5 years ago
- Check messenger service is available Fix #2461 — committed to soyuka/core by soyuka 5 years ago
For anyone getting error
The service "api_platform.messenger.data_persister" has a dependency on a non-existent service "message_bus".like I did, just addTo
config/packages/api_platform.yaml, to tell API Platform not to use messenger.My comments
Is still relevant 😃
I don’t think that fix is enough. It still requires the user to manually disable Messenger integration. Things should not be broken out of the box.
Thanks @ragboyjr !
https://github.com/api-platform/core/pull/2489/files
@soyuka @lyrixx
messenger_busis a private service. When running off of the latest api-platform 2.4, this fails to load the messenger component, since$container->has('message_bus')is always false.Checking how symfony’s FrameworkBundle works, they don’t ever check if a service exists, instead they do an interface exists check (like what we currently have and what was there previously), and in some cases, they check a config value to see if the module should be enabled or not.
@lyrixx correct me if i’m wrong, but if if you were getting that error, that means that you had symfony/messenger component installed but due to some configuration, the message bus service didn’t exist.
I think we should revert the
$container->has('messenger.message_bus')since it doesn’t work, and possibly see about adding a config option to enable/disable messenger integration entirely since messenger isn’t a stable component.I’ll fix this asap