16

Whenever I edit or add a product attribute, I receive a error with the header

"There has been an error processing your request"

and body saying

"Object DOMDocument should be created."

The error log reads :
" a:4:{i:0;s:37:"Object DOMDocument should be created.";i:1;s:10125:"#0 /home/puffpackage/public_html/vendor/magento/framework/View/Element/UiComponent/Config/Reader.php(95): Magento\Framework\View\Element\UiComponent\Config\DomMerger->getDom()
#1 /home/puffpackage/public_html/vendor/magento/module-ui/Model/Manager.php(261): Magento\Framework\View\Element\UiComponent\Config\Reader->read()
#2 /home/puffpackage/public_html/vendor/magento/module-ui/Model/Manager.php(169): Magento\Ui\Model\Manager->prepare('form_schedule_b...')
#3 /home/puffpackage/public_html/vendor/magento/framework/View/Element/UiComponentFactory.php(139): Magento\Ui\Model\Manager->prepareData('form_schedule_b...')
#4 /home/puffpackage/public_html/vendor/magento/framework/View/Layout/Generator/UiComponent.php(125): Magento\Framework\View\Element\UiComponentFactory->create('form_schedule_b...', NULL, Array)
#5 /home/puffpackage/public_html/vendor/magento/framework/View/Layout/Generator/UiComponent.php(93): Magento\Framework\View\Layout\Generator\UiComponent->generateComponent(Object(Magento\Framework\View\Layout\Data\Structure), 'form_schedule_b...', Array, Object(Magento\Framework\View\Layout\Interceptor))
#6 /home/puffpackage/public_html/vendor/magento/framework/View/Layout/GeneratorPool.php(86): Magento\Framework\View\Layout\Generator\UiComponent->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
#7 /home/puffpackage/public_html/vendor/magento/framework/View/Layout.php(327): Magento\Framework\View\Layout\GeneratorPool->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
#8 /home/puffpackage/public_html/var/generation/Magento/Framework/View/Layout/Interceptor.php(89): Magento\Framework\View\Layout->generateElements()
#9 /home/puffpackage/public_html/vendor/magento/framework/View/Layout/Builder.php(129): Magento\Framework\View\Layout\Interceptor->generateElements()
#10 /home/puffpackage/public_html/vendor/magento/framework/View/Page/Builder.php(55): Magento\Framework\View\Layout\Builder->generateLayoutBlocks()
#11 /home/puffpackage/public_html/vendor/magento/framework/View/Layout/Builder.php(65): Magento\Framework\View\Page\Builder->generateLayoutBlocks()
#12 /home/puffpackage/public_html/vendor/magento/framework/View/Page/Config.php(166): Magento\Framework\View\Layout\Builder->build()
#13 /home/puffpackage/public_html/vendor/magento/framework/View/Page/Config.php(475): Magento\Framework\View\Page\Config->build()
#14 /home/puffpackage/public_html/vendor/magento/framework/View/Page/Config.php(433): Magento\Framework\View\Page\Config->getElementAttribute('body', 'class')
#15 /home/puffpackage/public_html/vendor/magento/module-catalog/Controller/Adminhtml/Product/Attribute.php(90): Magento\Framework\View\Page\Config->addBodyClass('attribute-popup')
#16 /home/puffpackage/public_html/vendor/magento/module-catalog/Controller/Adminhtml/Product/Attribute/Edit.php(55): Magento\Catalog\Controller\Adminhtml\Product\Attribute->createActionPage(Object(Magento\Framework\Phrase))
#17 /home/puffpackage/public_html/var/generation/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Edit/Interceptor.php(25): Magento\Catalog\Controller\Adminhtml\Product\Attribute\Edit->execute()
#18 /home/puffpackage/public_html/vendor/magento/framework/App/Action/Action.php(102): Magento\Catalog\Controller\Adminhtml\Product\Attribute\Edit\Interceptor->execute()
#19 /home/puffpackage/public_html/vendor/magento/module-backend/App/AbstractAction.php(226): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#20 /home/puffpackage/public_html/vendor/magento/module-catalog/Controller/Adminhtml/Product/Attribute.php(72): Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http))
#21 [internal function]: Magento\Catalog\Controller\Adminhtml\Product\Attribute->dispatch(Object(Magento\Framework\App\Request\Http))
#22 /home/puffpackage/public_html/vendor/magento/framework/Interception/Interceptor.php(74): call_user_func_array(Array, Array)
#23 /home/puffpackage/public_html/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Catalog\Controller\Adminhtml\Product\Attribute\Edit\Interceptor->___callParent('dispatch', Array)
#24 /home/puffpackage/public_html/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Catalog...', 'dispatch', Object(Magento\Catalog\Controller\Adminhtml\Product\Attribute\Edit\Interceptor), Array, 'adminAuthentica...')
#25 /home/puffpackage/public_html/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#26 [internal function]: Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(Magento\Catalog\Controller\Adminhtml\Product\Attribute\Edit\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#27 /home/puffpackage/public_html/vendor/magento/framework/Interception/Chain/Chain.php(68): call_user_func_array(Array, Array)
#28 /home/puffpackage/public_html/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Catalog...', 'dispatch', Object(Magento\Catalog\Controller\Adminhtml\Product\Attribute\Edit\Interceptor), Array, 'designLoader')
#29 /home/puffpackage/public_html/vendor/magento/framework/App/Action/Plugin/Design.php(39): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#30 [internal function]: Magento\Framework\App\Action\Plugin\Design->aroundDispatch(Object(Magento\Catalog\Controller\Adminhtml\Product\Attribute\Edit\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#31 /home/puffpackage/public_html/vendor/magento/framework/Interception/Chain/Chain.php(68): call_user_func_array(Array, Array)
#32 /home/puffpackage/public_html/vendor/magento/framework/Interception/Interceptor.php(136): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Catalog...', 'dispatch', Object(Magento\Catalog\Controller\Adminhtml\Product\Attribute\Edit\Interceptor), Array, 'adminMassaction...')
#33 /home/puffpackage/public_html/vendor/magento/module-backend/App/Action/Plugin/MassactionKey.php(33): Magento\Catalog\Controller\Adminhtml\Product\Attribute\Edit\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#34 [internal function]: Magento\Backend\App\Action\Plugin\MassactionKey->aroundDispatch(Object(Magento\Catalog\Controller\Adminhtml\Product\Attribute\Edit\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#35 /home/puffpackage/public_html/vendor/magento/framework/Interception/Interceptor.php(141): call_user_func_array(Array, Array)
#36 /home/puffpackage/public_html/var/generation/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Edit/Interceptor.php(40): Magento\Catalog\Controller\Adminhtml\Product\Attribute\Edit\Interceptor->___callPlugins('dispatch', Array, Array)
#37 /home/puffpackage/public_html/vendor/magento/framework/App/FrontController.php(55): Magento\Catalog\Controller\Adminhtml\Product\Attribute\Edit\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#38 [internal function]: Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#39 /home/puffpackage/public_html/vendor/magento/framework/Interception/Interceptor.php(74): call_user_func_array(Array, Array)
#40 /home/puffpackage/public_html/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#41 /home/puffpackage/public_html/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')
#42 /home/puffpackage/public_html/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#43 [internal function]: Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#44 /home/puffpackage/public_html/vendor/magento/framework/Interception/Chain/Chain.php(68): call_user_func_array(Array, Array)
#45 /home/puffpackage/public_html/vendor/magento/framework/Interception/Interceptor.php(136): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'storeCookieVali...')
#46 /home/puffpackage/public_html/vendor/magento/module-store/Model/Plugin/StoreCookie.php(78): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#47 [internal function]: Magento\Store\Model\Plugin\StoreCookie->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#48 /home/puffpackage/public_html/vendor/magento/framework/Interception/Interceptor.php(141): call_user_func_array(Array, Array)
#49 /home/puffpackage/public_html/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#50 /home/puffpackage/public_html/vendor/magento/framework/App/Http.php(115): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#51 /home/puffpackage/public_html/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#52 /home/puffpackage/public_html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#53 {main}";s:3:"url";s:244:"/puffmin/catalog/product_attribute/new/store/0/product_tab/variations/popup/1/key/5c2a345ed1b7894fdb9bca01f9daba0c242a4451e6b492633a2d909675076f05/?attribute%5Bis_global%5D=1&attribute%5Bfrontend_input%5D=select&set=4&attribute[frontend_label]=";s:11:"script_name";s:10:"/index.php";} "
  • Can you be more specific how you tried this? via admin or editing xml files? – Maddy Dec 14 '15 at 21:44
  • From the admin page, when editing a product it has configurable which include the products attribute, I've also tried editing it from the attributes section itself and it had the same error. – David Hunt Dec 15 '15 at 5:41
  • 2
    you should check var/log/system.log in last code. – xanka Dec 15 '15 at 9:28
  • The error log reads: [2015-12-16 06:40:32] main.CRITICAL: Can't create directory /home/puffpackage/public_html/var/generation/Magento /Eav/Model/Entity/Attribute/Config/Reader/. [] [] – David Hunt Dec 16 '15 at 6:41
  • Magento 2.0 CE if it helps.. – David Hunt Dec 20 '15 at 5:29
8

Looks like var/generation is not writable. Make sure to set proper file system ownership and permissions: var, app/etc and pub/static should be writable by web server.

  • It was var/composer & symfony which had the wrong owner. I'm not sure why this ownership was wrong or why'd it'd cause this problem, but thanks for the help :) – David Hunt Dec 23 '15 at 23:47
16

Another possible reason for the Object DOMDocument should be created. error is the unaccessible ui_component/your_listing.xml file under the view/adminhtml/ folder when you want to create an Adminhtml Grid and you declare it under the view/adminhtml/layout/your_handle_index.xml as this:

<body>
    <referenceContainer name="content">
        <uiComponent name="your_listing"/>
    </referenceContainer>
</body>
  • Yep, indeed, I had this problem. Now I'm moving on to the next error :). Multumesc! – Adrian Moisa Jan 15 '17 at 10:44
  • 1
    In my case, I misspelled the directory of view/adminhtml/ – Nahid Apr 13 '17 at 3:38
  • this helps alot in my case i have some extra code in vendor/magento/framework/view/element/UiComponentFactory.php related to UI which was not supposed to be there – Asad Ullah Aug 9 at 12:42
10

Another possible reason for this error is if your class folders don't have proper capitalization (i.e. are lowercase).

var/log/system.log:

[2016-02-26 21:19:51] main.CRITICAL: Class Example\Myclass\Block\ShopCategory does not exist [] []
[2016-02-26 21:19:51] main.CRITICAL: Invalid block type: Example\Myclass\Block\ShopCategory [] []

