voxpupuli/puppetboard

Regression in 4.1.0: Facts in GRAPH_FACTS throw JS error

TwizzyDizzy opened this issue · 2 comments

Describe the bug

Issue is with this URL: https://PUPPETBOARD_URL/fact/FACT

Facts that are listed in GRAPH_FACTS seem to cause a JS error and don't show table of hosts nor the graph itself.

kernelversion:117 Uncaught ReferenceError: c3 is not defined
    at HTMLTableElement.<anonymous> (kernelversion:117:3)
    at HTMLTableElement.dispatch (jquery.min.js:2:43064)
    at v.handle (jquery.min.js:2:41048)
    at Object.trigger (jquery.min.js:2:71515)
    at HTMLTableElement.<anonymous> (jquery.min.js:2:72110)
    at Function.each (jquery.min.js:2:3003)
    at S.fn.init.each (jquery.min.js:2:1481)
    at S.fn.init.trigger (jquery.min.js:2:72086)
    at F (jquery.dataTables.min.js:91:276)
    at Object.g [as success] (jquery.dataTables.min.js:49:90)

Puppetboard version

Started with version 4.1.0, verified to have worked in 4.0.5.

Environment and installation method

  • CentOS 8 Stream, Python 3.9
  • Installed via PyPI (but not via the Puppetboard Puppet module)

settings.py

      import os

      PUPPETDB_HOST = '%{facts.networking.fqdn}'
      PUPPETDB_PORT = 8081
      PUPPETDB_SSL_VERIFY = '/etc/puppetlabs/puppet/ssl/certs/ca.pem'
      PUPPETDB_KEY = '/opt/puppetboard-venv/private.pem'
      PUPPETDB_CERT = '/opt/puppetboard-venv/public.pem'
      PUPPETDB_TIMEOUT = 20
      DEFAULT_ENVIRONMENT = '*'
      SECRET_KEY = os.urandom(24)
      DEV_LISTEN_HOST = '127.0.0.1'
      DEV_LISTEN_PORT = 5000
      DEV_COFFEE_LOCATION = 'coffee'
      UNRESPONSIVE_HOURS = 24
      ENABLE_QUERY = True
      LOCALISE_TIMESTAMP = True
      LOGLEVEL = 'debug'
      NORMAL_TABLE_COUNT = 250
      LITTLE_TABLE_COUNT = 50
      TABLE_COUNT_SELECTOR = [10, 25, 50, 100, 250, 500, 1000]
      OFFLINE_MODE = True
      ENABLE_CATALOG = True
      OVERVIEW_FILTER = None
      GRAPH_TYPE = 'donut'
      FAVORITE_ENVS = ['production','test','development']
      GRAPH_FACTS = ['architecture',
                     'clientversion',
                     'domain',
                     'keepalived_version',
                     'kernel',
                     'kernelrelease',
                     'kernelversion',
                     'filebeat_version',
                     'log4j_status_global',
                     'lsbcodename',
                     'lsbdistcodename',
                     'lsbdistid',
                     'lsbdistrelease',
                     'lsbmajdistrelease',
                     'mysql_version',
                     'net_check',
                     'netmask',
                     'osfamily',
                     'os_name_lc',
                     'phpversion',
                     'pp_389ds_management_status',
                     'pp_bash_version',
                     'pp_centos_version',
                     'pp_check_ldaps_connect',
                     'pp_check_smtp_connect',
                     'pp_cpu_family',
                     'pp_gluster_management_status',
                     'pp_icinga_version',
                     'pp_ipv6_enabled',
                     'pp_keepalived_management_status',
                     'pp_mysql_management_status',
                     'pp_nodejs_management_status',
                     'pp_nodejs_version',
                     'pp_openldapserver_management_status',
                     'pp_os_version',
                     'pp_php_management_status',
                     'pp_php_version',
                     'pp_postfix_version',
                     'pp_postgres_management_status',
                     'pp_postgres_major_version',
                     'pp_postgres_version',
                     'processorcount',
                     'puppetversion',
                     'r10k_environment',
                     'role',
                     'rubyversion',
                     'sudoversion',
                     'tier' ]
      INVENTORY_FACTS = [('Hostname', 'fqdn'),
                         ('IP Address', 'ipaddress'),
                         ('OS', 'operatingsystem'),
                         ('OS-Release', 'operatingsystemrelease'),
                         ('Architecture', 'hardwaremodel'),
                         ('Kernel Version', 'kernelrelease'),
                         ('Puppet Version', 'puppetversion'), ]
      REFRESH_RATE = 30
      DAILY_REPORTS_CHART_ENABLED = True
      DAILY_REPORTS_CHART_DAYS = 8
      SHOW_ERROR_AS = 'friendly'
      CODE_PREFIX_TO_REMOVE = '/etc/puppetlabs/code/environments'

Hey @TwizzyDizzy, thanks for reporting! I reproduced it and fixed it easily, see v4.1.1 released a moment ago. Please reopen if you still have any issues. :)

Now that's what I call fast! :D I can confirm that the issue is fixed in 4.1.1.

Cheers & Thanks
Thomas