Magento2: DOMDocument::schemaValidate(): Invalid Schema

Created on 14 Feb 2017  路  5Comments  路  Source: magento/magento2

Preconditions

  1. Windows 10
  2. Magento 2.1.2
  3. Apache 2.4.23
  4. PHP 7.0.10
  5. MySQL 5.6.30

Steps to reproduce

  1. Yesterday everything was ok, no errors or warnings.
  2. Today when I open my local Magento 2, I get a 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.

Expected result

  1. I'm able to see my local Magento 2 website as usual.

Actual result

  1. The following warning and error is triggered:
    Warning: DOMDocument::schemaValidate(): Invalid Schema in path\to\magento2project\vendor\magento\framework\Config\Dom.php on line 311
    image

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.

Format is valid

Most helpful comment

apache resart fixes it.

All 5 comments

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.

Was this page helpful?
0 / 5 - 0 ratings