magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.36k stars 9.28k forks source link

2.4.7-p1: "Could not create an acl object" after disabling Magento_PaymentServices* modules #38839

Open OvalMedia opened 1 week ago

OvalMedia commented 1 week ago

Preconditions and environment

Steps to reproduce

  1. Install magento
  2. disable all paymentservices modules: bin/magento module:disable Magento_PaymentServicesBase Magento_PaymentServicesDashboard Magento_PaymentServicesPaypal Magento_PaymentServicesSaaSExport Magento_PaymentServicesPaypalGraphQl
  3. bin/magento setup:di:compile
  4. Login to admin panel

Expected result

Modules are disabled and the admin panel should work as expected.

Actual result

Admin panel crashes with an exception:


1 exception(s):
Exception #0 (LogicException): Could not create an acl object: Invalid Document 
Error in merged XML after reading /vendor/magento/module-config/etc/acl.xml
Element 'resource': The attribute 'title' is required but missing.
Line: 14
The xml was: 
9:        <resources>
10:            <resource id="Magento_Backend::admin" title="Magento Admin" translate="title" sortOrder="20">
11:                <resource id="Magento_Backend::stores" title="Stores" translate="title" sortOrder="80">
12:                    <resource id="Magento_Backend::stores_settings" title="Settings" translate="title" sortOrder="10">
13:                        <resource id="Magento_Config::config" title="Configuration" translate="title" sortOrder="20">
14:                            <!--
15:                            @deprecated Magento_Config::advanced section ('Advanced Section') is disabled and is not displayed in the admin panel
16:                            -->
17:                            <resource id="Magento_Config::advanced" title="Advanced Section" translate="title" sortOrder="90" disabled="true"/>
18:                            <resource id="Magento_Config::config_admin" title="Advanced Admin Section" translate="title" sortOrder="100"/>

Exception #0 (LogicException): Could not create an acl object: Invalid Document 
Error in merged XML after reading /vendor/magento/module-config/etc/acl.xml
Element 'resource': The attribute 'title' is required but missing.
Line: 14
The xml was: 
9:        <resources>
10:            <resource id="Magento_Backend::admin" title="Magento Admin" translate="title" sortOrder="20">
11:                <resource id="Magento_Backend::stores" title="Stores" translate="title" sortOrder="80">
12:                    <resource id="Magento_Backend::stores_settings" title="Settings" translate="title" sortOrder="10">
13:                        <resource id="Magento_Config::config" title="Configuration" translate="title" sortOrder="20">
14:                            <!--
15:                            @deprecated Magento_Config::advanced section ('Advanced Section') is disabled and is not displayed in the admin panel
16:                            -->
17:                            <resource id="Magento_Config::advanced" title="Advanced Section" translate="title" sortOrder="90" disabled="true"/>
18:                            <resource id="Magento_Config::config_admin" title="Advanced Admin Section" translate="title" sortOrder="100"/>

<pre>#1 Magento\Framework\Acl\Builder\Proxy->getAcl() called at [vendor/magento/module-backend/Model/Auth/Session.php:271]
#2 Magento\Backend\Model\Auth\Session->processLogin() called at [vendor/magento/module-backend/Model/Auth.php:165]
#3 Magento\Backend\Model\Auth->login() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#4 Magento\Backend\Model\Auth\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#5 Magento\Backend\Model\Auth\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-admin-adobe-ims/Plugin/DisableAdminLoginAuthPlugin.php:56]
#6 Magento\AdminAdobeIms\Plugin\DisableAdminLoginAuthPlugin->aroundLogin() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#7 Magento\Backend\Model\Auth\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#8 Magento\Backend\Model\Auth\Interceptor->___callPlugins() called at [generated/code/Magento/Backend/Model/Auth/Interceptor.php:23]
#9 Magento\Backend\Model\Auth\Interceptor->login() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:207]
#10 Magento\Backend\App\Action\Plugin\Authentication->_performLogin() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:159]
#11 Magento\Backend\App\Action\Plugin\Authentication->_processNotLoggedInUser() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:127]
#12 Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#13 Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#14 Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->___callPlugins() called at [generated/code/Magento/Backend/Controller/Adminhtml/Index/Index/Interceptor.php:32]
#15 Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:245]
#16 Magento\Framework\App\FrontController->getActionResponse() called at [vendor/magento/framework/App/FrontController.php:212]
#17 Magento\Framework\App\FrontController->processRequest() called at [vendor/magento/framework/App/FrontController.php:146]
#18 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#19 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#20 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#21 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:23]
#22 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:116]
#23 Magento\Framework\App\Http->launch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#24 Magento\Framework\App\Http\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#25 Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-application-performance-monitor/Plugin/ApplicationPerformanceMonitor.php:38]
#26 Magento\ApplicationPerformanceMonitor\Plugin\ApplicationPerformanceMonitor->aroundLaunch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#27 Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#28 Magento\Framework\App\Http\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23]
#29 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:264]
#30 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:30]
</pre>

