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

Puppet query - Issue with contents of arrays and type

    Details

    • Template:
    • Team:
      PuppetDB
    • Method Found:
      Customer Feedback
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      Previously PuppetDB threw the error 'All values in array must be the same type' when querying using the in operator with an array of fact values for any array that did not have just one element.

      Now PuppetDB won't error on an array of fact values unless there's an actual type mismatch among the values.
      Show
      Previously PuppetDB threw the error 'All values in array must be the same type' when querying using the in operator with an array of fact values for any array that did not have just one element. Now PuppetDB won't error on an array of fact values unless there's an actual type mismatch among the values.

      Description

      There seems to be an issue with the contents of Arrays and interpreting the type when processing a query.  For instance this query worked in 2016.4.13:

      curl -X POST -H 'Content-Type:application/json' http://localhost:8080/pdb/query/v4/nodes -d '{"query": ["in", ["fact", "uptime_seconds"], ["array",["20000.0","150.0", "300000"]]]}'

      However in 2018.1.4 it returns an error:

      "All values in array must be the same type."

      The example comes from documentation here:

      https://puppet.com/docs/puppetdb/6.0/api/query/v4/ast.html#array

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                austin.blatt Austin Blatt
                Reporter:
                erik.hansen Erik Hansen
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: