# How to debug errors

**URL:** <https://discourse.chef.io/t/how-to-debug-errors/1552>\
**Category:** Chef Infra (archive)\
**Created:** [September 13, 2010, 10:19am UTC](https://discourse.chef.io/t/how-to-debug-errors/1552 "2010-09-13T10:19:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ran\_Tavory](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/ran_tavory/32/874_2.png) [@Ran\_Tavory](https://discourse.chef.io/u/Ran_Tavory)\
**Post date:** [September 13, 2010, 10:19am UTC](https://discourse.chef.io/t/how-to-debug-errors/1552/1 "2010-09-13T10:19:22Z")

</div>

I’m only learning chef now and find it hard to develop and debug my recipe  
errors.  
All I can see are verbose stack traces but it’s usually quite hard to dig  
the real error from the traces. The example below does not, as far as I can  
tell hint any specific error in my code (and there are obviously errors…)  
so I’m left with g-old trial and error.  
I was wondering what’s the best approach to advance faster while leaning  
developing. I’ve made myself familiar with chef’s basics and ran a few  
tutorials but when writing my own first recipe I’m having hard time  
bootstrapping.

The error below indicates some sort of bash error in a recipe although I’m  
not sure exactly what. I suppose the following code uses the wrong syntax  
but the real question isn’t about the syntax it’s about finding an effective  
way to write-compile-test.

17 bash “install\_app” do  
18 user "root"  
19 code \<\<-EOH  
20 mkdir -p #{node[:wars]}  
21 cp #{node[:war\_src]} #{node[:war\_dest]}  
22 EOH  
23 end

[root@centos imageserver]# chef-solo -c ~/solo.rb -j ~/node.json  
[Mon, 13 Sep 2010 11:52:06 +0200] INFO: Setting the run\_list to  
[“recipe[imageserver]”] from JSON  
[Mon, 13 Sep 2010 11:52:06 +0200] INFO: Starting Chef Run (Version 0.9.8)  
[Mon, 13 Sep 2010 11:52:06 +0200] ERROR: bash[install\_app]  
(/tmp/chef-solo/cookbooks/imageserver/recipes/default.rb:17:in `from_file') had an error: "bash" "/tmp/chef-script.17504.0" returned 1, expected 0 /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:184:in`handle\_command\_failures’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/mixin/command.rb:131:in  
`run_command' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/provider/execute.rb:49:in`action\_run’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/provider/script.rb:33:in  
`action_run' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:in`send’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:51:in  
`run_action' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:109:in`converge’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:108:in  
`each' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:in`converge’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource\_collection.rb:94:in  
`execute_each_resource' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in`call’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource\_collection/stepable\_iterator.rb:116:in  
`call_iterator_block' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in`step’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource\_collection/stepable\_iterator.rb:104:in  
`iterate' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in`each\_with\_index’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource\_collection.rb:92:in  
`execute_each_resource' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:82:in`converge’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/client.rb:304:in  
`converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/client.rb:87:in`run’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application/solo.rb:191:in  
`run_application' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/solo.rb:181:in`loop’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application/solo.rb:181:in  
`run_application' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application.rb:62:in`run’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/chef-solo:25  
/usr/bin/chef-solo:19:in `load' /usr/bin/chef-solo:19 [Mon, 13 Sep 2010 11:52:06 +0200] ERROR: Running exception handlers [Mon, 13 Sep 2010 11:52:06 +0200] ERROR: Exception handlers complete [Mon, 13 Sep 2010 11:52:06 +0200] ERROR: Re-raising exception: Chef::Exceptions::Exec - "bash" "/tmp/chef-script.17504.0" returned 1, expected 0 /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:184:in`handle\_command\_failures’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/mixin/command.rb:131:in  
`run_command' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/provider/execute.rb:49:in`action\_run’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/provider/script.rb:33:in  
`action_run' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:in`send’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:51:in  
`run_action' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:109:in`converge’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:108:in  
`each' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:in`converge’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource\_collection.rb:94:in  
`execute_each_resource' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in`call’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource\_collection/stepable\_iterator.rb:116:in  
`call_iterator_block' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in`step’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource\_collection/stepable\_iterator.rb:104:in  
`iterate' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in`each\_with\_index’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource\_collection.rb:92:in  
`execute_each_resource' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:82:in`converge’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/client.rb:304:in  
`converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/client.rb:87:in`run’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application/solo.rb:191:in  
`run_application' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/solo.rb:181:in`loop’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application/solo.rb:181:in  
`run_application' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application.rb:62:in`run’  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/chef-solo:25  
/usr/bin/chef-solo:19:in `load' /usr/bin/chef-solo:19 /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:184:in`handle\_command\_failures’: “bash” “/tmp/chef-script.17504.0” returned 1,  
expected 0 (Chef::Exceptions::Exec)  
from  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/mixin/command.rb:131:in  
`run_command' from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/provider/execute.rb:49:in`action\_run’  
from  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/provider/script.rb:33:in  
`action_run' from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:in`send’  
from  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:51:in  
`run_action' from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:109:in`converge’  
from  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:108:in  
`each' from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:in`converge’  
… 13 levels…  
from  
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application.rb:62:in  
`run' from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/chef-solo:25 from /usr/bin/chef-solo:19:in`load’  
from /usr/bin/chef-solo:19

## thanks

/Ran

---

<div class="post-metadata">

**Author:** ![Ash\_Berlin](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@Ash\_Berlin](https://discourse.chef.io/u/Ash_Berlin)\
**Post date:** [September 13, 2010, 10:25am UTC](https://discourse.chef.io/t/how-to-debug-errors/1552/2 "2010-09-13T10:25:01Z")

</div>

On 13 Sep 2010, at 11:19, Ran Tavory wrote:

> I'm only learning chef now and find it hard to develop and debug my recipe errors.  
> All I can see are verbose stack traces but it's usually quite hard to dig the real error from the traces. The example below does not, as far as I can tell hint any specific error in my code (and there are obviously errors...) so I'm left with g-old trial and error.  
> I was wondering what's the best approach to advance faster while leaning developing. I've made myself familiar with chef's basics and ran a few tutorials but when writing my own first recipe I'm having hard time bootstrapping.
> 
> The error below indicates some sort of bash error in a recipe although I'm not sure exactly what. I suppose the following code uses the wrong syntax but the real question isn't about the syntax it's about finding an effective way to write-compile-test.
> 
> 17 bash "install\_app" do  
> 18 user "root"  
> 19 code \<\<-EOH  
> 20 mkdir -p #{node[:wars]}  
> 21 cp #{node[:war\_src]} #{node[:war\_dest]}  
> 22 EOH  
> 23 end

Run with chef debug logging enable to see the full command output/error:

```
chef-solo -l debug ....

```

Also using bash to make a directory and the copy a file isn't what I'd consider the 'chef' way of doing things.

directory node[:wars] do  
recursive true  
mode '0755'  
end

etc.

-ash

> [root@centos imageserver]# chef-solo -c ~/solo.rb -j ~/node.json  
> [Mon, 13 Sep 2010 11:52:06 +0200] INFO: Setting the run\_list to ["recipe[imageserver]"] from JSON  
> [Mon, 13 Sep 2010 11:52:06 +0200] INFO: Starting Chef Run (Version 0.9.8)  
> [Mon, 13 Sep 2010 11:52:06 +0200] ERROR: bash[install\_app] (/tmp/chef-solo/cookbooks/imageserver/recipes/default.rb:17:in `from_file') had an error: "bash" "/tmp/chef-script.17504.0" returned 1, expected 0 /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:184:in `handle\_command\_failures'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:131:in `run_command' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/provider/execute.rb:49:in `action\_run'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/provider/script.rb:33:in `action_run' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:in `send'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:in `run_action' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:109:in `converge'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:in `each' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:in `converge'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource\_collection.rb:94:in `execute_each_resource' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource\_collection/stepable\_iterator.rb:116:in `call_iterator_block' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in `step'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource\_collection/stepable\_iterator.rb:104:in `iterate' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in `each\_with\_index'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource\_collection.rb:92:in `execute_each_resource' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:82:in `converge'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/client.rb:304:in `converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/client.rb:87:in `run'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/solo.rb:191:in `run_application' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/solo.rb:181:in `loop'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/solo.rb:181:in `run_application' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application.rb:62:in `run'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/chef-solo:25  
> /usr/bin/chef-solo:19:in `load' /usr/bin/chef-solo:19 [Mon, 13 Sep 2010 11:52:06 +0200] ERROR: Running exception handlers [Mon, 13 Sep 2010 11:52:06 +0200] ERROR: Exception handlers complete [Mon, 13 Sep 2010 11:52:06 +0200] ERROR: Re-raising exception: Chef::Exceptions::Exec - "bash" "/tmp/chef-script.17504.0" returned 1, expected 0 /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:184:in `handle\_command\_failures'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:131:in `run_command' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/provider/execute.rb:49:in `action\_run'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/provider/script.rb:33:in `action_run' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:in `send'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:in `run_action' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:109:in `converge'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:in `each' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:in `converge'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource\_collection.rb:94:in `execute_each_resource' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource\_collection/stepable\_iterator.rb:116:in `call_iterator_block' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in `step'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource\_collection/stepable\_iterator.rb:104:in `iterate' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in `each\_with\_index'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource\_collection.rb:92:in `execute_each_resource' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:82:in `converge'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/client.rb:304:in `converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/client.rb:87:in `run'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/solo.rb:191:in `run_application' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/solo.rb:181:in `loop'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/solo.rb:181:in `run_application' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application.rb:62:in `run'  
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/chef-solo:25  
> /usr/bin/chef-solo:19:in `load' /usr/bin/chef-solo:19 /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:184:in `handle\_command\_failures': "bash" "/tmp/chef-script.17504.0" returned 1, expected 0 (Chef::Exceptions::Exec)  
> from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:131:in `run_command' from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/provider/execute.rb:49:in `action\_run'  
> from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/provider/script.rb:33:in `action_run' from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:in `send'  
> from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:in `run_action' from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:109:in `converge'  
> from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:in `each' from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:in `converge'  
> ... 13 levels...  
> from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application.rb:62:in `run' from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/chef-solo:25 from /usr/bin/chef-solo:19:in `load'  
> from /usr/bin/chef-solo:19
> 
> thanks

---

<div class="post-metadata">

**Author:** ![Ran\_Tavory](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/ran_tavory/32/874_2.png) [@Ran\_Tavory](https://discourse.chef.io/u/Ran_Tavory)\
**Post date:** [September 13, 2010, 10:28am UTC](https://discourse.chef.io/t/how-to-debug-errors/1552/3 "2010-09-13T10:28:24Z")

</div>

as I mentioned, I'm learning it... now I know about the directory... thanks!

BTW, I haven't found a list of all available "commands" or not sure how  
should I call them, such as cookbook\_file, bash, directory etc. Could  
someone pls share a link?

On Mon, Sep 13, 2010 at 1:25 PM, Ash Berlin [ash\_opscode@firemirror.com](mailto:ash_opscode@firemirror.com)wrote:

> On 13 Sep 2010, at 11:19, Ran Tavory wrote:
> 
> > I'm only learning chef now and find it hard to develop and debug my  
> > recipe errors.  
> > All I can see are verbose stack traces but it's usually quite hard to dig  
> > the real error from the traces. The example below does not, as far as I can  
> > tell hint any specific error in my code (and there are obviously errors...)  
> > so I'm left with g-old trial and error.  
> > I was wondering what's the best approach to advance faster while leaning  
> > developing. I've made myself familiar with chef's basics and ran a few  
> > tutorials but when writing my own first recipe I'm having hard time  
> > bootstrapping.
> > 
> > The error below indicates some sort of bash error in a recipe although  
> > I'm not sure exactly what. I suppose the following code uses the wrong  
> > syntax but the real question isn't about the syntax it's about finding an  
> > effective way to write-compile-test.
> > 
> > 17 bash "install\_app" do  
> > 18 user "root"  
> > 19 code \<\<-EOH  
> > 20 mkdir -p #{node[:wars]}  
> > 21 cp #{node[:war\_src]} #{node[:war\_dest]}  
> > 22 EOH  
> > 23 end
> 
> Run with chef debug logging enable to see the full command output/error:
> 
> chef-solo -l debug ....
> 
> Also using bash to make a directory and the copy a file isn't what I'd  
> consider the 'chef' way of doing things.
> 
> directory node[:wars] do  
> recursive true  
> mode '0755'  
> end
> 
> etc.
> 
> -ash
> 
> > [root@centos imageserver]# chef-solo -c ~/solo.rb -j ~/node.json  
> > [Mon, 13 Sep 2010 11:52:06 +0200] INFO: Setting the run\_list to  
> > ["recipe[imageserver]"] from JSON  
> > [Mon, 13 Sep 2010 11:52:06 +0200] INFO: Starting Chef Run (Version 0.9.8)  
> > [Mon, 13 Sep 2010 11:52:06 +0200] ERROR: bash[install\_app]  
> > (/tmp/chef-solo/cookbooks/imageserver/recipes/default.rb:17:in `from\_file')  
> > had an error:  
> > "bash" "/tmp/chef-script.17504.0" returned 1, expected 0
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:184:in  
> `handle\_command\_failures'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:131:in  
> `run\_command'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/provider/execute.rb:49:in  
> `action\_run'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/provider/script.rb:33:in  
> `action\_run'
> 
> > /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:in  
> > `send' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:in `run\_action'  
> > /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:109:in  
> > `converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:in `each'  
> > /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:in  
> > `converge'
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource\_collection.rb:94:in  
> `execute\_each\_resource'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource\_collection/stepable\_iterator.rb:116:in  
> `call'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource\_collection/stepable\_iterator.rb:116:in  
> `call\_iterator\_block'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource\_collection/stepable\_iterator.rb:85:in  
> `step'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource\_collection/stepable\_iterator.rb:104:in  
> `iterate'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource\_collection/stepable\_iterator.rb:55:in  
> `each\_with\_index'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource\_collection.rb:92:in  
> `execute\_each\_resource'
> 
> > /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:82:in  
> > `converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/client.rb:304:in `converge'  
> > /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/client.rb:87:in  
> > `run'
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/solo.rb:191:in  
> `run\_application'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/solo.rb:181:in  
> `loop'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/solo.rb:181:in  
> `run\_application'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application.rb:62:in  
> `run'
> 
> > /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/chef-solo:25  
> > /usr/bin/chef-solo:19:in `load'  
> > /usr/bin/chef-solo:19  
> > [Mon, 13 Sep 2010 11:52:06 +0200] ERROR: Running exception handlers  
> > [Mon, 13 Sep 2010 11:52:06 +0200] ERROR: Exception handlers complete  
> > [Mon, 13 Sep 2010 11:52:06 +0200] ERROR: Re-raising exception:  
> > Chef::Exceptions::Exec - "bash" "/tmp/chef-script.17504.0" returned 1,  
> > expected 0
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:184:in  
> `handle\_command\_failures'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:131:in  
> `run\_command'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/provider/execute.rb:49:in  
> `action\_run'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/provider/script.rb:33:in  
> `action\_run'
> 
> > /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:in  
> > `send' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:in `run\_action'  
> > /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:109:in  
> > `converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:in `each'  
> > /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:in  
> > `converge'
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource\_collection.rb:94:in  
> `execute\_each\_resource'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource\_collection/stepable\_iterator.rb:116:in  
> `call'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource\_collection/stepable\_iterator.rb:116:in  
> `call\_iterator\_block'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource\_collection/stepable\_iterator.rb:85:in  
> `step'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource\_collection/stepable\_iterator.rb:104:in  
> `iterate'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource\_collection/stepable\_iterator.rb:55:in  
> `each\_with\_index'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource\_collection.rb:92:in  
> `execute\_each\_resource'
> 
> > /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:82:in  
> > `converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/client.rb:304:in `converge'  
> > /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/client.rb:87:in  
> > `run'
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/solo.rb:191:in  
> `run\_application'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/solo.rb:181:in  
> `loop'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/solo.rb:181:in  
> `run\_application'
> 
> > 
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application.rb:62:in  
> `run'
> 
> > /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/chef-solo:25  
> > /usr/bin/chef-solo:19:in `load'  
> > /usr/bin/chef-solo:19
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:184:in  
> `handle\_command\_failures': "bash" "/tmp/chef-script.17504.0" returned 1,  
> expected 0 (Chef::Exceptions::Exec)
> 
> > ```
> > from
> > 
> > ```
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:131:in  
> `run\_command'
> 
> > ```
> > from
> > 
> > ```
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/provider/execute.rb:49:in  
> `action\_run'
> 
> > ```
> > from
> > 
> > ```
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/provider/script.rb:33:in  
> `action\_run'
> 
> > ```
> > from
> > 
> > ```
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:in  
> `send'
> 
> > ```
> > from
> > 
> > ```
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:in  
> `run\_action'
> 
> > ```
> > from
> > 
> > ```
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:109:in  
> `converge'
> 
> > ```
> > from
> > 
> > ```
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:in  
> `each'
> 
> > ```
> > from
> > 
> > ```
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:in  
> `converge'
> 
> > ```
> > ... 13 levels...
> > from
> > 
> > ```
> 
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application.rb:62:in  
> `run'
> 
> > ```
> > from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/chef-solo:25
> > from /usr/bin/chef-solo:19:in `load'
> > from /usr/bin/chef-solo:19
> > 
> > ```
> > 
> > thanks

--  
/Ran

---

<div class="post-metadata">

**Author:** ![Ash\_Berlin](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@Ash\_Berlin](https://discourse.chef.io/u/Ash_Berlin)\
**Post date:** [September 13, 2010, 10:29am UTC](https://discourse.chef.io/t/how-to-debug-errors/1552/4 "2010-09-13T10:29:45Z")

</div>

On 13 Sep 2010, at 11:28, Ran Tavory wrote:

> as I mentioned, I'm learning it... now I know about the directory... thanks!
> 
> BTW, I haven't found a list of all available "commands" or not sure how should I call them, such as cookbook\_file, bash, directory etc. Could someone pls share a link?

[wiki.opscode.com/display/chef/Resources](http://wiki.opscode.com/display/chef/Resources) is what I use.

---

<div class="post-metadata">

**Author:** ![Sahil\_R\_Cooner](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/sahil_r_cooner/32/773_2.png) [@Sahil\_R\_Cooner](https://discourse.chef.io/u/Sahil_R_Cooner)\
**Post date:** [September 13, 2010, 10:37am UTC](https://discourse.chef.io/t/how-to-debug-errors/1552/5 "2010-09-13T10:37:33Z")

</div>

Shef is also a really good tool for debugging interactively instead of  
just getting debug messages at runtime.

Sent from my iPad

On Sep 13, 2010, at 3:29 AM, Ash Berlin [ash\_opscode@firemirror.com](mailto:ash_opscode@firemirror.com) wrote:

> On 13 Sep 2010, at 11:28, Ran Tavory wrote:
> 
> > as I mentioned, I'm learning it... now I know about the directory... thanks!
> > 
> > BTW, I haven't found a list of all available "commands" or not sure how should I call them, such as cookbook\_file, bash, directory etc. Could someone pls share a link?
> 
> [wiki.opscode.com/display/chef/Resources](http://wiki.opscode.com/display/chef/Resources) is what I use.

---

<div class="post-metadata">

**Author:** ![Charles\_Sullivan](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/charles_sullivan/32/483_2.png) [@Charles\_Sullivan](https://discourse.chef.io/u/Charles_Sullivan)\
**Post date:** [September 13, 2010, 1:59pm UTC](https://discourse.chef.io/t/how-to-debug-errors/1552/6 "2010-09-13T13:59:37Z")

</div>

Are you deploying a war file to Tomcat or an application server? If you're  
using Tomcat, you may want to try using the Tomcat Manager API wrapper. I've  
successfully implemented it an it makes deploying war files very elegant.

--Charlie

On Mon, Sep 13, 2010 at 5:37 AM, Sahil Cooner [sahil.cooner@gmail.com](mailto:sahil.cooner@gmail.com)wrote:

> Shef is also a really good tool for debugging interactively instead of  
> just getting debug messages at runtime.
> 
> Sent from my iPad
> 
> On Sep 13, 2010, at 3:29 AM, Ash Berlin [ash\_opscode@firemirror.com](mailto:ash_opscode@firemirror.com)  
> wrote:
> 
> > On 13 Sep 2010, at 11:28, Ran Tavory wrote:
> > 
> > > as I mentioned, I'm learning it... now I know about the directory...  
> > > thanks!
> > > 
> > > BTW, I haven't found a list of all available "commands" or not sure how  
> > > should I call them, such as cookbook\_file, bash, directory etc. Could  
> > > someone pls share a link?
> > 
> > [wiki.opscode.com/display/chef/Resources](http://wiki.opscode.com/display/chef/Resources) is what I use.

--  
Charles Sullivan  
[charlie.sullivan@gmail.com](mailto:charlie.sullivan@gmail.com)

---

<div class="post-metadata">

**Author:** ![Ran\_Tavory](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/ran_tavory/32/874_2.png) [@Ran\_Tavory](https://discourse.chef.io/u/Ran_Tavory)\
**Post date:** [September 13, 2010, 2:09pm UTC](https://discourse.chef.io/t/how-to-debug-errors/1552/7 "2010-09-13T14:09:28Z")

</div>

I'm deploying wars, yes.  
Currently I;m only playing but eventually I'll want to deploy wars and for  
offline java processes some independent jars as well.  
I was thinking of RPM-ing the wars and installing them with the pkg or some  
other command but I haven't decided yet, still learning.

The tomcat manager API is nice but is a no-go for me. The applications I'm  
deploying are too crappy to withstand a hot-deploy so I need to take tomcat  
down, copy wars and restart.

On Mon, Sep 13, 2010 at 4:59 PM, Charles Sullivan \<  
[charlie.sullivan@gmail.com](mailto:charlie.sullivan@gmail.com)\> wrote:

> Are you deploying a war file to Tomcat or an application server? If you're  
> using Tomcat, you may want to try using the Tomcat Manager API wrapper. I've  
> successfully implemented it an it makes deploying war files very elegant.
> 
> --Charlie
> 
> On Mon, Sep 13, 2010 at 5:37 AM, Sahil Cooner [sahil.cooner@gmail.com](mailto:sahil.cooner@gmail.com)wrote:
> 
> > Shef is also a really good tool for debugging interactively instead of  
> > just getting debug messages at runtime.
> > 
> > Sent from my iPad
> > 
> > On Sep 13, 2010, at 3:29 AM, Ash Berlin [ash\_opscode@firemirror.com](mailto:ash_opscode@firemirror.com)  
> > wrote:
> > 
> > > On 13 Sep 2010, at 11:28, Ran Tavory wrote:
> > > 
> > > > as I mentioned, I'm learning it... now I know about the directory...  
> > > > thanks!
> > > > 
> > > > BTW, I haven't found a list of all available "commands" or not sure how  
> > > > should I call them, such as cookbook\_file, bash, directory etc. Could  
> > > > someone pls share a link?
> > > 
> > > [wiki.opscode.com/display/chef/Resources](http://wiki.opscode.com/display/chef/Resources) is what I use.
> 
> --  
> Charles Sullivan  
> [charlie.sullivan@gmail.com](mailto:charlie.sullivan@gmail.com)

--  
/Ran
