libxml / DOMDocument parse error (Symfony)
Hi all. Just installed the nightly build in a vagrant set up (Ubuntu 14.04 64 bit) and tried to fire up a Symfony 2.5 project and am encountering the following:
InvalidArgumentException: Unable to parse file "/var/www/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/../Resources/config/web.xml".
in /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php line 220
at XmlFileLoader->parseFileToDOM('/var/www/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/../Resources/config/web.xml') in /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php line 41
at XmlFileLoader->load('web.xml') in /var/www/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php line 48
at FrameworkExtension->load(array(array('secret' => 'ThisTokenIsNotSoSecretChangeIt', 'router' => array('resource' => '/var/www/app/config/routing.yml', 'strict_requirements' => null), 'form' => null, 'csrf_protection' => null, 'validation' => array('enable_annotations' => true), 'templating' => array('engines' => array('twig')), 'default_locale' => 'en', 'trusted_hosts' => null, 'trusted_proxies' => null, 'session' => array('handler_id' => null), 'fragments' => null, 'http_method_override' => true), array('router' => array('resource' => '/var/www/app/config/routing_dev.yml', 'strict_requirements' => true), 'profiler' => array('only_exceptions' => false))), object(ContainerBuilder)) in /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php line 50
at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in /var/www/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php line 39
at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php line 117
at Compiler->compile(object(ContainerBuilder)) in /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php line 613
at ContainerBuilder->compile() in /var/www/app/bootstrap.php.cache line 2524
at Kernel->initializeContainer() in /var/www/app/bootstrap.php.cache line 2303
at Kernel->boot() in /var/www/app/bootstrap.php.cache line 2334
at Kernel->handle(object(Request)) in /var/www/web/app_dev.php line 28
1/2 InvalidArgumentException: [ERROR 3067] Element '{http://www.w3.org/2001/XMLSchema}import': Failed to parse the XML resource 'file:////var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd'. (in in_memory_buffer - line 8, column 0)
in /var/www/vendor/symfony/symfony/src/Symfony/Component/Config/Util/XmlUtils.php line 96
at XmlUtils::loadFile('/var/www/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/../Resources/config/web.xml', array(object(XmlFileLoader), 'validateSchema')) in /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php line 218
at XmlFileLoader->parseFileToDOM('/var/www/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/../Resources/config/web.xml') in /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php line 41
at XmlFileLoader->load('web.xml') in /var/www/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php line 48
at FrameworkExtension->load(array(array('secret' => 'ThisTokenIsNotSoSecretChangeIt', 'router' => array('resource' => '/var/www/app/config/routing.yml', 'strict_requirements' => null), 'form' => null, 'csrf_protection' => null, 'validation' => array('enable_annotations' => true), 'templating' => array('engines' => array('twig')), 'default_locale' => 'en', 'trusted_hosts' => null, 'trusted_proxies' => null, 'session' => array('handler_id' => null), 'fragments' => null, 'http_method_override' => true), array('router' => array('resource' => '/var/www/app/config/routing_dev.yml', 'strict_requirements' => true), 'profiler' => array('only_exceptions' => false))), object(ContainerBuilder)) in /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php line 50
at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in /var/www/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php line 39
at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php line 117
at Compiler->compile(object(ContainerBuilder)) in /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php line 613
at ContainerBuilder->compile() in /var/www/app/bootstrap.php.cache line 2524
at Kernel->initializeContainer() in /var/www/app/bootstrap.php.cache line 2303
at Kernel->boot() in /var/www/app/bootstrap.php.cache line 2334
at Kernel->handle(object(Request)) in /var/www/web/app_dev.php line 28
Seems as though \DOMDocument::schemaValidateSource is returning false when it shouldn't be. I can paste the XML file it's trying to parse if you'd like, or give any more info if needed.
The same error with Symfony 2.6 when trying to run app/console cache:clear on Ubuntu 14.04
HipHop VM 3.4.0 (rel)
Compiler: tags/HHVM-3.4.0-0-g817b3a07fc4e509ce15635dbc87778e5b3496663
Repo schema: 0e12aaa31fae66b5591f65603de50c9d62caafac
Extension API: 20140829
try putting the following line in php.ini:
hhvm.libxml.ext_entity_whitelist = file,http
This issue has been around since the beginning of 3.x
@matthiasbrock It helped, thanx!
Sorry - our error message says to try that setting if you're sure it's safe. We can't do much when our error is caught and turned into something less specific :(
We don't want to change this behavior as it is a security issue.
Thank you very much everyone.
I'm suffering the same error with HHVM 3.8.1 and Symfony 2.7.3 . Why this bug is closed?
Because we provide an error message that says exactly how to work around it if you're certain the security implications of the setting aren't a problem for you.
Symfony decides to hide this from you; we can't do anything about that.