magento2
                                
                                 magento2 copied to clipboard
                                
                                    magento2 copied to clipboard
                            
                            
                            
                        Hard dependency on magento/module-admin-adobe-ims in magento/module-two-factor-auth
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 replacesection in thecomposer.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”.
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.
- Join Magento Community Engineering Slack and ask your questions in #github channel.
: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
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 labelIssue: Format is validwill be added to the issue automatically. Please, edit issue description if needed, until labelIssue: Format is validappears.
- 
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Descriptionlabel to the issue by yourself.
- 
[ ] 3. Add Component: XXXXXlabel(s) to the ticket, indicating the components it may be related to.
- 
[ ] 4. Verify that the issue is reproducible on 2.4-developbranchDetails- Add the comment@magento give me 2.4-develop instanceto deploy test instance on Magento infrastructure.
 - If the issue is reproducible on2.4-developbranch, please, add the labelReproduced 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: Confirmedonce verification is complete.
- 
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog. 
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 labelIssue: Format is validwill be added to the issue automatically. Please, edit issue description if needed, until labelIssue: Format is validappears.
- 
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Descriptionlabel to the issue by yourself.
- 
[ ] 3. Add Component: XXXXXlabel(s) to the ticket, indicating the components it may be related to.
- 
[ ] 4. Verify that the issue is reproducible on 2.4-developbranchDetails- Add the comment@magento give me 2.4-develop instanceto deploy test instance on Magento infrastructure.
 - If the issue is reproducible on2.4-developbranch, please, add the labelReproduced 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: Confirmedonce verification is complete.
- 
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog. 
: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:
- Install fresh 2.4.5
- Add this to the replacesection in the composer.json:
"replace": {
       "magento/module-adobe-ims": "*",
       "magento/module-adobe-ims-api": "*",
       "magento/module-admin-adobe-ims": "*"
   },
- Run composer update.
- Run bin/magento setup:di:compile.
- Check the debug log.
Expected result: Compile finishes correctly
Actual result:
Getting error

Note: It has been observed 2FA is disabled or enabled issue is same.
Hence, confirming the issue.
Thanks
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-6428 is successfully created for this GitHub issue.
: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.
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.
Is there a work around to fix this issue ATM?
Is there a work around to fix this issue ATM?
Yes, see my OP
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.
I suggest that the Magento core team uses https://github.com/yireo/Yireo_ExtensionChecker/ to make sure all dependencies are found :see_no_evil:
fixed in https://github.com/magento/security-package/commit/4f5e220d68c4165a954f07311b7c80de92c22638