3

I'm testing Upgrade to Magento 2.4 but getting the error below. I've read that this error can relate to a missing title attribute in a custom extension. To try and isolate teh issue I have remove all the extensions from /app/code/ folder and then ran upgrade , compile process again but the issue still remains even with all extensions removed.

Any idea how to debug?

1 exception(s):
Exception #0 (LogicException): Could not create an acl object: Invalid Document 
Element 'resource': The attribute 'title' is required but missing.
Line: 13


Exception #0 (LogicException): Could not create an acl object: Invalid Document 
Element 'resource': The attribute 'title' is required but missing.
Line: 13

<pre>#1 Magento\Framework\Acl\Builder\Proxy->getAcl() called at [vendor/magento/module-backend/Model/Auth/Session.php:229]
#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/framework/Interception/Interceptor.php:153]
#6 Magento\Backend\Model\Auth\Interceptor->___callPlugins() called at [generated/code/Magento/Backend/Model/Auth/Interceptor.php:26]
#7 Magento\Backend\Model\Auth\Interceptor->login() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:205]
#8 Magento\Backend\App\Action\Plugin\Authentication->_performLogin() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:157]
#9 Magento\Backend\App\Action\Plugin\Authentication->_processNotLoggedInUser() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:125]
#10 Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#11 Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#12 Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->___callPlugins() called at [generated/code/Magento/Backend/Controller/Adminhtml/Index/Index/Interceptor.php:39]
#13 Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:186]
#14 Magento\Framework\App\FrontController->processRequest() called at [vendor/magento/framework/App/FrontController.php:118]
#15 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#16 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#17 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#18 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:26]
#19 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:116]
#20 Magento\Framework\App\Http->launch() called at [vendor/magento/framework/App/Bootstrap.php:263]
#21 Magento\Framework\App\Bootstrap->run() called at [sitemaps/speedcrete/htdocs/index.php:44]
user552769
  • 361
  • 6
  • 20

3 Answers3

5

Merged ACL is validated in development mode using ./vendor/magento/framework/Acl/etc/acl_merged.xsd. Attribute title is required there:

<xs:attribute name="title" type="typeTitle" use="required" />

Try to set breakpoint in ./vendor/magento/framework/Config/Reader/Filesystem.php:169 and get merged XML with:

$configMerger->getDom()->saveXML();

Then use online validator like https://www.freeformatter.com/xml-validator-xsd.html to validate your XML against XSD (use ./vendor/magento/framework/Acl/etc/acl.xsd with required title attribute).

In my case I've disabled some magento modules (Magento_InventoryApi, Magento_InventoryInStorePickupApi):

<resource id="Magento_InventoryApi::inventory" title="Inventory" ... />
<resource id="Magento_InventoryInStorePickupApi::inStorePickup" title="In-Store Pickup" ... />

but I've not disabled dependent module (Magento_InventoryInStorePickupSalesApi):

<resource id="Magento_InventoryApi::inventory">
    <resource id="Magento_InventoryInStorePickupApi::inStorePickup">
        <resource id="Magento_InventoryInStorePickupApi::notify_orders_are_ready_for_pickup" title="Notify Orders Are Ready For Pickup" ... />
    </resource>
</resource>

So, my merged ACL was like:

<resource id="Magento_InventoryApi::inventory">
    <resource id="Magento_InventoryInStorePickupApi::inStorePickup">
        <resource id="Magento_InventoryInStorePickupApi::notify_orders_are_ready_for_pickup"
                  title="Notify Orders Are Ready For Pickup" translate="title" sortOrder="30"/>
    </resource>
</resource>

without required attribute title for resource node.

Alex Gusev
  • 1,526
  • 3
  • 16
  • 35
  • 1
    This should be the accepted answer. For me also the module Magento_InventoryApi was disabled. TY – Andreas Daoutis Nov 20 '20 at 20:25
  • This answer Is correct. II found the wrong module config by uncommenting the whole `if ($this->validationState->isValidationRequired()) {` block, so an error was thrown that directly showed the module. => No need to paste and validate the XML. – skymeissner Aug 17 '22 at 09:13
3

I had the same issue and the reason was that I had disabled MSI modules. Try to enable these modules again and possibly it will work again.

php bin/magento module:enable -f Magento_Inventory Magento_InventoryAdminUi Magento_InventoryAdvancedCheckout Magento_InventoryApi Magento_InventoryBundleProduct Magento_InventoryBundleProductAdminUi Magento_InventoryCatalog Magento_InventorySales Magento_InventoryCatalogAdminUi Magento_InventoryCatalogApi Magento_InventoryCatalogSearch Magento_InventoryConfigurableProduct Magento_InventoryConfigurableProductAdminUi Magento_InventoryConfigurableProductIndexer Magento_InventoryConfiguration Magento_InventoryConfigurationApi Magento_InventoryDistanceBasedSourceSelection Magento_InventoryDistanceBasedSourceSelectionAdminUi Magento_InventoryDistanceBasedSourceSelectionApi Magento_InventoryElasticsearch Magento_InventoryExportStockApi Magento_InventoryIndexer Magento_InventorySalesApi Magento_InventoryGroupedProduct Magento_InventoryGroupedProductAdminUi Magento_InventoryGroupedProductIndexer Magento_InventoryImportExport Magento_InventorySourceSelectionApi Magento_InventoryCache Magento_InventoryLowQuantityNotification Magento_InventoryLowQuantityNotificationApi Magento_InventoryMultiDimensionalIndexerApi Magento_InventoryProductAlert Magento_InventoryRequisitionList Magento_InventoryReservations Magento_InventoryReservationCli Magento_InventoryReservationsApi Magento_InventoryExportStock Magento_InventorySalesAdminUi Magento_InventorySalesFrontendUi Magento_InventorySetupFixtureGenerator Magento_InventoryShipping Magento_InventoryShippingAdminUi Magento_InventorySourceDeductionApi Magento_InventorySourceSelection Magento_InventoryLowQuantityNotificationAdminUi Magento_InventoryGraphQl

Don't forget to flush, reindex and compile if in production mode.

This is for Magento v2.4.1

1

It works for me Alex. Thanks!

In my case, this configuration generates the xml error.

    'Magento_LoginAsCustomer' => 0,
    'Magento_LoginAsCustomerAdminUi' => 0,
    'Magento_LoginAsCustomerApi' => 0,
    'Magento_LoginAsCustomerAssistance' => 1,
    'Magento_LoginAsCustomerFrontendUi' => 0,
    'Magento_LoginAsCustomerLog' => 0,
    'Magento_LoginAsCustomerLogging' => 0,
    'Magento_LoginAsCustomerPageCache' => 0,
    'Magento_LoginAsCustomerQuote' => 0,
    'Magento_LoginAsCustomerSales' => 0,
    'Magento_LoginAsCustomerWebsiteRestriction' => 0,

Then disabling Magento_LoginAsCustomerAssistance or enabling the other ones, it works!