Additional information

No response

Release note

No response

Triage and priority

m2-assistant[bot] commented 1 week ago

Hi @OvalMedia. Thank you for your report. To speed up processing of this issue, 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:

m2-assistant[bot] commented 1 week ago

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

engcom-Delta commented 1 week ago

Hi @OvalMedia ,

Verified the issue on 2.4-develop community as well as commerce edition and we are not able to reproduce this issue.

Steps to reproduce:-

1.Install magento 2.disable all paymentservices modules: bin/magento module:disable Magento_PaymentServicesBase Magento_PaymentServicesDashboard Magento_PaymentServicesPaypal Magento_PaymentServicesSaaSExport Magento_PaymentServicesPaypalGraphQl 3.bin/magento setup:di:compile 4.Login to admin panel

disable all payment services modules

Screenshot 2024-06-19 at 6 29 18 PM

Run bin/magento setup:di:compile

Screenshot 2024-06-19 at 6 29 33 PM

Login to admin panel

Screenshot 2024-06-19 at 6 29 47 PM

Please refer the attached screenshots and let us know if we missed anything.

OvalMedia commented 1 week ago

Whatever you did, you did not disable the mentioned modules. As a matter of fact your own screenshot shows (highlight in red) that upon trying to disable them magento is trying to tell you these modules do not exist (for whatever reason). So you basically changed nothing and ran another compilation.

engcom-Delta commented 6 days ago

Hi @OvalMedia ,

Verified the issue on 2.4.7 and it is reproducible.

Hence, Confirming the issue.

Steps to reproduce:-

1.Install magento 2.Disable all payment services modules: bin/magento module:disable Magento_PaymentServicesBase Magento_PaymentServicesDashboard Magento_PaymentServicesPaypal Magento_PaymentServicesSaaSExport Magento_PaymentServicesPaypalGraphQl 3.bin/magento setup:di:compile 4.Login to admin panel

Disable all payment services modules

Screenshot 2024-06-24 at 6 37 35 PM

bin/magento setup:di:compile

Screenshot 2024-06-24 at 6 37 46 PM

Login to admin panel

Screenshot 2024-06-24 at 6 38 44 PM
github-jira-sync-bot commented 6 days ago

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

m2-assistant[bot] commented 6 days ago

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

github-jira-sync-bot commented 6 days ago

:x: Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.adobe.com/browse/AC-12287

elioermini commented 6 days ago

This one is quite annoying

OvalMedia commented 6 days ago

This one is quite annoying

Adobe decided to pack magento with their own service which I cannot use anyway (not available in my country). And to add insult to injury I cannot remove it properly.

hostep commented 6 days ago

@OvalMedia, there is a way to remove them with a composer trick:

  1. Add this to your composer.json file:
    "replace": {
        "adobe-commerce/os-extensions-metapackage": "*"
     }
  2. Run composer update adobe-commerce/* magento/*
  3. Run bin/magento setup:upgrade

That should get rid of them. This is a pretty common practice done by Magento veterans, to remove unwanted modules this way, it was first described in this blog post as far as I remember.

OvalMedia commented 6 days ago

I am familiar with that technique. I don't use adobe commerce. And I doubt this will make the exception go away as it is triggered in module-config. The way I interpret that exception a field that used to be optional ("title") is now required. But since the ACL files are all merged the title was eventually set by the adobe payment modules. That way it was not noticed the title attribute is missing in other modules.

elioermini commented 2 days ago

@OvalMedia the change suggested by @hostep (hero!) actually removes plenty of modules even in the Magento OpenSource. In our case these, can be more or less in your case and the specific issue "Could not create an acl object" is solved! So the cause has to be in one of the following that went away: