invalid checksum using template

100 views
Skip to first unread message

Felice Pizzurro

unread,
Nov 17, 2014, 3:38:17 PM11/17/14
to puppet...@googlegroups.com
Hi all,

I'm simply tryng to push a file with content in template:

file {'/tmp/test':
  ensure  => present,
  content => template('modulename/template_file.erb')
}

Template file contains a line like this:

{FOO}.

note final dot character. The file is correctly created but I have the following error during the filebucket

Error: Could not retrieve content for {FOO}.
 from filebucket: Invalid checksum ".\n"
Wrapped exception:
Invalid checksum ".\n"

If I delete this line or the final dot it works fine. I've also tryed to put the string in a variable but nothing...

Any ideas?

Thanks in advance,
Fx


--
Felice Pizzurro
System Administrator
 
 felice....@softecspa.it
MOBILE +39 335.5966705

jcbollinger

unread,
Nov 18, 2014, 3:28:35 PM11/18/14
to puppet...@googlegroups.com


On Monday, November 17, 2014 9:38:17 AM UTC-6, Felice Pizzurro wrote:
Hi all,

I'm simply tryng to push a file with content in template:

file {'/tmp/test':
  ensure  => present,
  content => template('modulename/template_file.erb')
}

Template file contains a line like this:

{FOO}.

note final dot character. The file is correctly created but I have the following error during the filebucket

Error: Could not retrieve content for {FOO}.
 from filebucket: Invalid checksum ".\n"
Wrapped exception:
Invalid checksum ".\n"

If I delete this line or the final dot it works fine. I've also tryed to put the string in a variable but nothing...

Any ideas?


This sounds very strange, but your account of the problem is a bit fragmented and incomplete.  Can you provide a complete example that exhibits this problem?  For example, how about this:

file {'/tmp/test':
 
ensure  => present,

  content
=> '{FOO}.'
}

And on what version of Puppet are you experiencing this?


John

Josh Cooper

unread,
Nov 18, 2014, 5:37:02 PM11/18/14
to puppet...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/7cadb6e3-6d6b-4637-a03b-67e7c63aaf48%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

I'm pretty sure puppet has a bug whereby it thinks content of the form {FOO} specifies a checksum whose algorithm is FOO, and then tries to retrieve a file whose checksum is FOO from the filebucket.


Josh

--
Josh Cooper
Developer, Puppet Labs

Join us at PuppetConf 2015, October 5-9 in Portland, OR - http://2015.puppetconf.com.  
Register early to save 40%!

Felice Pizzurro

unread,
Nov 19, 2014, 9:09:52 AM11/19/14
to puppet...@googlegroups.com
Hi,

I use puppet 3.7.3-1puppetlabs1. Puppet master is ubuntu 12.04, client is ubuntu 10.04.

I have a resource file, content is a template that have the string {FOO}. inside

class test {
 
  file {'/tmp/test':
    ensure => present,
    content => template('test/template.erb')
  }
}

the template content is only the string {FOO}.

Result of agent execution is:

Error: Could not retrieve content for {FOO}.
 from filebucket: Error 400 on SERVER: Invalid checksum ".\n"
Wrapped exception:
Error 400 on SERVER: Invalid checksum ".\n"
Error: /Stage[main]/Test/File[/tmp/test]/ensure: change from absent to present failed: Could not retrieve content for {FOO}.
 from filebucket: Error 400 on SERVER: Invalid checksum ".\n"



For more options, visit https://groups.google.com/d/optout.

Felix Frank

unread,
Nov 22, 2014, 8:19:43 PM11/22/14
to puppet...@googlegroups.com
On 11/18/2014 06:36 PM, Josh Cooper wrote:
> I'm pretty sure puppet has a bug whereby it thinks content of the form
> {FOO} specifies a checksum whose algorithm is FOO, and then tries to
> retrieve a file whose checksum is FOO from the filebucket.
>
> See https://github.com/puppetlabs/puppet/blob/master/lib/puppet/type/file/content.rb#L50-L53
>
> Josh

Yup. And it's been known for quite a while.

https://tickets.puppetlabs.com/browse/PUP-1043

I don't think that this can be worked around at the moment, unless the
OP can avoid `content` in favor of `source`.

Cheers,
Felix
Reply all
Reply to author
Forward
0 new messages