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

File { checksum => .. } doesn't work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Puppet-3.6.1 on CentOS.

    • Template:

      Description

      site.pp:

      file {
          "/tmp/ultravnc.msi":
              source => "puppet:///repos/MSIs/UltraVnc_10962_x64.msi",
              checksum => 'md5lite';
      }
      

      [root@releng-puppet1.srv.releng.scl3.mozilla.com MSIs]# puppet agent --test --environment=dmitchell --server=releng-puppet1.srv.releng.scl3.mozilla.com
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Caching catalog for releng-puppet1.srv.releng.scl3.mozilla.com
      Info: Applying configuration version 'unknown'
      Error: File written to disk did not match checksum; discarding changes ({md5lite}e7bf157e1bba889eee8711a7fd1dfbf7 vs {md5lite}313772784558c552dbda1a58021ab846)
      Error: /Stage[main]/Main/File[/tmp/ultravnc.msi]/ensure: change from absent to file failed: File written to disk did not match checksum; discarding changes ({md5lite}e7bf157e1bba889eee8711a7fd1dfbf7 vs {md5lite}313772784558c552dbda1a58021ab846)
      Notice: Finished catalog run in 1.29 seconds
      [root@releng-puppet1.srv.releng.scl3.mozilla.com MSIs]# md5sum /data/repos/MSIs/UltraVnc_10962_x64.msi 
      e7bf157e1bba889eee8711a7fd1dfbf7  /data/repos/MSIs/UltraVnc_10962_x64.msi
      

      Note that the hash for the file written to disk is the hash of the whole file, despite being labeled "md5lite". 313772 is, as expected, the md5 of the first 512 bytes.

      The upshot of this is that we're not able to use any checksum but the default which, for lots of big MSI files whose content is unlikely to change, is pretty expensive in terms of master CPU and IO.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              djmitche Dustin J. Mitchell
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support