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

PSQLException when using outdated "select-*" syntax instead of "select_*"

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PDB 4.2.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Story Points:
      1

      Description

      ..Apologies if this is known or resolved in a later release, but I couldn't find a ticket for it.

      PDB 3.1.1 in PE 2015.2.3

      When using the old select-facts operator instead of the proper select_facts operator, PDB bubbles up a postgres error that is very confusing

      > curl -XGET localhost:8080/pdb/query/v4/fact-contents -d 'query=["in", "certname", ["extract", "certname", ["select-facts", ["=", "name", "osfamily"]]]]'
      <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
      <title>Error 500 </title>
      </head>
      <body>
      <h2>HTTP ERROR: 500</h2>
      <p>Problem accessing /pdb/query/v4/fact-contents. Reason:
      <pre>    org.postgresql.util.PSQLException: No value specified for parameter 1.</pre></p>
      <hr /><i><small>Powered by Jetty://</small></i>
      </body>
      </html>

      It seems like PDB should realize that select-facts is not a valid operator and return an error message to that effect. Bonus points if the error message points out the correct select_facts operator.

      I didn't test, but I assume that a similar thing happens with the other subquery operators.

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                Unassigned
                Reporter:
                lexa Lexa Whitehurst
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support