For example, if the namespace folder is "example" rather than "Example" it will work just fine on Windows and most Mac installations, but will fail with the "Object DOMDocument should be created." error on Linux, as Linux uses a case-sensitive filesystem.

  • Thx for the hint to look into system.log. For me was a simple php notice Notice: Undefined index: regalo_mittente in /app/code/Custom/Backend/Helper/Data.php on line 50 – LucScu May 18 '17 at 7:37
  • This should be the first thing to look at. – Nicolas PERNOT Mar 22 '18 at 17:14
1

Recently during a module development I got the same kind of error. In my case I found out the real error which was:

Circular dependency: Vendor\Module\Helper\Data depends on Vendor\Module\Helper\Bot and vice versa.

I removed this dependency from the __construct method of my helpers (refactored them using one parent class) and error is gone. So I'll recommend you to check circular dependencies in your code.

Another kind of error: Fatal Error during render the component, caused by call to the not existing class from 3rd party module.

As I understand this type of error is thrown when the Fatal Error occurs during render of the component and has nothing common with an Object DOM Document.

0

Well if you have migrated your data from Magento 1 to Magento 2, and if you are getting this error on a specific page, then follow below steps:

If you are getting this error in specific product view page, Category page or any cms page then goto that product/category or CMS page edit section and goto Design section and within layout update XML if any block is added then comment that XML code or remove it and clear your cache and check on the frontend.

0

I have come across this also.. checking var/log/system.log shows open_basedir restriction in effect. File(/etc/pki/tls/certs)

removing the open_basedir restriction fixed the problem

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.