magento2
magento2 copied to clipboard
2.4.7-p1: "Could not create an acl object" after disabling Magento_PaymentServices* modules
Preconditions and environment
- Magento version: 2.4.7-p1
- PHP 8.2
- Fresh install, no other modifications
Steps to reproduce
- Install magento
- disable all paymentservices modules: bin/magento module:disable Magento_PaymentServicesBase Magento_PaymentServicesDashboard Magento_PaymentServicesPaypal Magento_PaymentServicesSaaSExport Magento_PaymentServicesPaypalGraphQl
- bin/magento setup:di:compile
- 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
- [ ] 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.
- [ ] 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 @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:
@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.
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:
- [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
- [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
- [ ] 3. Add
Area: XXXXXlabel to the ticket, indicating the functional areas 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 @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
Run bin/magento setup:di:compile
Login to admin panel
Please refer the attached screenshots and let us know if we missed anything.
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.
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
bin/magento setup:di:compile
Login to admin panel
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-12287 is successfully created for this GitHub issue.
: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.
:x: Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.adobe.com/browse/AC-12287
This one is quite annoying
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.
@OvalMedia, there is a way to remove them with a composer trick:
- Add this to your
composer.jsonfile:
"replace": {
"adobe-commerce/os-extensions-metapackage": "*"
}
- Run
composer update adobe-commerce/* magento/* - 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.
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.
@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:
- Removing adobe-commerce/adobe-ims-metapackage (2.2.2)
- Removing adobe-commerce/os-extensions-metapackage (1.0.0)
- Removing firebase/php-jwt (v6.10.1)
- Removing magento/module-graph-ql-server (1.0.2)
- Removing magento/module-service-proxy (2.6.0)
- Removing magento/module-services-id (3.2.5)
- Removing magento/module-services-id-layout (1.1.3)
- Removing magento/payment-services (2.6.0)
- Removing magento/services-connector (1.3.5)
- Removing magento/services-id (3.2.5)
I am seeing this issue on a production upgrade to 2.4.7-p1 with no disabled modules - does anyone have a workaround / fix to get the backend working again?
I am seeing this issue on a production upgrade to 2.4.7-p1 with no disabled modules - does anyone have a workaround / fix to get the backend working again?
I have same problem. Any update?
Thrown exception does not show which entries are invalid...
Currently the only sane way to deal with this is to change the title attribute use property from required to optional for acl_merged.xsd file
Obviously it would be better to fix invalid entries :)
Index: vendor/magento/framework/Acl/etc/acl_merged.xsd
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/vendor/magento/framework/Acl/etc/acl_merged.xsd b/vendor/magento/framework/Acl/etc/acl_merged.xsd
--- a/vendor/magento/framework/Acl/etc/acl_merged.xsd
+++ b/vendor/magento/framework/Acl/etc/acl_merged.xsd (date 1726464310816)
@@ -21,7 +21,7 @@
</xs:sequence>
<xs:attribute name="id" type="typeId" use="required" />
- <xs:attribute name="title" type="typeTitle" use="required" />
+ <xs:attribute name="title" type="typeTitle" use="optional" />
<xs:attribute name="translate" type="xs:string" use="optional" />
<xs:attribute name="sortOrder" type="xs:int" use="optional" />
<xs:attribute name="disabled" type="xs:boolean" use="optional" />
After debugging the merged DOM result, I found out that the faulty ACL XML file is the one from the module Magento_ServiceProxy, which defines the Magento_PaymentServicesDashboard::paymentservices resource without a title.
A working workaround is to add its title in a custom acl.xml somewhere in your modules:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
<acl>
<resources>
<resource id="Magento_Backend::admin">
<resource id="Magento_Sales::sales">
<resource id="Magento_Sales::sales_operation">
<resource id="Magento_PaymentServicesDashboard::paymentservices" title="Payment Services" translate="title"/>
</resource>
</resource>
</resource>
</resources>
</acl>
</config>
After debugging the merged DOM result, I found out that the faulty ACL XML file is the one from the module Magento_ServiceProxy, which defines the
Magento_PaymentServicesDashboard::paymentservicesresource without a title.A working workaround is to add its title in a custom acl.xml somewhere in your modules:
<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> <resource id="Magento_Sales::sales"> <resource id="Magento_Sales::sales_operation"> <resource id="Magento_PaymentServicesDashboard::paymentservices" title="Payment Services" translate="title"/> </resource> </resource> </resource> </resources> </acl> </config>
This was the problem for me, causing infinite redirect loops when logging in to the admin.
Hi @OvalMedia,
Thanks for your reporting and collaboration.
We have verified the issue in Magento 2.4.7-p1 and 2.4.8-beta1 instance and the issue is no more reproducible.Kindly refer the screenshots.
Admin Panel working as expected.
Hence we are closing this issue.
Thanks.
@engcom-Bravo I still can reproduce the issue in 2.4.7-p4.
I just recently upgraded a shop to 2.4.7-p4 and I can confirm the issue is fixed in my case. @thomas-kl1: I would assume there are other modules at play that create this error?
The problem described in the following comment of this issue: https://github.com/magento/magento2/issues/38839#issuecomment-2356281493
Hi @engcom-Delta. Thank you for working on this issue. Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:
-
- Add/Edit
Area: XXXXXlabel to the ticket, indicating the functional areas it may be related to.
- Add/Edit
-
- Verify that the issue is reproducible on
2.4-developbranchDetails
- 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!
- Verify that the issue is reproducible on
-
- If the issue is not relevant or is not reproducible any more, feel free to close it.
- Join Magento Community Engineering Slack and ask your questions in #github channel.
Hi @OvalMedia @thomas-kl1 ,
Thanks for your reporting and collaboration. We have verified the issue in Magento 2.4.7-p4 instance and the issue is not reproducible.Kindly refer the screenshots.
Steps to reproduce
- Install magento
- disable all paymentservices modules: bin/magento module:disable Magento_PaymentServicesBase Magento_PaymentServicesDashboard Magento_PaymentServicesPaypal Magento_PaymentServicesSaaSExport Magento_PaymentServicesPaypalGraphQl
- bin/magento setup:di:compile
- Login to admin panel , observe admin panel is working as expected.
Thanks.
@engcom-Delta I still can reproduce the issue in 2.4.7-p5.
I still reproduce this issues in 2.4.7-p6
I still can reproduce the issue in 2.4.7-p7.
Temporary workaround (if you must stay on 2.4.7-p1 and keep those modules off). Relax the ACL XSD constraint so the merge doesn’t die when a title is missing: Edit: vendor/magento/framework/Acl/etc/acl_merged.xsd
Change: <xs:attribute name="title" type="typeTitle" use="required" />
to: <xs:attribute name="title" type="typeTitle" use="optional" />
This is a widely used stop-gap specifically for this bug; just remember it’s a core file change, so patch it properly (e.g., with composer-patches) and plan to remove it after upgrading.
Hi @nicolasbejean ,
Thanks for your reporting and collaboration. We have verified the issue in Magento 2.4.7-p5 instance and the issue is not reproducible.Kindly refer the screenshots.
Steps to reproduce
- Install magento
- disable all paymentservices modules: php bin/magento module:disable Magento_ServiceProxy Magento_PaymentServicesPaypal Magento_PaymentServicesBase Magento_PaymentServicesDashboard Magento_PaymentServicesDashboard Magento_PaymentServicesBase Magento_PaymentServicesPaypalGraphQl Magento_PaymentServicesPaypalGraphQl Magento_PaymentServicesPaypal Magento_PaymentServicesBase Magento_PaymentServicesPaypal Magento_PaymentServicesPaypal Magento_PaymentServicesBase Magento_PaymentServicesSaaSExport Magento_PaymentServicesSaaSExport Magento_PaymentServicesBase
- php bin/magento setup:di:compile
- Login to admin panel , observe admin panel is working as expected.
Can you please re-verify or provide additional testing steps. Thanks.