Skip to content
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

SVG chart library doesn't process input as UTF-8 #4462

Closed
ggzengel opened this issue Jul 19, 2021 · 6 comments · Fixed by #4480
Closed

SVG chart library doesn't process input as UTF-8 #4462

ggzengel opened this issue Jul 19, 2021 · 6 comments · Fixed by #4480
Assignees
Labels
area/framework Affects third party integration/development bug Something isn't working
Milestone

Comments

@ggzengel
Copy link

Describe the bug

In Recently Recovered Services I got: DOMDocument::saveXML(): xmlEscapeEntities : char out of range

#0 [internal function]: Icinga\Application\ApplicationBootstrap->Icinga\Application\{closure}(Integer, String, String, Integer, Array)
#1 /usr/share/php/Icinga/Chart/SVGRenderer.php(236): DOMDocument->saveXML()
#2 /usr/share/php/Icinga/Chart/Chart.php(127): Icinga\Chart\SVGRenderer->render()
#3 /usr/share/php/Icinga/Web/Widget/Chart/InlinePie.php(245): Icinga\Chart\Chart->render()
#4 /usr/share/icingaweb2/modules/monitoring/application/views/helpers/Perfdata.php(67): Icinga\Web\Widget\Chart\InlinePie->render()
#5 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(345): Zend_View_Helper_Perfdata->perfdata(String, Boolean, Integer)
#6 /usr/share/php/Icinga/Web/View.php(251): Zend_View_Abstract->__call(String, Array)
#7 /usr/share/icingaweb2/modules/monitoring/application/views/scripts/list/services.phtml(117): Icinga\Web\View->__call(String, Array)
#8 /usr/share/php/Icinga/Web/View.php(235): include(String)
#9 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run(String)
#10 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(904): Zend_View_Abstract->render(NULL)
#11 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(925): Zend_Controller_Action_Helper_ViewRenderer->renderScript(String, NULL)
#12 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(964): Zend_Controller_Action_Helper_ViewRenderer->render()
#13 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/HelperBroker.php(272): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#14 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(518): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#15 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(String)
#16 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#17 /usr/share/php/Icinga/Application/Web.php(304): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#18 /usr/share/php/Icinga/Application/webrouter.php(107): Icinga\Application\Web->dispatch()
#19 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#20 {main}

To Reproduce

I don't know where it comes from and how to reproduce

Your Environment

Icinga Web 2 Version
    2.9.0
Git commit
    3b0a0a78df9389c46d3a74611a8eaec2f2b3cc77
PHP Version
    7.3.29-1~deb10u1
Git commit date
    2021-07-12
Copyright
    © 2013-2021 Icinga GmbH 

Loaded Libraries
Name 	Version
icinga/icinga-php-library 	0.6.0
icinga/icinga-php-thirdparty 	0.10.0

Loaded Modules
Name 	Version
grafana 	1.4.2
monitoring 	2.9.0 
# dpkg-query --list "icinga*" | grep ^ii
ii  icinga-l10n                  1.1.0-1.buster  all          l10n (short for Localization) provides all translations available for Icinga.
ii  icinga-php-common            1.0.0-1.buster  all          Icinga PHP Common for Icinga Web 2
ii  icinga-php-library           0.6.0-1.buster  all          Icinga PHP Library for Icinga Web 2
ii  icinga-php-thirdparty        0.10.0-1.buster all          Icinga PHP Thirdparty for Icinga Web 2
ii  icinga2                      2.12.5-1.buster amd64        host and network monitoring system
ii  icinga2-bin                  2.12.5-1.buster amd64        host and network monitoring system - daemon
ii  icinga2-common               2.12.5-1.buster all          host and network monitoring system - common files
ii  icinga2-doc                  2.12.5-1.buster all          host and network monitoring system - documentation
ii  icinga2-ido-mysql            2.12.5-1.buster amd64        host and network monitoring system - MySQL support
ii  icingacli                    2.9.0-1.buster  all          simple CLI tool for Icingaweb2 and its modules
ii  icingaweb2                   2.9.0-1.buster  all          simple and responsive web interface for Icinga
ii  icingaweb2-common            2.9.0-1.buster  all          simple and responsive web interface for Icinga - common files
ii  icingaweb2-module-doc        2.9.0-1.buster  all          simple and responsive web interface for Icinga - documentation module
ii  icingaweb2-module-monitoring 2.9.0-1.buster  all          simple and responsive web interface for Icinga - monitoring module
# uname -a
Linux lx-icinga.hq1.local 5.10.0-0.bpo.7-amd64 #1 SMP Debian 5.10.40-1~bpo10+1 (2021-06-04) x86_64 GNU/Linux

# lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 10 (buster)
Release:	10
Codename:	buster
# icinga2 --version
icinga2 - The Icinga 2 network monitoring daemon (version: r2.12.5-1)

