Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-9639

Windows package resource does not remove trailing whitespace

    XMLWordPrintable

Details

    • Monolithic
    • RHEL 6 (x86_64)
    • Night's Watch
    • 3
    • PR - 2019-05-02, PR - 2019-05-15, PR - 2019-05-29
    • Customer Feedback
    • Major
    • 50334
    • 1
    • Bug Fix
    • Hide
      When reading from the Windows Registry we can end-up with data that will
      cause issues in the upstream services, such as null bytes sequence

      This commit updates the Windows Registry read method to replace null byte
      sequence with a space.
      Show
      When reading from the Windows Registry we can end-up with data that will cause issues in the upstream services, such as null bytes sequence This commit updates the Windows Registry read method to replace null byte sequence with a space.
    • Needs Assessment

    Description

      Package Inspector in Windows is reading in the version number without removing trailing whitespace, which when submitted to the DB as a fact causes the updated facts for that agent to be discarded.

      As seen on a Windows machine:

      package { 'McAfee SiteAdvisor Enterprise':
        ensure => '1.7.0.144                                                                                                                                                                                                                                                      ',
      }
      

      Which is passed into a fact as:

      {
      "name": "node.puppet.com",
      "values": {
      "_puppet_inventory_1": {
      "packages": [
      ["McAfee SiteAdvisor Enterprise", "1.7.0.144\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000", "windows"]
      

      Which in turn causes PuppetDB to reject facts from the node, including facts other than the one with the null bit:

      2017-10-06 17:32:11,961 ERROR [p.p.command] [5,166,564] [replace facts] Retrying after attempt 0 for node.puppet.com, due to: org.postgresql.util.PSQLException: ERROR: invalid byte sequence for encoding "UTF8": 0x00 
      org.postgresql.util.PSQLException: ERROR: invalid byte sequence for encoding "UTF8": 0x00
      

      Attachments

        Issue Links

          Activity

            People

              gheorghe.popescu Gheorghe Popescu
              paul.schaffer Paul Schaffer
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support