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– Maddy2015年12月14日 21:44:26 +00:00Commented Dec 14, 2015 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– David Hunt2015年12月15日 05:41:54 +00:00Commented Dec 15, 2015 at 5:41
-
2you should check var/log/system.log in last code.xanka– xanka2015年12月15日 09:28:43 +00:00Commented Dec 15, 2015 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– David Hunt2015年12月16日 06:41:41 +00:00Commented Dec 16, 2015 at 6:41
-
Magento 2.0 CE if it helps..David Hunt– David Hunt2015年12月20日 05:29:40 +00:00Commented Dec 20, 2015 at 5:29
6 Answers 6
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– David Hunt2015年12月23日 23:47:57 +00:00Commented Dec 23, 2015 at 23:47
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>
-
1Yep, indeed, I had this problem. Now I'm moving on to the next error :). Multumesc!Adrian Moisa– Adrian Moisa2017年01月15日 10:44:12 +00:00Commented Jan 15, 2017 at 10:44
-
1In my case, I misspelled the directory of
view/adminhtml/Nahid– Nahid2017年04月13日 03:38:32 +00:00Commented Apr 13, 2017 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 thereAsad Ullah– Asad Ullah2019年08月09日 12:42:00 +00:00Commented Aug 9, 2019 at 12:42
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 50LucScu– LucScu2017年05月18日 07:37:25 +00:00Commented May 18, 2017 at 7:37 -
This should be the first thing to look at.Nicolas PERNOT– Nicolas PERNOT2018年03月22日 17:14:52 +00:00Commented Mar 22, 2018 at 17:14
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.
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.
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