Uploaded image for project: 'PuppetDB'
  1. PuppetDB
  2. PDB-3852

PuppetDB query nodes based on fact broken

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: PDB 5.2.0
    • Fix Version/s: PDB 5.2.2
    • Component/s: PuppetDB
    • Labels:
      None
    • Environment:

      OS: Ubuntu 16.04
      PuppetDB version: 5.2.0

    • Template:
    • Team:
      Data Platform
    • Sprint:
      Data Platform 2018-04-11
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      A regression in PuppetDB 5.2 has been fixed which caused path queries against structured facts to fail when the path included a regular expression component or an array index.
    • QA Risk Assessment:
      Needs Assessment

      Description

      It seems that after updating PuppetDB from 5.1.4 to 5.2, some queries stopped working for us, for example this one:

      inventory[certname] { facts.mcollective.server.collectives.match("\d+") = "mcollective" }
      

      Against following facts structure:

            "mcollective": {
              "client": {
                "libdir": [
                  "/opt/puppetlabs/mcollective/plugins",
                  "/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/fast_gettext-1.1.0/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/locale-2.1.2/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/text-1.3.1/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/gettext-3.2.2/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/gettext-setup-0.28/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/stomp-1.3.3/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/nats-pure-0.2.4/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.4.0",
                  "/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.4.0/x86_64-linux",
                  "/opt/puppetlabs/puppet/lib/ruby/site_ruby",
                  "/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/2.4.0",
                  "/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/2.4.0/x86_64-linux",
                  "/opt/puppetlabs/puppet/lib/ruby/vendor_ruby",
                  "/opt/puppetlabs/puppet/lib/ruby/2.4.0",
                  "/opt/puppetlabs/puppet/lib/ruby/2.4.0/x86_64-linux",
                  "/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/vendor/deep_merge/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/vendor/pathspec/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/vendor/semantic/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/vendor/semantic_puppet/lib",
                  "/opt/puppetlabs/puppet/cache/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/mcollective/vendor/systemu/lib"
                ],
                "connector": "nats",
                "collectives": [
                  "mcollective",
                  "de_collective",
                  "fr_collective",
                  "us_collective",
                  "nl_collective",
                  "uk_collective",
                  "mt_collective"
                ],
                "main_collective": "mcollective",
                "securityprovider": "choria"
              },
              "server": {
                "libdir": [
                  "/opt/puppetlabs/mcollective/plugins",
                  "/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/fast_gettext-1.1.0/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/locale-2.1.2/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/text-1.3.1/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/gettext-3.2.2/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/gettext-setup-0.28/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/stomp-1.3.3/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/nats-pure-0.2.4/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.4.0",
                  "/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.4.0/x86_64-linux",
                  "/opt/puppetlabs/puppet/lib/ruby/site_ruby",
                  "/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/2.4.0",
                  "/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/2.4.0/x86_64-linux",
                  "/opt/puppetlabs/puppet/lib/ruby/vendor_ruby",
                  "/opt/puppetlabs/puppet/lib/ruby/2.4.0",
                  "/opt/puppetlabs/puppet/lib/ruby/2.4.0/x86_64-linux",
                  "/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/vendor/deep_merge/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/vendor/pathspec/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/vendor/semantic/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/vendor/semantic_puppet/lib",
                  "/opt/puppetlabs/puppet/cache/lib",
                  "/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/mcollective/vendor/systemu/lib"
                ],
                "connector": "nats",
                "collectives": [
                  "mt_collective",
                  "mcollective"
                ],
                "main_collective": "mcollective",
                "securityprovider": "choria"
              },
              "version": "2.11.3"
            },
      

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  andrew.roetker AJ Roetker
                  Reporter:
                  invidian Mateusz Gozdek
                • Votes:
                  2 Vote for this issue
                  Watchers:
                  8 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: