0

I'm encountering a critical error in my Magento 2.4.6-p13 installation when the admin panel tries to render the notification area. The error appears in the exception logs but doesn't always break the page - it seems intermittent.

Error Details

[2025-11-19T07:07:44.087321+00:00] main.CRITICAL: ValueError: DOMDocument::loadXML(): Argument #1 ($source) must not be empty in /var/www/html/vendor/magento/framework/View/Element/UiComponent/Config/DomMerger.php:322
Stack trace:
#0 /var/www/html/vendor/magento/framework/View/Element/UiComponent/Config/DomMerger.php(322): DOMDocument->loadXML('')
#1 /var/www/html/vendor/magento/framework/View/Element/UiComponent/Config/DomMerger.php(391): Magento\Framework\View\Element\UiComponent\Config\DomMerger->createDomDocument('')
#2 /var/www/html/vendor/magento/framework/View/Element/UiComponent/Config/Reader.php(60): Magento\Framework\View\Element\UiComponent\Config\DomMerger->merge('')
#3 /var/www/html/vendor/magento/framework/View/Element/UiComponent/Config/Reader.php(47): Magento\Framework\View\Element\UiComponent\Config\Reader->readFiles(Array)
#4 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(121): Magento\Framework\View\Element\UiComponent\Config\Reader->__construct(Object(Magento\Framework\View\Element\UiComponent\Config\FileCollector\AggregatedFileCollector), Object(Magento\Framework\View\Element\UiComponent\Config\Converter), Object(Magento\Framework\View\Element\UiComponent\Config\DomMerger))
#5 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array)
#6 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Framewo...', Array)
#7 /var/www/html/vendor/magento/framework/View/Element/UiComponent/Config/ReaderFactory.php(40): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Framewo...', Array)
#8 /var/www/html/vendor/magento/framework/View/Element/UiComponent/Config/Provider/Template.php(105): Magento\Framework\View\Element\UiComponent\Config\ReaderFactory->create(Array)
#9 /var/www/html/vendor/magento/framework/View/TemplateEngine/Xhtml.php(78): Magento\Framework\View\Element\UiComponent\Config\Provider\Template->getTemplate(false)
#10 /var/www/html/vendor/magento/framework/View/Element/UiComponent/ContentType/Xml.php(66): Magento\Framework\View\TemplateEngine\Xhtml->render(Object(Magento\Ui\Component\Listing), false)
#11 /var/www/html/vendor/magento/module-ui/Component/AbstractComponent.php(158): Magento\Framework\View\Element\UiComponent\ContentType\Xml->render(Object(Magento\Ui\Component\Listing), 'templates/listi...')
#12 /var/www/html/vendor/magento/module-ui/Component/Wrapper/UiComponent.php(72): Magento\Ui\Component\AbstractComponent->render()
#13 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(1128): Magento\Ui\Component\Wrapper\UiComponent->_toHtml()
#14 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(1132): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}()
#15 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(676): Magento\Framework\View\Element\AbstractBlock->_loadCache()
#16 /var/www/html/generated/code/Magento/Ui/Component/Wrapper/UiComponent/Interceptor.php(23): Magento\Framework\View\Element\AbstractBlock->toHtml()
#17 /var/www/html/vendor/magento/framework/View/Layout.php(591): Magento\Ui\Component\Wrapper\UiComponent\Interceptor->toHtml()
#18 /var/www/html/vendor/magento/framework/View/Layout.php(553): Magento\Framework\View\Layout->_renderUiComponent('notification_ar...')
#19 /var/www/html/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement('notification_ar...')
#20 /var/www/html/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement('notification_ar...', false)
#21 /var/www/html/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer('notifications', false)
#22 /var/www/html/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement('notifications')
#23 /var/www/html/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement('notifications', false)
#24 /var/www/html/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer('notices.wrapper', false)
#25 /var/www/html/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement('notices.wrapper')
#26 /var/www/html/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement('notices.wrapper', false)
#27 /var/www/html/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer('page.wrapper', false)
#28 /var/www/html/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement('page.wrapper')
#29 /var/www/html/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement('page.wrapper', false)
#30 /var/www/html/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer('backend.page', false)
#31 /var/www/html/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement('backend.page')
#32 /var/www/html/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement('backend.page', false)
#33 /var/www/html/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer('root', false)
#34 /var/www/html/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement('root')
#35 /var/www/html/vendor/magento/framework/View/Layout.php(975): Magento\Framework\View\Layout->renderElement('root')
#36 /var/www/html/generated/code/Magento/Framework/View/Layout/Interceptor.php(41): Magento\Framework\View\Layout->getOutput()
#37 /var/www/html/vendor/magento/framework/View/Result/Page.php(260): Magento\Framework\View\Layout\Interceptor->getOutput()
#38 /var/www/html/vendor/magento/framework/View/Result/Layout.php(171): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#39 /var/www/html/generated/code/Magento/Backend/Model/View/Result/Page/Interceptor.php(23): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#40 /var/www/html/vendor/magento/framework/App/Http.php(120): Magento\Backend\Model\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#41 /var/www/html/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http->launch()
#42 /var/www/html/pub/index.php(30): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#43 {main} {"exception":"[object] (ValueError(code: 0): DOMDocument::loadXML(): Argument #1 ($source) must not be empty at /var/www/html/vendor/magento/framework/View/Element/UiComponent/Config/DomMerger.php:322)"} []
[2025-11-19T07:07:44.625824+00:00] main.CRITICAL: ValueError: DOMDocument::loadXML(): Argument #1 ($source) must not be empty in /var/www/html/vendor/magento/framework/View/Element/UiComponent/Config/DomMerger.php:322
Stack trace:

Context

  • Magento Version: 2.4.6-p13
  • PHP Version: 8.2
  • Error occurs: When rendering admin notification area UI component
  • Frequency: Intermittent - appears multiple times in logs.

What I've Tried

  1. Searched for empty/malformed XML files:

    find app/code -path "*/ui_component/*.xml" -type f -exec sh -c 'if [ $(wc -c < "$1") -lt 100 ]; then echo "$1"; fi' _ {} \;
    

    No unusually small files found.

  2. Checked for custom overrides:

    grep -r "notification_area" app/code --include="*.xml"
    grep -r "notification_area" app/design --include="*.xml"
    

    No custom overrides of notification_area.xml found.

  3. Verified core file exists and is valid:

    cat vendor/magento/module-admin-notification/view/adminhtml/ui_component/notification_area.xml
    

    File exists and contains valid XML with proper <listing> structure.

  4. Checked for broken symlinks:

    find app/code -path "*/ui_component/*.xml" -type l
    

    No broken symlinks found.

Analysis

The stack trace shows:

  • DomMerger->merge('') is being called with an empty string at line #2
  • This happens during Reader->readFiles(Array) at line #3
  • The AggregatedFileCollector must be collecting a file that returns empty content
  • Specifically happening when rendering notification_area UI component

Questions

  1. How can I debug which file is returning empty content to the FileCollector? The readFiles() method receives an array of files - how do I log/inspect this array?

  2. Is this a known caching issue? Would clearing var/cache, var/page_cache, var/view_preprocessed, and generated/* resolve this?

  3. Could this be caused by a disabled module that previously declared a UI component extension that's now referenced but file doesn't exist?

  4. What's the proper way to trace the UI component file collection process to find the problematic file?

Environment Details

  • Running in Docker with PHP-FPM 8.2
  • 60+ custom modules under app/code/
  • Custom admin theme at app/design/adminhtml/
  • No recent module enable/disable changes

What I Need

A systematic approach to:

  1. Identify which file path is returning empty content
  2. Understand why the FileCollector is including a non-existent or empty file
  3. Prevent this error from recurring after fix

Any guidance on debugging Magento 2's UI Component file collection and merging process would be greatly appreciated.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.