8000 [WARNING 1549] failed to load external entity · Issue #9731 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[WARNING 1549] failed to load external entity #9731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Dec 10, 2013 · 18 comments
Closed

[WARNING 1549] failed to load external entity #9731

ghost opened this issue Dec 10, 2013 · 18 comments
Labels

Comments

@ghost
Copy link
ghost commented Dec 10, 2013

In two Symfony 2.4.0 projects I get these errors once in a while:

[WARNING 1549] failed to load external entity 
[ERROR 1757] Failed to locate the main schema resource

After manual removing the dev and prod cache dirs and log files I get other errors:

InvalidArgumentException: [WARNING 1549] failed to load external entity 
[WARNING 3084] Element '{http://www.w3.org/2001/XMLSchema}import': Failed to locate a schema
InvalidArgumentException: Unable to parse file "D:\srv\www\sfx\app/config/config_dev.xml".

There are 2 ways I can bypass this error:

  1. Restart the server. (Apache/2.4.6 (Win64) | MySQL 5.6.14 | PHP 5.5.6 | Xdebug 2.2.3)
  2. In \vendor\symfony\symfony\src\Symfony\Component\Config\Util\XmlUtils.php line 90, comment out "throw new \InvalidArgumentException(implode("\n", $messages), 0, $e);". After this a browser refresh the page loads correctly and I can uncomment that line again.

The full error report is here: http://pastebin.com/jMfdB20u

@henrikbjorn
Copy link
Contributor

I can verify i have seen theese aswell from time to time. Also they are very prevalent on Google Appe Engine.

@jakzal
Copy link
Contributor
jakzal commented Dec 10, 2013

re #9483

8000

@ghost
Copy link
Author
ghost commented Dec 10, 2013

It might be related, but I don't run GAE. Just a WAMP setup.

@cordoval
Copy link
Contributor

try to remove/disable xdebug and see if you get it, this error is related on the php implementation, it only happens on the SDK of GAE and if i run it in a linux box it does work perfectly, this was a problem at some point but got resolved and the issue was quiet blur and because of php.

@ghost
Copy link
Author
ghost commented Dec 23, 2013

I tried disabling xdebug before and the issue was still there. I just checked the loaded extensions and memcache was also loaded. I disabled that one and will monitor how it goes. Right now besides xdebug no 3rd party extensions are loaded.

@ghost
Copy link
Author
ghost commented Jan 7, 2014

Even when all 3rd party extensions are disabled, the error is still there once in a while. The error is only triggered by Symfony based apps. Apps based and services based on other frameworks (ZF2 and CI) do not trigger this error.

@gondo
Copy link
Contributor
gondo commented Jan 19, 2014

same here

@nicodemuz
Copy link
Contributor

same here

php --version
PHP 5.5.3-1ubuntu2 (cli) (built: Oct 9 2013 14:49:12)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans

@nicodemuz
Copy link
Contributor

Restarting php5-fpm seemed to solve the issue for me.

@rubao
Copy link
rubao commented Mar 12, 2014

re https://bugs.php.net/bug.php?id=62577

@krizepet
Copy link

Has anyone fixed the problem? I've tried everything suggested in this and other topics and nothing worked.. :/
Restarting, upgrading PHP/Apache, commenting the line, even downgrading symfony to 2.3 and other bundles, running on another computer and nothing...

Thanks

@cordoval
Copy link
Contributor

did you upgrade php? 👶

@krizepet
Copy link

yes....

@romainneutron
Copy link
Contributor

I've submitted a PR in #10493 that should solve this issue, can you have a look?

@maphe
Copy link
maphe commented Mar 23, 2014

I tested the PR locally because I couldn't work because of this error... It seems to be working now.

It would be great to merge the fix.

fabpot added a commit that referenced this issue Mar 26, 2014
…tity_loader usage (romainneutron)

This PR was merged into the 2.3 branch.

Discussion
----------

[2.3] Fix libxml_use_internal_errors and libxml_disable_entity_loader usage

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #9731, #9483
| License       | MIT

This should fix #9731 and #9483 that seems to be triggered when `libxml_disable_entity_loader` has been called with `true` (see https://bugs.php.net/bug.php?id=62577)
As `libxml_disable_entity_loader` is non thread safe (see https://bugs.php.net/bug.php?id=64938) and as we have some calls that might leave the setting to `true`, I think the bug should be fixed.

I've checked the use of both `libxml_use_internal_errors` and `libxml_disable_entity_loader` among symfony code.

You can see I prefered to skip DomDocument::loadXML warnings using the `@` instead of using `LIBXML_NOERROR | LIBXML_NO_WARNING` because we can log these errors whereas libxml errors would be furtives.

 - [x] Check calls to DOMDocument::load
 - [x] Check calls to DOMDocument::loadXML
 - [x] Check calls to DOMDocument::loadHTML
 - [x] Check calls to DOMDocument::loadHTMLFile
 - [x] Add more tests

Commits
-------

489b8ae Fix libxml_use_internal_errors and libxml_disable_entity_loader usage
@fabpot fabpot closed this as completed Mar 26, 2014
@ccorliss
Copy link
Contributor

Check PR #11259 if you're still having issues with this.

@ghost
Copy link
Author
ghost commented Jul 3, 2014

@ccorliss Thanx. I just had this error again on Symfony 2.5 and PR #11259 seems to fix it.

@Adirelle
Copy link
Adirelle commented Dec 3, 2015

I'm still having this issue in dev environment from time to time, with Symfony 2.6, 2.7 and 2.8. The only workaround is to restart the process running PHP (either FPM or Apache).

Here an error report with the php modules and libraries : http://pastebin.com/0CZwwvK9

This happens in a container using only packages from Debian Jessie but it also happens in a VM with Wheezy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0