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

Windows package resource does not remove trailing whitespace

    Details

    • Template:
      PUP Bug Template
    • Master Config:
      Monolithic
    • Agent OS:
      Windows Server 2008 R2 (x64)
    • Master OS:
      RHEL 6 (x86_64)
    • Team:
      Night's Watch
    • Story Points:
      3
    • Sprint:
      PR - 2019-05-02, PR - 2019-05-15, PR - 2019-05-29
    • Method Found:
      Customer Feedback
    • CS Priority:
      Major
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      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.
    • QA Risk Assessment:
      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

              jsd-sla-details-panel

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Zendesk Support