magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

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

Open OvalMedia opened this issue 1 year ago • 13 comments

Preconditions and environment

  • Magento version: 2.4.7-p1
  • PHP 8.2
  • Fresh install, no other modifications

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

  • [ ] 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”.

OvalMedia avatar Jun 18 '24 14:06 OvalMedia

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:


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.

m2-assistant[bot] avatar Jun 18 '24 14:06 m2-assistant[bot]

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: XXXXX label to the ticket, indicating the functional areas 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 Jun 18 '24 14:06 m2-assistant[bot]

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.

engcom-Delta avatar Jun 19 '24 13:06 engcom-Delta

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.

OvalMedia avatar Jun 20 '24 12:06 OvalMedia

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

engcom-Delta avatar Jun 24 '24 13:06 engcom-Delta

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

github-jira-sync-bot avatar Jun 24 '24 13:06 github-jira-sync-bot

: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.

m2-assistant[bot] avatar Jun 24 '24 13:06 m2-assistant[bot]

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

github-jira-sync-bot avatar Jun 24 '24 13:06 github-jira-sync-bot

This one is quite annoying

elioermini avatar Jun 24 '24 15:06 elioermini

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 avatar Jun 24 '24 15:06 OvalMedia

@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": "*"
     }
  1. Run composer update adobe-commerce/* magento/*
  2. 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.

hostep avatar Jun 24 '24 15:06 hostep

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 avatar Jun 24 '24 15:06 OvalMedia

@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)

elioermini avatar Jun 28 '24 15:06 elioermini

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?

gaiterjones avatar Jul 25 '24 05:07 gaiterjones

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?

gntlby avatar Jul 25 '24 11:07 gntlby

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" />

adamwaclawczyk avatar Sep 16 '24 06:09 adamwaclawczyk

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>

DBMdebussac avatar Sep 17 '24 15:09 DBMdebussac

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>

This was the problem for me, causing infinite redirect loops when logging in to the admin.

RichardOutram avatar Oct 09 '24 09:10 RichardOutram

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.

Screenshot 2024-10-28 at 14 50 43

Dashboard-Magento-Admin-10-28-2024_02_00_PM

Dashboard-Magento-Admin-10-28-2024_02_51_PM

Admin Panel working as expected.

Hence we are closing this issue.

Thanks.

engcom-Bravo avatar Oct 28 '24 11:10 engcom-Bravo

@engcom-Bravo I still can reproduce the issue in 2.4.7-p4.

thomas-kl1 avatar Mar 03 '25 16:03 thomas-kl1

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?

OvalMedia avatar Mar 03 '25 16:03 OvalMedia

The problem described in the following comment of this issue: https://github.com/magento/magento2/issues/38839#issuecomment-2356281493

thomas-kl1 avatar Mar 03 '25 21:03 thomas-kl1

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:

    1. Add/Edit Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- 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!
    1. If the issue is not relevant or is not reproducible any more, feel free to close it.

m2-assistant[bot] avatar Mar 04 '25 08:03 m2-assistant[bot]

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

  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

Image

  1. Login to admin panel , observe admin panel is working as expected.

Image

Thanks.

engcom-Delta avatar Mar 04 '25 12:03 engcom-Delta

@engcom-Delta I still can reproduce the issue in 2.4.7-p5.

nicolasbejean avatar Jun 11 '25 08:06 nicolasbejean

Image

I still reproduce this issues in 2.4.7-p6

salim-dcakp avatar Jun 21 '25 11:06 salim-dcakp

I still can reproduce the issue in 2.4.7-p7.

mdykas386 avatar Sep 10 '25 10:09 mdykas386

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.

tgozdziewski avatar Sep 10 '25 10:09 tgozdziewski

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

  1. Install magento
  2. 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
  3. php bin/magento setup:di:compile
  4. Login to admin panel , observe admin panel is working as expected.
Image

Can you please re-verify or provide additional testing steps. Thanks.

engcom-Delta avatar Nov 21 '25 10:11 engcom-Delta