magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Hard dependency on magento/module-admin-adobe-ims in magento/module-two-factor-auth

Open peterjaap opened this issue 3 years ago • 11 comments

Preconditions and environment

Magento 2.4.5

When removing magento/module-admin-adobe-ims from the codebase by using the "replace" section in composer.json, bin/magento setup:di:compile fails because of a hard dependency on the fairly unrelated module magento/module-two-factor-auth.

This constitutes bad separation of concerns.

Steps to reproduce

  • Install Magento 2.4.5
  • Add this to the replace section in the composer.json;
        "magento/module-adobe-ims": "*",
        "magento/module-adobe-ims-api": "*",
        "magento/module-admin-adobe-ims": "*"
  • Run composer update
  • Run bin/magento setup:di:compile

Expected result

Compile finishes correctly

Actual result

Compilation was started.
%message% 0/9 [>---------------------------]   0% < 1 sec 81.0 
MiBProxies code generation... 0/9 [>------------------------]   0% < 1 sec 81.0 MiB
Proxies code generation... 1/9 [==>----------------------]  11% < 1 sec 89.0 MiB
Repositories code generation... 1/9 [==>-----------------]  11% < 1 sec 89.0 MiB
Repositories code generation... 2/9 [====>---------------]  22% 4 secs 208.0 MiB
Service data attributes generation... 2/9 [===>----------]  22% 4 secs 208.0 MiB
Service data attributes generation... 3/9 [====>---------]  [33% 4 secs 208.0 MiB
Application code generator... 3/9 [====>---------]  33% 4 secs 208.0 MiB
Application code generator... 4/9 [======>-------]  44% 10 secs 2[34%).0 MiB
Interceptors generation... 4/9 [======>-------]  44% 10 secs 234.0 MiB
                                                                               
  Class "Magento\AdminAdobeIms\Service\ImsConfig" does not exist               
  Class Magento\TwoFactorAuth\Observer\ControllerActionPredispatch\Intercepto  
  r generation error: The requested class did not generate properly, because   
  the 'generated' directory permission is read-only. If --- after running the  
   'bin/magento setup:di:compile' CLI command when the 'generated' directory   
  permission is set to write --- the requested class did not generate properl  
  y, then you must add the generated class object to the signature of the rel  
  ated construct method, only.

Additional information

The workaround right now is to remove module-adobe-ims* modules from the replace section, so they are included in the codebase, which we don't want.

-        "magento/module-adobe-ims": "*",
-        "magento/module-adobe-ims-api": "*",
-        "magento/module-admin-adobe-ims": "*",

Another workaround is to also remove magento/module-two-factor-auth from the codebase, which is even less desirable.

Release note

No response

Triage and priority

  • [ ] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • [ ] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • [X] Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • [ ] Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • [ ] Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

peterjaap avatar Aug 17 '22 12:08 peterjaap

Hi @peterjaap. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

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

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

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

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] avatar Aug 17 '22 12:08 m2-assistant[bot]

Hi @engcom-Lima. 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: :point_down:

  • [ ] 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!

  • [ ] 5. Add label Issue: Confirmed once verification is complete.

  • [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.

m2-assistant[bot] avatar Aug 17 '22 12:08 m2-assistant[bot]

Hi @engcom-Alfa. 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: :point_down:

  • [ ] 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!

  • [ ] 5. Add label Issue: Confirmed once verification is complete.

  • [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.

m2-assistant[bot] avatar Aug 18 '22 06:08 m2-assistant[bot]

:heavy_check_mark: Issue confirmed

Issue got reproduced in Magento 2.4.5 .

Description: Hard dependency on magento/module-admin-adobe-ims in magento/module-two-factor-auth

Steps to reproduce:

  1. Install fresh 2.4.5
  2. Add this to the replace section in the composer.json:
"replace": {
       "magento/module-adobe-ims": "*",
       "magento/module-adobe-ims-api": "*",
       "magento/module-admin-adobe-ims": "*"
   },
  1. Run composer update.
  2. Run bin/magento setup:di:compile.
  3. Check the debug log.

Expected result: Compile finishes correctly

Actual result: Getting error Screenshot from 2022-08-18 17-02-29

Note: It has been observed 2FA is disabled or enabled issue is same.

Hence, confirming the issue.

Thanks

engcom-Lima avatar Aug 19 '22 11:08 engcom-Lima

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-6428 is successfully created for this GitHub issue.

github-jira-sync-bot avatar Aug 19 '22 11:08 github-jira-sync-bot

:white_check_mark: Confirmed by @engcom-Lima. Thank you for verifying the issue.
Issue Available: @engcom-Lima, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

m2-assistant[bot] avatar Aug 19 '22 11:08 m2-assistant[bot]

It looks like this was added / introduced in https://github.com/magento/security-package/commit/32beaeb8a5f6c94a38ab5ed20ef90b4191fa2f33, but I can't find a pull request nor any context on GitHub.

fredden avatar Aug 23 '22 11:08 fredden

Is there a work around to fix this issue ATM?

gfxguru avatar Aug 26 '22 20:08 gfxguru

Is there a work around to fix this issue ATM?

Yes, see my OP

peterjaap avatar Aug 30 '22 07:08 peterjaap

Bytheway, this issue is very similar to https://github.com/magento/magento2/issues/35479 but it concerns magento/module-new-relic-reporting and magento/module-graph-ql in that case.

peterjaap avatar Sep 06 '22 14:09 peterjaap

I suggest that the Magento core team uses https://github.com/yireo/Yireo_ExtensionChecker/ to make sure all dependencies are found :see_no_evil:

sprankhub avatar Sep 14 '22 11:09 sprankhub

fixed in https://github.com/magento/security-package/commit/4f5e220d68c4165a954f07311b7c80de92c22638

andimov avatar Dec 22 '22 16:12 andimov