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

Don't produce duplicate certname entries for certnames with special characters

    Details

    • Template:
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Certnames using unusual characters or that are very long will now be stored properly for catalogs.
    • QA Risk Assessment:
      Needs Assessment

      Description

      Using a certname with special characters, or that is too long, will result in a duplicate node entry.

       
      You can reproduce this error with a certname such as node_0 by submitting a factset first and then submitting a catalog. Example commands are below

      Replace facts

      curl -X POST http://localhost:8080/pdb/cmd/v1 \
        -H 'Content-Type:application/json' \
        -d '{"command": "replace facts", "version": 5, "payload": { "certname": "host_0", "environment": "foo", "producer_timestamp": "2019-06-03T09:17:25-0700", "producer": "foo", "values": {} } }'
      

      Replace catalog

      curl -X POST http://localhost:8080/pdb/cmd/v1 \
        -H 'Content-Type:application/json' \
        -d '{"command": "replace catalog", "version": 9, "payload": { "certname": "host_0", "producer_timestamp": "2019-06-03T09:17:25-0700", "version": "1", "environment": "foo", "edges": [], "resources": [], "transaction_uuid": "40e6215d-b5c6-4896-987c-f30f3678f608", "code_id": null, "producer": null, "job_id": null, "catalog_uuid": null} }'
      

      and then check the certnames present

      puppetdb=> select * from certnames;
       id |                    certname                     | latest_report_id | deactivated | expired |                package_hash                |  latest_report_timestamp
      ----+-------------------------------------------------+------------------+-------------+---------+--------------------------------------------+----------------------------
       74 | host_0                                          |                  |             |         |                                            |
       80 | host-0_8ad051ad85dfdcb632063b23fab9a0081e46178f |                  |             |         |                                            |
      (2 rows)
      

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                austin.blatt Austin Blatt
                Reporter:
                austin.blatt Austin Blatt
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: