# Why does my run fail wheh I use ignore\_failure true?

**URL:** <https://discourse.chef.io/t/why-does-my-run-fail-wheh-i-use-ignore-failure-true/4345>\
**Category:** Chef Infra (archive)\
**Created:** [August 5, 2013, 9:31am UTC](https://discourse.chef.io/t/why-does-my-run-fail-wheh-i-use-ignore-failure-true/4345 "2013-08-05T09:31:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Montgomery](https://avatars.discourse-cdn.com/v4/letter/d/51bf81/32.png) [@David\_Montgomery](https://discourse.chef.io/u/David_Montgomery)\
**Post date:** [August 5, 2013, 9:31am UTC](https://discourse.chef.io/t/why-does-my-run-fail-wheh-i-use-ignore-failure-true/4345/1 "2013-08-05T09:31:04Z")

</div>

Why does my run fail when I use ignore\_failure true?

I was under the impression that if I use ignore\_failure and have a fail  
will continue…

[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) Relevant File Content:  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) ----------------------  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com/var/chef/cache/cookbooks/bootstrap/recipes/aws\_monitor\_tag.rb:](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com/var/chef/cache/cookbooks/bootstrap/recipes/aws_monitor_tag.rb:)  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 1: include\_recipe "aws"  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 2:  
data\_bag(“my\_data\_bag”)  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 3: db =  
data\_bag\_item(“my\_data\_bag”, “my”)  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 4: aws = db[  
node.chef\_environment][‘aws’]  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 5: AWS\_ACCESS\_KEY\_ID =  
aws[‘AWS\_ACCESS\_KEY\_ID’]  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 6:  
AWS\_SECRET\_ACCESS\_KEY = aws[‘AWS\_SECRET\_ACCESS\_KEY’]  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 7:  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 8\>\> aws\_resource\_tag  
node[‘ec2’][‘instance\_id’] do  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 9: aws\_access\_key  
aws[‘AWS\_ACCESS\_KEY\_ID’]  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 10:  
aws\_secret\_access\_key aws[‘AWS\_SECRET\_ACCESS\_KEY’]  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 11: tags({“Name” =\>  
“Monitor”,  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 12: “node\_name”  
=\> “#{[node.name](http://node.name)}”,  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 13:  
“environment” =\> node.chef\_environment})  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 14: action :update  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 15: ignore\_failure  
true  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 16: end 17:  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)[2013-08-05T09:27:01+00:00]  
ERROR: Running exception handlers  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)[2013-08-05T09:27:01+00:00]  
ERROR: Exception handlers complete  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)[2013-08-05T09:27:01+00:00]  
FATAL: Stacktrace dumped to  
/var/chef/cache/chef-stacktrace.out  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) Chef Client failed. 0  
resources updated  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)[2013-08-05T09:27:01+00:00]  
FATAL: Chef::Exceptions::ChildConvergeError:  
Chef run process exited unsuccessfully (exit code 1)

---

<div class="post-metadata">

