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

Filebucket fails to update file resource if checksum doesn't match the configured checksum type

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Won't Fix
    • Affects Version/s: PUP 4.0.0
    • Fix Version/s: None
    • Component/s: Catalog Application
    • Labels:
      None

      Description

      With https://github.com/puppetlabs/puppet/blob/00a11dfd15e515b4d1f71940f63ef1568edc7cc2/acceptance/tests/resource/file/content_attribute.rb#L48-L66 modified to

        manifest = %Q|
          filebucket { 'local':
            path => '#{bucketdir}',
          }
       
          file { '#{target}':
            content => '{sha256}3b9238769b033b48073267b8baea00fa51c598dc14081da51f2e510c37c46a28',
            checksum => sha256,
            ensure => present,
            backup => local,
          }
        |
       
        step "Applying Manifest on Agent"
        apply_manifest_on agent, manifest
       
        step "Validate filebucket checksum file contents"
        on agent, "cat #{target}" do
          assert_match(/This is the checksum file content/, stdout, "File content not matched on #{agent}")
        end
       
        step "Validate file retrieved from filebucket"
        on agent, puppet('resource', 'file', target, 'ensure=absent') do
          assert_match(/removed/, stdout, "File not removed on #{agent}")
        end
       
        apply_manifest_on agent, manifest
      

      the last step fails with output

        * Applying Manifest on Agent
       
      md4urpmj88aouo0.delivery.puppetlabs.net (agent) 12:05:45$ mktemp -t apply_manifest.pp.XXXXXX
      /tmp/apply_manifest.pp.EGM2z3
       
      md4urpmj88aouo0.delivery.puppetlabs.net (agent) executed in 0.01 seconds
      localhost $ scp /var/folders/gr/lnzxwt5j0736c6rwk6yjq92h0000gn/T/beaker20150326-10525-1hbhmcn agent:/tmp/apply_manifest.pp.EGM2z3 {:ignore => }
       
      md4urpmj88aouo0.delivery.puppetlabs.net (agent) 12:05:45$ puppet apply --verbose /tmp/apply_manifest.pp.EGM2z3
      Notice: Compiled catalog for md4urpmj88aouo0.delivery.puppetlabs.net in environment production in 0.49 seconds
      Info: Applying configuration version '1427396746'
      Notice: Applied catalog in 0.03 seconds
       
      md4urpmj88aouo0.delivery.puppetlabs.net (agent) executed in 1.93 seconds
       
        * Validate filebucket checksum file contents
       
      md4urpmj88aouo0.delivery.puppetlabs.net (agent) 12:05:47$ cat /tmp/content_file_test.QXqxAz
      This is the checksum file contents
       
      md4urpmj88aouo0.delivery.puppetlabs.net (agent) executed in 0.01 seconds
       
        * Validate file retrieved from filebucket
       
      md4urpmj88aouo0.delivery.puppetlabs.net (agent) 12:05:47$ puppet resource file /tmp/content_file_test.QXqxAz ensure=absent
      Notice: /File[/tmp/content_file_test.QXqxAz]/ensure: removed
      file { '/tmp/content_file_test.QXqxAz':
        ensure => 'absent',
      }
       
      md4urpmj88aouo0.delivery.puppetlabs.net (agent) executed in 0.89 seconds
       
      md4urpmj88aouo0.delivery.puppetlabs.net (agent) 12:05:48$ mktemp -t apply_manifest.pp.XXXXXX
      /tmp/apply_manifest.pp.9SligP
       
      md4urpmj88aouo0.delivery.puppetlabs.net (agent) executed in 0.01 seconds
      localhost $ scp /var/folders/gr/lnzxwt5j0736c6rwk6yjq92h0000gn/T/beaker20150326-10525-m2waz5 agent:/tmp/apply_manifest.pp.9SligP {:ignore => }
       
      md4urpmj88aouo0.delivery.puppetlabs.net (agent) 12:05:48$ puppet apply --verbose /tmp/apply_manifest.pp.9SligP
      Notice: Compiled catalog for md4urpmj88aouo0.delivery.puppetlabs.net in environment production in 0.48 seconds
      Info: Applying configuration version '1427396749'
      Error: Could not retrieve content for {sha256}3b9238769b033b48073267b8baea00fa51c598dc14081da51f2e510c37c46a28 from filebucket: Invalid checksum "3b9238769b033b48073267b8baea00fa51c598dc14081da51f2e510c37c46a28"
      Error: /Stage[main]/Main/File[/tmp/content_file_test.QXqxAz]/ensure: change from absent to present failed: Could not retrieve content for {sha256}3b9238769b033b48073267b8baea00fa51c598dc14081da51f2e510c37c46a28 from filebucket: Invalid checksum "3b9238769b033b48073267b8baea00fa51c598dc14081da51f2e510c37c46a28"
      Notice: Applied catalog in 0.04 seconds
      

      In other words, filebucket is broken when the file resource's checksum doesn't match Puppet's configured checksum type, and creating the file fails when it tries to retrieve contents from the filebucket.

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  michael.smith Michael Smith
                  QA Contact:
                  Eric Thompson
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: