Invalid Schema
error. I don't do anything like updating packages, cleaning or flushing cache, or anything else, I don't even touch any files, I just open my local Magento 2 website, and the error is triggered.Warning: DOMDocument::schemaValidate(): Invalid Schema in path\to\magento2project\vendor\magento\framework\Config\Dom.php on line 311
I inspected who triggered the errors and warnings, and I found that the errors and warnings are fired when DOM tries to validate path\to\magento2project\vendor\magento\framework\ObjectManager\etc\config.xsd
line 104, 105, 135 and 141.
DOM tries to validate path\to\magento2projectvendor\magento\framework\ObjectManager\etcconfig.xsd
XSD file usually isn't the file that gets validated, but the schema to which XML files must conform. In this case, my guess would be that you have an invalid "config.xml" file in one of your modules.
I agree though that it's a bit unpredictable and counter-intuitive how Magento2 decides whether to validate these. I believe it is supposed to depend on current mode you're in, but some control over it via bin/magento commands certainly wouldn't hurt. The error messages aren't perfect as well: hard to tell what caused it, as evidenced by the case above.
P.S. You might find the following link useful while debugging these.
Hi @korostii, thanks for the links.
Here is what I got when I dumped the errors: DOMDocument::schemaValidate(): Invalid Schema
Could you give a check and inspect why is the error triggered?
Oh wow, not even sure what am I looking at here. I don't see any info hinting at the cause here.
I would try generating urn links using this command
bin/magento dev:urn-catalog:generate .idea/misc.xml
and then inspect any 3rd party XML files via PHPStorm, it should actually highlight the errors.
It solved itself after upgrading to 2.1.5, what a magic.
apache resart fixes it.
Most helpful comment
apache resart fixes it.