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

Cached catalogs are loaded using the agent's string locale which can result in corrupted data

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 3.8.4, PUP 4.2.3
    • Fix Version/s: PUP 4.3.2
    • Component/s: None
    • Labels:
    • Template:
    • Story Points:
      3
    • Sprint:
      Client 2016-01-13, Client 2016-01-27
    • CS Priority:
      Major
    • CS Frequency:
      3 - 25-50% of Customers
    • CS Severity:
      4 - Major
    • CS Business Value:
      4 - $$$$$
    • CS Impact:
      Hide
      This impacts the use of cached catalogs on windows, making them potentially destructive. If this is not resolved it will have future impacts on the proposed funtionality of direct puppet which relies on cached catalogs.

      The behavior seen by users is that the initial puppet run works as expected, but if the following run uses a cached catalog it may cause misconfiguration. This is particularly bad in the Application Orchestration/Direct Puppet scenario because the initial deploy appears to work but then 30 minutes later the follow-up checkin uses the cached catalog and only then does this problem surface.
      Show
      This impacts the use of cached catalogs on windows, making them potentially destructive. If this is not resolved it will have future impacts on the proposed funtionality of direct puppet which relies on cached catalogs. The behavior seen by users is that the initial puppet run works as expected, but if the following run uses a cached catalog it may cause misconfiguration. This is particularly bad in the Application Orchestration/Direct Puppet scenario because the initial deploy appears to work but then 30 minutes later the follow-up checkin uses the cached catalog and only then does this problem surface.
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      When a catalog contained inlined file content (typically from a template) with non-ASCII unicode characters, those characters could be corrupted when the agent used a cached catalog. This has been resolved for the JSON cache.

      Description

      If a cached catalog is applied, which contains a file resource that used the content parameter, and that content begins with a byte-order mark, the character will be rendered as garbage text when that cached catalog is applied on Windows.

      This does not occur during normal master-agent puppet runs, only when applying a cached catalog, and only on Windows.

      Reproduction:

      Download the attached ERB file. If you view it with vim -b chocolatey.confg you will see <feff> at the beginning, indicating the byte-order mark.

      Use the template with a file resource, and deploy it to a Windows System, in any location.

      View the file and it will appear normally.

      Now, apply the cached catalog, either by disabling the puppet master and performing a puppet run (note that --test disables the use of cached catalogs), or via puppet apply C:\ProgramData\PuppetLabs\puppet\var\client_data\catalog\<certname>.json replacing <certname> with the test node's actual certname.

      Open the file on disk, and it will look like so:

      Note the junk characters at the beginning.

      Tested with a CentOS 6.6 master running PE 3.8.3 (Puppet 3.8.4) and a Windows Server 2012 agent running PE 3.8.3. I also tested with both the 64 and 32 bit clients.
      Also tested with the same setup, running PE 2015.2.3 (Puppet 4.2.3) on the master and Windows agent.

      The current workaround would be to disable cached catalogs. I'm also working on an additional workaround that would not require this, using concat to retrieve the first part of the file via the source parameter, to avoid storing the BOM in the catalog.

      Note: This is not a PE bug. I did my testing with PE, but this is not a PE-specific bug, as far as I can tell. It deals with generic Puppet functionality only. E.g. cached catalogs on Windows.

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  zee Zee Alexander
                  QA Contact:
                  Eric Thompson
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Zendesk Support