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

[2.4-develop] Cannot instantiate Magento\Framework\MessageQueue\ConfigInterface if optional module Magento_MessageQueue is disabled #26080

Closed
korostii opened this issue Dec 17, 2019 · 4 comments
Assignees
Labels
Component: MessageQueue Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@korostii
Copy link
Contributor

Summary (*)

Steps:

  1. Try to install 2.4-develop
  2. 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)

@m2-assistant
Copy link

m2-assistant bot commented Dec 17, 2019

Hi @korostii. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

@korostii do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Dec 17, 2019
@korostii korostii self-assigned this Dec 17, 2019
@m2-assistant
Copy link

m2-assistant bot commented Dec 17, 2019

Hi @korostii. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!


@korostii korostii changed the title [2.4-develop] Cannot instantiate Magento\Framework\MessageQueue\ConfigInterface if optional module Magento_MessageQueue is diabled [2.4-develop] Cannot instantiate Magento\Framework\MessageQueue\ConfigInterface if optional module Magento_MessageQueue is disabled Dec 17, 2019
@korostii korostii mentioned this issue Dec 17, 2019
4 tasks
@sudheers-kensium sudheers-kensium added Component: MessageQueue Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Dec 18, 2019
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @sudheers-kensium
Thank you for verifying the issue. Based on the provided information internal tickets MC-29880 were created

Issue Available: @sudheers-kensium, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Dec 18, 2019
jissereitsma added a commit to yireo/magento2-replace-core that referenced this issue Feb 12, 2020
@sdzhepa sdzhepa added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label May 6, 2020
@ghost ghost added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. labels Aug 18, 2020
@magento-engcom-team magento-engcom-team added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Aug 26, 2020
@magento-engcom-team
Copy link
Contributor

Hi @korostii. Thank you for your report.
The issue has been fixed in #26081 by @korostii in 2.4-develop branch
Related commit(s):

The fix will be available with the upcoming 2.4.2 release.

magento-engcom-team pushed a commit that referenced this issue Aug 26, 2020
magento-engcom-team added a commit that referenced this issue Aug 26, 2020
 - Merge Pull Request #26081 from korostii/magento2:korostii-patch-26080
 - Merged commits:
   1. cfab782
   2. 7c263e8
magento-engcom-team pushed a commit that referenced this issue Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: MessageQueue Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
None yet
Development

No branches or pull requests

4 participants