Summary | Cannot load conf.xml in horde config |
Queue | Horde Framework Packages |
Queue Version | Git master |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | jan (at) horde (dot) org |
Requester | spamstop2 (at) terriertech (dot) com |
Created | 03/09/2014 (4148 days ago) |
Due | |
Updated | 03/24/2014 (4133 days ago) |
Assigned | |
Resolved | 03/24/2014 (4133 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | Yes |
Assigned to Jan Schneider
State ⇒ Resolved
Queue ⇒ Horde Framework Packages
commit 34647e69d81cc6c0a77060dbcaaf4b05caca7397
Author: Jan Schneider <jan@horde.org>
Date: Mon Mar 24 12:32:43 2014 +0100
[jan] Fix loading of configuration screen with basedir
restrictions or libxml entity loading disabled (
Bug #13025).framework/Core/lib/Horde/Config.php | 2 +-
framework/Core/package.xml | 2 ++
2 files changed, 3 insertions(+), 1 deletions(-)
Configuration page:
Mar 24 09:06:50 avocado HORDE: [horde] PHP ERROR: DOMDocument::load():
I/O warning : failed to load external entity
"/usr/local/www/horde/kronolith/config/conf.xml" [pid 5960
on line 187 of "/usr/local/share/pear/Horde/Config.php"]
The proposed patch from the previous comment fixed this issue on my side!
New Attachment: config2.patch
definitely don't load horde/config/conf.xml as an external entity.
Since this doesn't even happen deterministically, this has to be
some problem with your system/server.
libxml_disable_entity_loader(true) before the $dom->load().
When this is done it fails 100%, tried with both apache/mod_php and
nginx/php-fpm. If it doesn't for you, then my system is broken.
This shows that entity loading needs to be enabled in libxml2, even
though the file is local and doesn't include <!ENTITY.
Normally this is OK because libxml2 enables entity loading by default.
But this is going to fail in two situations:
1. For anyone using PHP-FPM, due to libxml_disable_entity_loader not
being thread safe, see https://bugs.php.net/bug.php?id=64938.
2. Starting in libxml2 2.9, it will be off by default, see
http://framework.zend.com/security/advisory/ZF2014-01.
Even if you don't want to fully enable entity loading, this can be
simply fixed using the attached patch.
definitely don't load horde/config/conf.xml as an external entity.
Since this doesn't even happen deterministically, this has to be
some problem with your system/server.
separately for Horde, and some type of interaction between php-fpm
pools. Removing open_basedir restrictions (at least temporarily) has
fixed it.
State ⇒ Not A Bug
definitely don't load horde/config/conf.xml as an external entity.
Since this doesn't even happen deterministically, this has to be some
problem with your system/server.
State ⇒ Unconfirmed
New Attachment: config.patch
Patch ⇒ Yes
Milestone ⇒
Queue ⇒ Horde Base
Summary ⇒ Cannot load conf.xml in horde config
Type ⇒ Bug
Priority ⇒ 1. Low
http://localhost/admin/config/config.php?app=<anything>, gives white
screen until web server restarted.
Reproducing: This cannot be reproduced with 100% reliability, but I
can cause it with very high probability with the following steps.
1. Restart web server
2. Go to Horde config
3. Go to Imp
4. Go to Kronolith
5. Return to Horde config
6. Reload page about 5 times
Relevant logs: syslog,
Mar 9 07:47:54 host HORDE: [horde] PHP ERROR: DOMDocument::load():
I/O warning : failed to load external entity
"/usr/share/pear/www/horde/config/conf.xml" [pid 17425 on line 187 of
"/usr/share/pear/Horde/Config.php"]
error.log,
2014/03/09 07:57:35 [error] 18034#0: *18 FastCGI sent in stderr: "PHP
message: PHP Fatal error: Call to a member function hasChildNodes()
on a non-object in /usr/share/pear/Horde/Config.php on line 204
PHP message: PHP Stack trace:
PHP message: PHP 1. {main}()
/usr/share/pear/www/horde/admin/config/config.php:0
PHP message: PHP 2. Horde_Config_Form->__construct()
/usr/share/pear/www/horde/admin/config/config.php:35
PHP message: PHP 3. Horde_Config->readXMLConfig()
/usr/share/pear/Horde/Config/Form.php:67" while reading response
header from upstream, client: 127.0.0.1, server: localhost, request:
"GET /admin/config/config.php?app=horde HTTP/1.1", upstream:
"fastcgi://unix:/var/run/php5-fpm.sock:", host: "localhost", referrer:
"http://localhost/admin/config/"
Cause: Appears to be the same root problem and solution described at
http://pyd.io/f/topic/failed-to-load-external-entity-boot-confmanifest-xml/page/3/#post-72211
Solution: Add call to libxml_disable_entity_loader(false) before
loading conf.xml in /usr/share/pear/Horde/Config.php (see patch).
Environment: Horde 5.1.5, php 5.3.3, libxml2 2.7.6.