Description
Summary (*)
Steps:
- Try to install 2.4-develop
- When prompted by the web setup, uncheck the optional Magento_MessageQueue module so that it would be disabled
Expected result: Magento installed okay.
Actual result (web setup): dies silently, progress stopped at Magento_Amqp installation
Actual result (via php bin/magento setup:install): Error during installation
[Progress: 164 / 636]
Module 'Magento_Amqp':
PHP Fatal error: Uncaught Error: Cannot instantiate interface Magento\Framework\MessageQueue\ConfigInterface in /var/www/magento2/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php:121
Examples (*)
Concrete class for the aforementioned Magento\Framework\MessageQueue\ConfigInterface
is declared in app/code/Magento/MessageQueue/etc/di.xml
:
<preference for="Magento\Framework\MessageQueue\ConfigInterface" type="Magento\Framework\MessageQueue\Config\Proxy" />
Which is fine by itself, except two classes in the Magento_Amqp module rely on this interface, yet Magento_Amqp does not declare any dependencies on Magento_MessageQueue module.
Proposed solution
a) quick workaround for anyone seeing this on their local machine: please either disable Magento_Amqp module or enable Magento_MessageQueue module and try again.
b) declare this dependency from inside Magento_Amqp module via module.xml, composer.json so that the setup would detect and detect this issue at the module selection step
c) move the di.xml entry to the global app/etc/di.xml
since involves two framework classes anyway
d) long-term goal: since Magento\Framework\MessageQueue\ConfigInterface
is marked as deprecated, its usages in Magento_Amqp should be removed from the classes completely. This will probably be a breaking change (removal of argument from constructor), but I assume it is not a problem for 2.4-develop branch?
Please let me know which solution is preferred (I might have some spare time to go forward with it and provide a Pull Request a bit later)