**Author:** ![Andrew\_Gross](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/andrew_gross/32/320_2.png) [@Andrew\_Gross](https://discourse.chef.io/u/Andrew_Gross)\
**Post date:** [August 5, 2013, 2:40pm UTC](https://discourse.chef.io/t/why-does-my-run-fail-wheh-i-use-ignore-failure-true/4345/2 "2013-08-05T14:40:39Z")

</div>

Can you paste a larger snippet of the failed run? It is possible it is  
failing when it is parsing the code, not when it is running it, however it  
is hard to tell from this message.

On Mon, Aug 5, 2013 at 5:31 AM, David Montgomery  
[davidmontgomery@gmail.com](mailto:davidmontgomery@gmail.com)wrote:

> Why does my run fail when I use ignore\_failure true?
> 
> I was under the impression that if I use ignore\_failure and have a fail  
> will continue........
> 
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) Relevant File Content:  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) ----------------------  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com/var/chef/cache/cookbooks/bootstrap/recipes/aws\_monitor\_tag.rb:](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com/var/chef/cache/cookbooks/bootstrap/recipes/aws_monitor_tag.rb:)  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 1: include\_recipe  
> "aws"  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 2:  
> data\_bag("my\_data\_bag")  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 3: db =  
> data\_bag\_item("my\_data\_bag", "my")  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 4: aws = db[  
> node.chef\_environment]['aws']  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 5: AWS\_ACCESS\_KEY\_ID  
> = aws['AWS\_ACCESS\_KEY\_ID']  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 6:  
> AWS\_SECRET\_ACCESS\_KEY = aws['AWS\_SECRET\_ACCESS\_KEY']  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 7:  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 8\>\> aws\_resource\_tag  
> node['ec2']['instance\_id'] do  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 9: aws\_access\_key  
> aws['AWS\_ACCESS\_KEY\_ID']  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 10:  
> aws\_secret\_access\_key aws['AWS\_SECRET\_ACCESS\_KEY']  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 11: tags({"Name" =\>  
> "Monitor",  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 12:  
> "node\_name" =\> "#{node.name}",  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 13:  
> "environment" =\> node.chef\_environment})  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 14: action :update  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 15: ignore\_failure  
> true  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 16: end 17:  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)[2013-08-05T09:27:01+00:00] ERROR: Running exception handlers  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)[2013-08-05T09:27:01+00:00] ERROR: Exception handlers complete  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)[2013-08-05T09:27:01+00:00] FATAL: Stacktrace dumped to  
> /var/chef/cache/chef-stacktrace.out  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) Chef Client failed. 0  
> resources updated  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)  
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)[2013-08-05T09:27:01+00:00] FATAL: Chef::Exceptions::ChildConvergeError:  
> Chef run process exited unsuccessfully (exit code 1)

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [August 5, 2013, 3:14pm UTC](https://discourse.chef.io/t/why-does-my-run-fail-wheh-i-use-ignore-failure-true/4345/3 "2013-08-05T15:14:01Z")

</div>

On Monday, August 5, 2013 at 7:40 AM, Andrew Gross wrote:

> Can you paste a larger snippet of the failed run? It is possible it is failing when it is parsing the code, not when it is running it, however it is hard to tell from this message.

This is definitely the case:  
(snip…)

> > [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) ([http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)) 8\>\> aws\_resource\_tag node['ec2']['instance\_id'] do  
> > Your error is in the compile phase right there. Probably you're on VPC or a new EC2 account that is "VPC-ish", so ohai can't automatically detect EC2.

See: [Ohai 6.14.0 released - Chef Blog | Chef](http://www.opscode.com/blog/2012/05/30/ohai-6-14-0-released/)  
And, when the ticket system comes back, see OHAI-310.

To create the ec2 "hint", create /etc/chef/ohai/hints/ec.json (doesn't need any content). The knife-ec2 plugin does this automatically, if you're using a different provisioning workflow, you'll probably want to add a step to create that file.

--  
Daniel DeLeo

---

<div class="post-metadata">

**Author:** ![steve](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/steve/32/294_2.png) [@steve](https://discourse.chef.io/u/steve)\
**Post date:** [August 5, 2013, 5:19pm UTC](https://discourse.chef.io/t/why-does-my-run-fail-wheh-i-use-ignore-failure-true/4345/4 "2013-08-05T17:19:32Z")

</div>

To answer the larger question, "Why does my Chef run fail if I set  
ignore\_failure to true on a resource?"

Chef runs will fail if an exception is raised. Exceptions can be raised  
within a resource provider, or they can be raised in the Ruby code you  
write in between declaring resources.

Common culprits (in my experience):

- Making assumptions about nested node data being present. (For example,  
'if node[:foo][:bar] == "baz"' fails because node[:foo] isn't defined)
- Running external code (including Chef searches and data bag lookups!)  
without a rescue block.
- Attempting to load a gem that isn't installed on the system (yet, or  
ever).

Foodcritic rules for these situations would be awesome and I'd love to  
write them, but looking into the inner workings of the Ruby AST parser code  
gives me a serious case of brain-fry every time...

Hope this helps the OP understand the general situation (or, failing that,  
helps someone Googling this question 😃 ) ...

On Mon, Aug 5, 2013 at 8:14 AM, Daniel DeLeo [dan@kallistec.com](mailto:dan@kallistec.com) wrote:

> On Monday, August 5, 2013 at 7:40 AM, Andrew Gross wrote:
> 
> Can you paste a larger snippet of the failed run? It is possible it is  
> failing when it is parsing the code, not when it is running it, however it  
> is hard to tell from this message.
> 
> This is definitely the case:  
> (snip…)
> 
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 8\>\> aws\_resource\_tag  
> node['ec2']['instance\_id'] do\
> 
> Your error is in the compile phase right there. Probably you're on VPC or  
> a new EC2 account that is "VPC-ish", so ohai can't automatically detect  
> EC2.
> 
> See: [Ohai 6.14.0 released - Chef Blog | Chef](http://www.opscode.com/blog/2012/05/30/ohai-6-14-0-released/)  
> And, when the ticket system comes back, see OHAI-310.
> 
> To create the ec2 "hint", create /etc/chef/ohai/hints/ec.json (doesn't  
> need any content). The knife-ec2 plugin does this automatically, if you're  
> using a different provisioning workflow, you'll probably want to add a step  
> to create that file.
> 
> --  
> Daniel DeLeo

---

<div class="post-metadata">

**Author:** ![Mike](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/mike/32/18_2.png) [@Mike](https://discourse.chef.io/u/Mike)\
**Post date:** [August 5, 2013, 6:10pm UTC](https://discourse.chef.io/t/why-does-my-run-fail-wheh-i-use-ignore-failure-true/4345/5 "2013-08-05T18:10:59Z")

</div>

> Foodcritic rules for these situations would be awesome and I'd love to write  
> them, but looking into the inner workings of the Ruby AST parser code gives  
> me a serious case of brain-fry every time...  
> OT: This could be interesting, although I'm not certain how these  
> scenarios might be implemented as checks, since not every gem is named  
> the same as its packaging, et al.  
> Another thread on this topic of FC custom/extended rules might be useful.

-M

On Mon, Aug 5, 2013 at 1:19 PM, steve . [leftathome@gmail.com](mailto:leftathome@gmail.com) wrote:

> To answer the larger question, "Why does my Chef run fail if I set  
> ignore\_failure to true on a resource?"
> 
> Chef runs will fail if an exception is raised. Exceptions can be raised  
> within a resource provider, or they can be raised in the Ruby code you write  
> in between declaring resources.
> 
> Common culprits (in my experience):
> 
> - Making assumptions about nested node data being present. (For example,  
> 'if node[:foo][:bar] == "baz"' fails because node[:foo] isn't defined)
> - Running external code (including Chef searches and data bag lookups!)  
> without a rescue block.
> - Attempting to load a gem that isn't installed on the system (yet, or  
> ever).
> 
> Foodcritic rules for these situations would be awesome and I'd love to write  
> them, but looking into the inner workings of the Ruby AST parser code gives  
> me a serious case of brain-fry every time...
> 
> Hope this helps the OP understand the general situation (or, failing that,  
> helps someone Googling this question 😃 ) ...
> 
> On Mon, Aug 5, 2013 at 8:14 AM, Daniel DeLeo [dan@kallistec.com](mailto:dan@kallistec.com) wrote:
> 
> > On Monday, August 5, 2013 at 7:40 AM, Andrew Gross wrote:
> > 
> > Can you paste a larger snippet of the failed run? It is possible it is  
> > failing when it is parsing the code, not when it is running it, however it  
> > is hard to tell from this message.
> > 
> > This is definitely the case:  
> > (snip…)
> > 
> > [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 8\>\> aws\_resource\_tag  
> > node['ec2']['instance\_id'] do\
> > 
> > Your error is in the compile phase right there. Probably you're on VPC or  
> > a new EC2 account that is "VPC-ish", so ohai can't automatically detect EC2.
> > 
> > See: [Ohai 6.14.0 released - Chef Blog | Chef](http://www.opscode.com/blog/2012/05/30/ohai-6-14-0-released/)  
> > And, when the ticket system comes back, see OHAI-310.
> > 
> > To create the ec2 "hint", create /etc/chef/ohai/hints/ec.json (doesn't  
> > need any content). The knife-ec2 plugin does this automatically, if you're  
> > using a different provisioning workflow, you'll probably want to add a step  
> > to create that file.
> > 
> > --  
> > Daniel DeLeo

---

<div class="post-metadata">

**Author:** ![David\_Montgomery](https://avatars.discourse-cdn.com/v4/letter/d/51bf81/32.png) [@David\_Montgomery](https://discourse.chef.io/u/David_Montgomery)\
**Post date:** [August 5, 2013, 6:15pm UTC](https://discourse.chef.io/t/why-does-my-run-fail-wheh-i-use-ignore-failure-true/4345/6 "2013-08-05T18:15:03Z")

</div>

Thats the the thing....I am using the /etc/chef/ohai/hints/  
ec.json in a previous recipe before I try and add the tag. It did work on  
an existing server.

On Mon, Aug 5, 2013 at 11:14 PM, Daniel DeLeo [dan@kallistec.com](mailto:dan@kallistec.com) wrote:

> On Monday, August 5, 2013 at 7:40 AM, Andrew Gross wrote:
> 
> Can you paste a larger snippet of the failed run? It is possible it is  
> failing when it is parsing the code, not when it is running it, however it  
> is hard to tell from this message.
> 
> This is definitely the case:  
> (snip…)
> 
> [ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 8\>\> aws\_resource\_tag  
> node['ec2']['instance\_id'] do\
> 
> Your error is in the compile phase right there. Probably you're on VPC or  
> a new EC2 account that is "VPC-ish", so ohai can't automatically detect  
> EC2.
> 
> See: [Ohai 6.14.0 released - Chef Blog | Chef](http://www.opscode.com/blog/2012/05/30/ohai-6-14-0-released/)  
> And, when the ticket system comes back, see OHAI-310.
> 
> To create the ec2 "hint", create /etc/chef/ohai/hints/ec.json (doesn't  
> need any content). The knife-ec2 plugin does this automatically, if you're  
> using a different provisioning workflow, you'll probably want to add a step  
> to create that file.
> 
> --  
> Daniel DeLeo

---

<div class="post-metadata">

**Author:** ![Matt\_Ray\_OPSCODE](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/matt_ray_opscode/32/459_2.png) [@Matt\_Ray\_OPSCODE](https://discourse.chef.io/u/Matt_Ray_OPSCODE)\
**Post date:** [August 5, 2013, 6:26pm UTC](https://discourse.chef.io/t/why-does-my-run-fail-wheh-i-use-ignore-failure-true/4345/7 "2013-08-05T18:26:13Z")

</div>

You mean /etc/chef/ohai/hints/ec2.json right?

Thanks,  
Matt Ray  
Cloud Integrations Product Lead :: Opscode[http://opscode.com](http://opscode.com)  
512.731.2218 :: [matt@opscode.com](mailto:matt@opscode.com)  
mattray :: GitHub[http://github.com/mattray/](http://github.com/mattray/) :: IRC :: Twitter[http://twitter.com/mattray](http://twitter.com/mattray)

* * *

From: David Montgomery [davidmontgomery@gmail.com](mailto:davidmontgomery@gmail.com)  
Sent: Monday, August 05, 2013 1:15 PM  
To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
Subject: [chef] Re: Re: Re: Why does my run fail wheh I use ignore\_failure true?

Thats the the thing…I am using the /etc/chef/ohai/hints/  
ec.json in a previous recipe before I try and add the tag. It did work on an existing server.

On Mon, Aug 5, 2013 at 11:14 PM, Daniel DeLeo \<[dan@kallistec.com](mailto:dan@kallistec.com)[mailto:dan@kallistec.com](mailto:dan@kallistec.com)\> wrote:  
On Monday, August 5, 2013 at 7:40 AM, Andrew Gross wrote:  
Can you paste a larger snippet of the failed run? It is possible it is failing when it is parsing the code, not when it is running it, however it is hard to tell from this message.  
This is definitely the case:  
(snip…)  
[ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com)[http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com](http://ec2-54-215-148-92.us-west-1.compute.amazonaws.com) 8\>\> aws\_resource\_tag node[‘ec2’][‘instance\_id’] do  
Your error is in the compile phase right there. Probably you’re on VPC or a new EC2 account that is “VPC-ish”, so ohai can’t automatically detect EC2.

See: [http://www.opscode.com/blog/2012/05/30/ohai-6-14-0-released/](http://www.opscode.com/blog/2012/05/30/ohai-6-14-0-released/)  
And, when the ticket system comes back, see OHAI-310.

To create the ec2 “hint”, create /etc/chef/ohai/hints/ec.json (doesn’t need any content). The knife-ec2 plugin does this automatically, if you’re using a different provisioning workflow, you’ll probably want to add a step to create that file.

–  
Daniel DeLeo
