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

Puppet assumes if file changes, the content must be different, and prints misleading diff

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Template:
    • Story Points:
      1

      Description

      If you use ctime or mtime as the checksum type, show diffs (either show_diff=true or running with --test, and the file mtime on the agent is less than the file mtime of the source file on the master, then puppet will output a mysterious line indicating the content changed. Note the first Notice and the blank line that follows:

      $ be puppet agent --server op0wt950dfyk9gy.delivery.puppetlabs.net -t
      ...
      Notice: /Stage[main]/Main/File[/tmp/foo]/content:
       
      Info: Computing checksum on file /tmp/foo
      Info: FileBucket got a duplicate file {md5}79c016c4dbc40644235cd31684ece2b9
      Info: /Stage[main]/Main/File[/tmp/foo]: Filebucketed /tmp/foo to puppet with sum 79c016c4dbc40644235cd31684ece2b9
      Notice: /Stage[main]/Main/File[/tmp/foo]/content: content changed '{mtime}2015-09-25 10:47:09 -0700' to '{mtime}2020-12-31 01:23:00 -0800'
      

      The reason is because puppet assumes if the content property is not insync, then there must be a file difference, and will try to show it. However, mtime and ctime can cause the content to be considered out of sync, even if the underlying file content is not.

      As simple fix is to skip printing the diff if it is empty.

      Found this issue while researching PUP-5272

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  josh Josh Cooper
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: