Well, it turns out that it's definitely a puppet bug.

The streaming checksumming that's used doesn't actually only look at the
first 512 characters like the static checksumming that's used for
verifying the file on disk does.

http://projects.puppetlabs.com/issues/8385

-- 
Jacob Helwig

On Tue, 12 Jul 2011 11:04:09 -0700, Haitao Jiang wrote:
> 
> Jacob
> 
> Thanks. I did that, the checksum is a3f7372d40abae273d2680b650ca4715.
> This is the second checksum in the error, what did 1st checksum came
> from? The file itself never changed during my tests.
> 
> What is the next step?
> 
> Thanks
> 
> Haitao
> 
> On Tue, Jul 12, 2011 at 9:53 AM, Jacob Helwig <ja...@puppetlabs.com> wrote:
> > On Tue, 12 Jul 2011 08:41:24 -0700, Haitao Jiang wrote:
> >>
> >> This happens to Puppet 2.7.1 (both master and client). I have a file
> >> resource that I set to ensure => absent, Puppet removed it correctly
> >> with info line that it has a duplicate entry in the filebucket. I then
> >> changed the ensure => present, the agent run gave me following error:
> >>
> >> /usr/bin/puppet:19
> >> err: 
> >> /Stage[main]/Emb/File[/opt/jetty-distribution-7.4.2.v20110526.tar.gz]/ensure:
> >> change from absent to file failed: Could not rename temporary file
> >> /opt/jetty-distribution-7.4.2.v20110526.tar.gz.puppettmp_7809 to
> >> /opt/jetty-distribution-7.4.2.v20110526.tar.gz: File written to disk
> >> did not match checksum; discarding changes
> >> ({md5lite}3dc95fb231fdabbe161d8773e2a10457 vs
> >> {md5lite}a3f7372d40abae273d2680b650ca4715) at
> >> /etc/puppet/modules/emb/manifests/init.pp:38 at
> >> /etc/puppet/modules/emb/manifests/init.pp:38
> >>
> >> I have
> >>
> >> file { "/opt/jetty-distribution-7.4.2.v20110526.tar.gz":
> >>         ensure => present,
> >>         checksum => md5lite,
> >>         source => 
> >> "puppet:///emb/jetty-distribution-7.4.2.v20110526.tar.gz",
> >>     }
> >>
> >> Is this a bug?
> >>
> >> Thanks
> >>
> >> Haitao
> >>
> >
> > There certainly shouldn't be any problem with going from ensuring absent
> > to ensuring present.  Not sure if it's a bug though, since that kind of
> > behavior could also be caused by problems with the filesystem on the
> > agent.
> >
> > If you have direct access to the
> > jetty-distribution-7.4.2.v20110526.tar.gz from your emb module, could
> > you run the following ruby script to get what its md5lite checksum is?
> >
> >  #!/usr/bin/env ruby
> >
> >  require 'digest/md5'
> >
> >  path_to_jetty_distribution = 'jetty-distribution-7.4.2.v20110526.tar.gz'
> >
> >  puts Digest::MD5.hexdigest(File.read(path_to_jetty_distribution)[0..511])
> >
> > --
> > Jacob Helwig
> >
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.10 (GNU/Linux)
> >
> > iQGcBAEBAgAGBQJOHHwlAAoJEHJabXWGiqEBZqAMALH6/sBAGSJ5zOThN4fvDMKB
> > pbpHbb3sfA9796DKp+WndQxbM9oLi9RlB0fA3cOEmL4G7g+7W1QY+2q47fw19cTo
> > cfS3TbibB6PsVlLFSjLJz5nxkq/Rw1TUosPKZdgEr+E0A5Z65Y+vIy3TeJTd2bl9
> > tFXaNLQtgd5CrAdphwrA9VzGY86rthvUqhK8O7SaKoH81JiZL5ooJ7mXh96Ih52n
> > u6k6vue2g2s72PRtLxLMWQB0hC1I/j/JWr1TLzBQ+noJ5V+OG4P0BSRv+Azk43GI
> > pnlA0UjteMH80KVfQTcehdjrWutty9/uvvuFLEeP1o/7scE2llovwvGj55aAZSAr
> > d91N8U3mpguv3sWoH3QDdW52NE630zygU2mRgzjt20JA2qteDvKyvmvgt4rtA1TD
> > VGmesHOd8fo2Tfan8vzrQwd44KSdzw1797Snb9yxZ+Z5aGm7YeW5n884oF3s7Z7/
> > Aie5mPf8Qk0/vubfoSIoT9D9s8g9165CxnON+pE/dQ==
> > =Fp0N
> > -----END PGP SIGNATURE-----
> >
> >

Attachment: signature.asc
Description: Digital signature

Reply via email to