Copyright (c) 2012-2021 Icinga GmbH (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl2.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

System information:
  Platform: Debian GNU/Linux
  Platform version: 10 (buster)
  Kernel: Linux
  Kernel version: 5.10.0-0.bpo.7-amd64
  Architecture: x86_64

Build information:
  Compiler: GNU 8.3.0
  Build host: runner-hh8q3bz2-project-504-concurrent-0
  OpenSSL version: OpenSSL 1.1.1d  10 Sep 2019
# php --version
PHP 7.3.29-1~deb10u1 (cli) (built: Jul  2 2021 04:04:33) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.29, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.29-1~deb10u1, Copyright (c) 1999-2018, by Zend Technologies
@nilmerg nilmerg self-assigned this Jul 20, 2021
@nilmerg nilmerg added area/monitoring Affects the monitoring module bug Something isn't working area/framework Affects third party integration/development and removed area/monitoring Affects the monitoring module labels Jul 20, 2021
@nilmerg
Copy link
Member

nilmerg commented Jul 20, 2021

Hi, please apply the changes from the PR I've just opened to /usr/share/php/Icinga/Web/Widget/Chart/InlinePie.php. You should then see the list again without error.

Though this only silences the error. It's at least one service's performance data which is responsible for it, and that's what I'd want you to show me in order to reproduce and identify the actual issue.

With the patch applied, you should get two error log messages for each problematic service. (Failed to render pie chart with the following title: and Maybe also responsible:) Please show me these.

@nilmerg nilmerg added the needs-feedback We'll only proceed once we hear from you again label Jul 20, 2021
@nilmerg
Copy link
Member

nilmerg commented Jul 23, 2021

@ggzengel Any chance that you try the above? Without your feedback, I cannot fix this reliably.

@ggzengel
Copy link
Author

I was very busy these days.
I just replace the file. Now we will see.

@ggzengel
Copy link
Author

Got this:

Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Failed to render pie chart with the following title: \x01_usage_in 0% (0.00%) (015f75736167655f696e2030252028302e30302529)
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Maybe also responsible: Array    (        [0] => 0        [1] => 0        [2] => 0        [3] => 100    )    
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Failed to render pie chart with the following title: \x01_usage_out 0% (0.00%) (015f75736167655f6f75742030252028302e30302529)
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Maybe also responsible: Array    (        [0] => 0        [1] => 0        [2] => 0        [3] => 100    )    
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Failed to render pie chart with the following title: \x01_broadcast_usage_out 0% (0.00%) (015f62726f6164636173745f75736167655f6f75742030252028302e30302529)
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Maybe also responsible: Array    (        [0] => 0        [1] => 0        [2] => 0        [3] => 100    )    
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Failed to render pie chart with the following title: \x01_broadcast_usage_in 0% (0.00%) (015f62726f6164636173745f75736167655f696e2030252028302e30302529)
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Maybe also responsible: Array    (        [0] => 0        [1] => 0        [2] => 0        [3] => 100    )    
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Failed to render pie chart with the following title: \x01_broadcast_out 0% (0.00%) (015f62726f6164636173745f6f75742030252028302e30302529)
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Maybe also responsible: Array    (        [0] => 0        [1] => 0        [2] => 0        [3] => 100    )    
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Failed to render pie chart with the following title: \x01_broadcast_in 0% (0.00%) (015f62726f6164636173745f696e2030252028302e30302529)
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Maybe also responsible: Array    (        [0] => 0        [1] => 0        [2] => 0        [3] => 100    )    
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Failed to render pie chart with the following title: \x01_discards_out 0% (0.00%) (015f64697363617264735f6f75742030252028302e30302529)
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Maybe also responsible: Array    (        [0] => 0        [1] => 0        [2] => 0        [3] => 100    )    
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Failed to render pie chart with the following title: \x01_discards_in 0% (0.00%) (015f64697363617264735f696e2030252028302e30302529)
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Maybe also responsible: Array    (        [0] => 0        [1] => 0        [2] => 0        [3] => 100    )    
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Failed to render pie chart with the following title: \x01_errors_out 0% (0.00%) (015f6572726f72735f6f75742030252028302e30302529)
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Maybe also responsible: Array    (        [0] => 0        [1] => 0        [2] => 0        [3] => 100    )    
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Failed to render pie chart with the following title: \x01_errors_in 0% (0.00%) (015f6572726f72735f696e2030252028302e30302529)
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Maybe also responsible: Array    (        [0] => 0        [1] => 0        [2] => 0        [3] => 100    )    
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Failed to render pie chart with the following title: \x01_traffic_out 0.00 (0.00%) (015f747261666669635f6f757420302e30302028302e30302529)
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Maybe also responsible: Array    (        [0] => 0        [1] => 0        [2] => 0        [3] => 10000000    )    
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Failed to render pie chart with the following title: \x01_traffic_in 0.00 (0.00%) (015f747261666669635f696e20302e30302028302e30302529)
Jul 23 20:01:22 lx-icinga icingaweb2[32657]: Maybe also responsible: Array    (        [0] => 0        [1] => 0        [2] => 0        [3] => 10000000    )    

@nilmerg
Copy link
Member

nilmerg commented Jul 26, 2021

Thanks. And you got no error in the UI?

@nilmerg
Copy link
Member

nilmerg commented Jul 26, 2021

Nevermind, I've asked because I still couldn't reproduce it. Now I can, and the the proper fix is in place. Thanks for your feedback!

@nilmerg nilmerg removed the needs-feedback We'll only proceed once we hear from you again label Jul 26, 2021
@nilmerg nilmerg changed the title DOMDocument::saveXML(): xmlEscapeEntities : char out of range SVG chart library doesn't process input as UTF-8 Jul 26, 2021
nilmerg added a commit that referenced this issue Jul 26, 2021
nilmerg added a commit that referenced this issue Jul 26, 2021
@nilmerg nilmerg added this to the 2.9.1 milestone Jul 27, 2021
nilmerg added a commit that referenced this issue Jul 27, 2021
fixes #4462

(cherry picked from commit 7b9cb7f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/framework Affects third party integration/development bug Something isn't working
Projects
None yet
2 participants