Template correct but file not

OK, should be my last problem for a while! I see the template cached file
under /var/chef/cache/cookbooks/ and it has a piece like this:

/erlexec -smp enable -init_debug

But when the file is written to disk from the template (and this is how the
file was before I updated the template and uploaded to the repo) is:

/erlexec -init_debug

How is this possible??

Tristan

A new oddity I noticed related to this. If the recipe hangs (I just happened
to discover this since I accidentally placed the wrong recipe before the
ones that are creating the incorrect file which created the wrong config
file causing this recipe to hang before completion) and I look at the file
it creates, it is CORRECT!

I know, I know, this is insane. But its really happening.. Once I correct
the recipes so the one that hangs completes I find it has the old wrong file
again :(, I've tried this many times now to make sure it is really
happening.

Tristan

On Wed, Jan 5, 2011 at 4:38 PM, Tristan Sloughter <
tristan.sloughter@gmail.com> wrote:

OK, should be my last problem for a while! I see the template cached file
under /var/chef/cache/cookbooks/ and it has a piece like this:

/erlexec -smp enable -init_debug

But when the file is written to disk from the template (and this is how the
file was before I updated the template and uploaded to the repo) is:

/erlexec -init_debug

How is this possible??

Tristan

On Thu, Jan 6, 2011 at 8:27 AM, Tristan Sloughter
tristan.sloughter@gmail.com wrote:

A new oddity I noticed related to this. If the recipe hangs (I just happened
to discover this since I accidentally placed the wrong recipe before the
ones that are creating the incorrect file which created the wrong config
file causing this recipe to hang before completion) and I look at the file
it creates, it is CORRECT!

Can you stick this in your client.rb and see what it says?

I know, I know, this is insane. But its really happening.. Once I correct
the recipes so the one that hangs completes I find it has the old wrong file
again :(, I've tried this many times now to make sure it is really
happening.
Tristan

Thanks,
Dan

Hmm, I don't see anything. Tried with out -l debug and with. I can just
append it to client.rb, right?

On Thu, Jan 6, 2011 at 10:45 AM, Daniel DeLeo dan@kallistec.com wrote:

On Thu, Jan 6, 2011 at 8:27 AM, Tristan Sloughter
tristan.sloughter@gmail.com wrote:

A new oddity I noticed related to this. If the recipe hangs (I just
happened
to discover this since I accidentally placed the wrong recipe before the
ones that are creating the incorrect file which created the wrong config
file causing this recipe to hang before completion) and I look at the
file
it creates, it is CORRECT!

Can you stick this in your client.rb and see what it says?

put this in your client.rb ยท GitHub

I know, I know, this is insane. But its really happening.. Once I correct
the recipes so the one that hangs completes I find it has the old wrong
file
again :(, I've tried this many times now to make sure it is really
happening.
Tristan

Thanks,
Dan

On Thu, Jan 6, 2011 at 8:49 AM, Tristan Sloughter
tristan.sloughter@gmail.com wrote:

Hmm, I don't see anything. Tried with out -l debug and with. I can just
append it to client.rb, right?

Shouldn't depend on the log level, since it's just printing directly
to stderr (so it assumes you're running chef-client in the
foreground). You can try changing the STDERR.puts to
Chef::Log.error to send the info through the logger.

Dan

I see the problem, I get this if I run shef as a client:

/etc/chef/client.rb:85:in from_file': undefined method render_template'
for module `Chef::Mixin::Template' (NameError)

On Thu, Jan 6, 2011 at 10:54 AM, Daniel DeLeo dan@kallistec.com wrote:

On Thu, Jan 6, 2011 at 8:49 AM, Tristan Sloughter
tristan.sloughter@gmail.com wrote:

Hmm, I don't see anything. Tried with out -l debug and with. I can just
append it to client.rb, right?

Shouldn't depend on the log level, since it's just printing directly
to stderr (so it assumes you're running chef-client in the
foreground). You can try changing the STDERR.puts to
Chef::Log.error to send the info through the logger.

Dan

One more thing I've now noticed. I modified provider/template.rb to print
out the contents of rendered_template before moving the rendered_template
file to the file location. And its correct! And if I put an 'exit' right
after the file move the file is correct when I look at it!

Buuut, if I let it continue to run (which of course it needs to) the file is
wrong.

If anyone has any crazy theories of what could happen after template.rb's
action_create I would much appreciate it..

Tristan

On Thu, Jan 6, 2011 at 10:57 AM, Tristan Sloughter <
tristan.sloughter@gmail.com> wrote:

I see the problem, I get this if I run shef as a client:

/etc/chef/client.rb:85:in from_file': undefined method render_template'
for module `Chef::Mixin::Template' (NameError)

On Thu, Jan 6, 2011 at 10:54 AM, Daniel DeLeo dan@kallistec.com wrote:

On Thu, Jan 6, 2011 at 8:49 AM, Tristan Sloughter
tristan.sloughter@gmail.com wrote:

Hmm, I don't see anything. Tried with out -l debug and with. I can just
append it to client.rb, right?

Shouldn't depend on the log level, since it's just printing directly
to stderr (so it assumes you're running chef-client in the
foreground). You can try changing the STDERR.puts to
Chef::Log.error to send the info through the logger.

Dan

Well, I'm done with this issue :). I found another place I could turn on SMP
for the erlang node besides throwing it in the start command (forgot to just
put it in vm.args) and deployed with that and everything is fine -- since
that template was written correctly.

Thanks.

Tristan

On Thu, Jan 6, 2011 at 2:47 PM, Tristan Sloughter <
tristan.sloughter@gmail.com> wrote:

One more thing I've now noticed. I modified provider/template.rb to print
out the contents of rendered_template before moving the rendered_template
file to the file location. And its correct! And if I put an 'exit' right
after the file move the file is correct when I look at it!

Buuut, if I let it continue to run (which of course it needs to) the file
is wrong.

If anyone has any crazy theories of what could happen after template.rb's
action_create I would much appreciate it..

Tristan

On Thu, Jan 6, 2011 at 10:57 AM, Tristan Sloughter <
tristan.sloughter@gmail.com> wrote:

I see the problem, I get this if I run shef as a client:

/etc/chef/client.rb:85:in from_file': undefined method render_template'
for module `Chef::Mixin::Template' (NameError)

On Thu, Jan 6, 2011 at 10:54 AM, Daniel DeLeo dan@kallistec.com wrote:

On Thu, Jan 6, 2011 at 8:49 AM, Tristan Sloughter
tristan.sloughter@gmail.com wrote:

Hmm, I don't see anything. Tried with out -l debug and with. I can just
append it to client.rb, right?

Shouldn't depend on the log level, since it's just printing directly
to stderr (so it assumes you're running chef-client in the
foreground). You can try changing the STDERR.puts to
Chef::Log.error to send the info through the logger.

Dan