0

I am having an issue upgrading to 2.2.2 from 2.1.9. The following occurs when I load the frontend:

1 exception(s):
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block': This element is not expected. Expected is one of ( title, css, link, meta, script, remove, attribute ).
Line: 56


Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block': This element is not expected. Expected is one of ( title, css, link, meta, script, remove, attribute ).
Line: 56

#0 /var/www/magento/vendor/magento/framework/Config/Dom.php(116): Magento\Framework\Config\Dom->_initDom('<layout xmlns:x...')
#1 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Magento\Framework\Config\Dom->__construct('<layout xmlns:x...', Object(Magento\Framework\App\Arguments\ValidationState), Array, NULL, '/var/www/magent...', '%message%\nLine:...')
#2 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array)
#3 /var/www/magento/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...', Array)
#4 /var/www/magento/vendor/magento/framework/Config/DomFactory.php(42): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Framewo...', Array)...

Looks like the layout xml is not valid but cannot tell where to look. I logged out the xml, but there is tons and dont know where this might be. I looked for where this exception is thrown, however could not find this message anywhere.

1 Answer 1

0

One of your xml files have some invalid parameter called 'block' check all your theme and extensions xml files for word block= or <block or something similar You should be able to find it quickly and resolve you issue.

2
  • I have been doing searches on my theme and code base but nothing sticks out.
    – sudopratt
    Commented Jan 30, 2018 at 21:36
  • It is definitely an xml issue. You can try to load a default luma theme instead of your custom theme (change it via database or admin if it loads). - if error keeps poping up - problem in one of your extensions. If problem disappears - your theme has an error. I hope this will help you. Other way to solve this - go to validation function and check a xml that is throwing an error - this would give you an exact xml where this error exists - by that you will be able to find it. Search through whole project.
    – Macas
    Commented Jan 31, 2018 at 8:28

Your Answer

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

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