Icinga / icingaweb2-module-director

The Director aims to be your new favourite Icinga config deployment tool. Director is designed for those who want to automate their configuration deployment and those who want to grant their “point & click” users easy access to the configuration.
https://icinga.com/docs/director/latest
GNU General Public License v2.0
413 stars 202 forks source link

Diff does not work on director/config/activity, because of problem with vars from Puppet #2389

Closed linuxmail closed 3 years ago

linuxmail commented 3 years ago

Expected Behavior

Check the diff on changes (which cames from Puppetdb import) should display the changed values

Current Behavior

After sync the I can't see the diff, but:

Oops, an error occurred!
Uncaught Error: Call to undefined function gipfl\Diff\PhpDiff\Renderer\Html\mb_strlen() in /usr/share/icingaweb2/modules/incubator/vendor/gipfl/diff/src/PhpDiff/Renderer/Html/ArrayRenderer.php:41
Stack trace:
#0 /usr/share/icingaweb2/modules/incubator/vendor/gipfl/diff/src/PhpDiff/Renderer/Html/ArrayRenderer.php(69): gipfl\Diff\PhpDiff\Renderer\Html\ArrayRenderer->insertLineMarkers('    vars.puppet...', 954, -778)
#1 /usr/share/icingaweb2/modules/incubator/vendor/gipfl/diff/src/PhpDiff/Renderer/Html/ArrayRenderer.php(34): gipfl\Diff\PhpDiff\Renderer\Html\ArrayRenderer->renderOpcodesGroup(Array, Array, Array)
#2 /usr/share/icingaweb2/modules/incubator/vendor/gipfl/diff/src/PhpDiff/Renderer/Html/SideBySide.php(18): gipfl\Diff\PhpDiff\Renderer\Html\ArrayRenderer->render()
#3 /usr/share/icinga-php/ipl/vendor/ipl/html/src/HtmlDocument.php(339): gipfl\Diff\PhpDiff\Renderer\Html\SideBySide->render()
#4 /usr/share/icinga-php/ipl/vendor/ipl/html/src/HtmlDocument.php(498): ipl\Html\HtmlDocument->renderUnwrapped()
#5 /u (ArrayRenderer.php:41)
#0 [internal function]: Icinga\Application\Web->Icinga\Application\{closure}()
#1 {main}

Possible Solution

It looks like, the parser has problems with vars.puppet...

If I call it via facter, it looks for example:

root@mon-01: facter -p puppet_modules

apache, apt, apticron, auditd, augeas, base, certs, consul, cron, default, firewall, grub2, hosts, icinga2, icingaweb2, ntp, postfix, profile, python, resource_tree, rsyslog, settings, ssh, sudo, sysctl, systemd, telegraf, timezone, users

root@mon-01: facter -p puppet_classes

apache, apache::default_confd_files, apache::default_mods, apache::mod::alias, apache::mod::auth_basic, apache::mod::authn_core, apache::mod::authn_file, apache::mod::authz_user, apache::mod::cgi, apache::mod::deflate, apache::mod::dir, apache::mod::env, apache::mod::filter, apache::mod::headers, apache::mod::mime, apache::mod::php, apache::mod::prefork, apache::mod::proxy, apache::mod::proxy_http, apache::mod::remoteip, apache::mod::rewrite, apache::mod::setenvif, apache::mod::socache_shmcb, apache::mod::ssl, apache::mod::status, apache::mpm::disable_mpm_event, apache::mpm::disable_mpm_worker, apache::params, apache::service, apache::version, apt, apt::params, apt::update, apticron, apticron::config, apticron::install, apticron::params, apticron, apticron::config, apticron::install, apticron::params, auditd, auditd::params, augeas, augeas::files, augeas::params, base, base::fw_post, base::fw_pre, base::light, base::rng, base::root::password, certs, consul, consul::params, cron, cron::install, cron::service, default, firewall, firewall::linux, firewall::linux::debian, firewall::params, grub2, grub2::config, grub2::install, grub2::params, grub2::update, hosts, icinga2, icinga2::config, icinga2::feature::api, icinga2::feature::checker, icinga2::feature::command, icinga2::feature::idomysql, icinga2::feature::influxdb, icinga2::feature::mainlog, icinga2::feature::notification, icinga2::feature::statusdata, icinga2::install, icinga2::params, icinga2::repo, icinga2::service, icingaweb2, icingaweb2::config, icingaweb2::globals, icingaweb2::install, icingaweb2::module::businessprocess, icingaweb2::module::director, icingaweb2::module::monitoring, ntp, ntp::config, ntp::install, ntp::service, postfix, postfix::augeas, postfix::files, postfix::mta, postfix::packages, postfix::params, postfix::satellite, postfix::service, profile, profile::base::backup, profile::base::ssh, profile::base::sysops, profile::icinga2::applyrules, profile::icinga2::checkcommands, profile::icinga2::icingaweb2, profile::icinga2::master, profile::icinga2::notifications, profile::icinga2::params, profile::icinga2::plugins, profile::icinga2::repo, profile::icinga2::templates, profile::rsyslog::server, profile::webserver::apache2, profile::webserver::apache2_cgi, profile::webserver::apache2_php, profile::webserver::apache2_remoteip, python, python::config, python::install, python::params, resource_tree, rsyslog, rsyslog::client, rsyslog::config, rsyslog::install, rsyslog::params, rsyslog::server, rsyslog::service, settings, ssh, ssh::client, ssh::client::config, ssh::client::install, ssh::params, ssh::server, ssh::server::config, ssh::server::install, ssh::server::service, sudo, sudo::package, sudo::params, sysctl, sysctl::base, sysctl::params, systemd, systemd::systemctl::daemon_reload, telegraf, telegraf::config, telegraf::install, telegraf::params, telegraf::service, timezone, users, users::consul, users::dfuchs, users::dmytro, users::jdiscuser, users::rundeck

Steps to Reproduce (for bugs)

PuppetDB FC-R02 Hosts | ${facts.puppet_modules} | vars.puppet_modules |  
PuppetDB FC-R02 Hosts | ${facts.puppet_classes} | vars.puppet_classes |  

Your Environment

Thomas-Gelf commented 3 years ago

Guess you're missing the mbstring PHP extension, which is an installation requirement.

linuxmail commented 3 years ago

hi @Thomas-Gelf ,

pretty awesome .. it was really missing. Strange is ... I had this problem since a few days .. after one of the git pull from the module.

Anyway .. thanks :-)