# Chef Cookbook Compilation Error While Bootstrapping The Node

**URL:** <https://discourse.chef.io/t/chef-cookbook-compilation-error-while-bootstrapping-the-node/3732>\
**Category:** Chef Infra (archive)\
**Created:** [March 13, 2013, 9:25am UTC](https://discourse.chef.io/t/chef-cookbook-compilation-error-while-bootstrapping-the-node/3732 "2013-03-13T09:25:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Noman\_Aamir](https://avatars.discourse-cdn.com/v4/letter/n/3da27b/32.png) [@Noman\_Aamir](https://discourse.chef.io/u/Noman_Aamir)\
**Post date:** [March 13, 2013, 9:25am UTC](https://discourse.chef.io/t/chef-cookbook-compilation-error-while-bootstrapping-the-node/3732/1 "2013-03-13T09:25:42Z")

</div>

I am using chef to bootstrap a node. I have created encrypted data bags and  
copied the secret key on the node as /etc/chef/encrypted\_data\_bag\_secret.

When I try to bootstrap the node, I am getting the following error:

# ================================================================================ Recipe Compile Error in /var/chef/cache/cookbooks/webapps-configs/recipes/httpd.rb

## Net::HTTPServerException

## 404 "Not Found" Cookbook Trace:

## /var/chef/cache/cookbooks/webapps-configs/recipes/httpd.rb:12:in `from\_file’ Relevant File Content:

/var/chef/cache/cookbooks/webapps-configs/recipes/httpd.rb:

10:  
11: CHEF\_ENV = node.chef\_environment  
12\>\> http\_ssl\_creds = Chef::EncryptedDataBagItem.load("#{CHEF\_ENV}",  
“http-ssl”)  
13: PRIVATE\_KEY = http\_ssl\_creds[“private\_key”]  
14: CHAIN\_FILE= http\_ssl\_creds[“chain\_file”]  
15: CERT= http\_ssl\_creds[“cert”]  
16:

ERROR: Running exception handlers  
FATAL: Saving node information to /var/chef/cache/failed-run-data.json  
ERROR: Exception handlers complete  
Chef Client failed. 0 resources updated  
FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out  
FATAL: Net::HTTPServerException: 404 "Not Found"  
Here is the stack trace:

Net::HTTPServerException: 404 “Not Found”  
/opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:2632:in `error!' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/rest.rb:199:in`block in raw\_http\_request’  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/rest.rb:280:in  
`retriable_rest_request' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/rest.rb:164:in`raw\_http\_request’  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/rest.rb:158:in  
`api_request' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/rest.rb:99:in`get’  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/data\_bag\_item.rb:149:in  
`load' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/encrypted_data_bag_item.rb:294:in`load’  
/var/chef/cache/cookbooks/webapps-configs/recipes/httpd.rb:12:in `from_file' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/mixin/from_file.rb:30:in`instance\_eval’  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/mixin/from\_file.rb:30:in  
`from_file' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/cookbook_version.rb:346:in`load\_recipe’  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/run\_context.rb:151:in  
`load_recipe' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/run_context/cookbook_compiler.rb:139:in`block in compile\_recipes’  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/run\_context/cookbook\_compiler.rb:137:in  
`each' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/run_context/cookbook_compiler.rb:137:in`compile\_recipes’  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/run\_context/cookbook\_compiler.rb:74:in  
`compile' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/run_context.rb:86:in`load’  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/client.rb:224:in  
`setup_run_context' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/client.rb:467:in`do\_run’  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/client.rb:200:in  
`run' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application.rb:190:in`run\_chef\_client’  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application/client.rb:297:in  
`block in run_application' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application/client.rb:290:in`loop’  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application/client.rb:290:in  
`run_application' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application.rb:73:in`run’  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/bin/chef-client:26:in  
`<top (required)>' /usr/bin/chef-client:23:in`load’  
/usr/bin/chef-client:23:in `’

Any help or pointers?

---

<div class="post-metadata">

**Author:** ![Ranjib](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/ranjib/32/1040_2.png) [@Ranjib](https://discourse.chef.io/u/Ranjib)\
**Post date:** [March 13, 2013, 1:25pm UTC](https://discourse.chef.io/t/chef-cookbook-compilation-error-while-bootstrapping-the-node/3732/2 "2013-03-13T13:25:37Z")

</div>

the httpd recipe in webapps-configs cookbook trying to access a data bag  
with the name same as the node's chef environment and item name as  
''http-ssl" , and not able to retrieve it. Check manually if you have that  
databag item. i.e. ` knife data bag show "node env" http-ssl --secret-file FILE` is showing something

On Wed, Mar 13, 2013 at 2:25 AM, Mahrob Hijazim [mahrobiyat@gmail.com](mailto:mahrobiyat@gmail.com)wrote:

> I am using chef to bootstrap a node. I have created encrypted data bags and  
> copied the secret key on the node as /etc/chef/encrypted\_data\_bag\_secret.
> 
> When I try to bootstrap the node, I am getting the following error:
> 
> ================================================================================  
> Recipe Compile Error in  
> /var/chef/cache/cookbooks/webapps-configs/recipes/httpd.rb
> 
> ## ================================================================================ Net::HTTPServerException
> 
> ## 404 "Not Found" Cookbook Trace:
> 
> ## /var/chef/cache/cookbooks/webapps-configs/recipes/httpd.rb:12:in `from\_file' Relevant File Content:
> 
> /var/chef/cache/cookbooks/webapps-configs/recipes/httpd.rb:
> 
> 10:  
> 11: CHEF\_ENV = node.chef\_environment  
> 12\>\> http\_ssl\_creds = Chef::EncryptedDataBagItem.load("#{CHEF\_ENV}",  
> "http-ssl")  
> 13: PRIVATE\_KEY = http\_ssl\_creds["private\_key"]  
> 14: CHAIN\_FILE= http\_ssl\_creds["chain\_file"]  
> 15: CERT= http\_ssl\_creds["cert"]  
> 16:
> 
> ERROR: Running exception handlers  
> FATAL: Saving node information to /var/chef/cache/failed-run-data.json  
> ERROR: Exception handlers complete  
> Chef Client failed. 0 resources updated  
> FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out  
> FATAL: Net::HTTPServerException: 404 "Not Found"  
> Here is the stack trace:
> 
> Net::HTTPServerException: 404 "Not Found"  
> /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:2632:in `error!'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/rest.rb:199:in  
> `block in raw\_http\_request'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/rest.rb:280:in  
> `retriable\_rest\_request'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/rest.rb:164:in  
> `raw\_http\_request'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/rest.rb:158:in  
> `api\_request'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/rest.rb:99:in  
> `get'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/data\_bag\_item.rb:149:in  
> `load'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/encrypted\_data\_bag\_item.rb:294:in  
> `load' /var/chef/cache/cookbooks/webapps-configs/recipes/httpd.rb:12:in `from\_file'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/mixin/from\_file.rb:30:in  
> `instance\_eval'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/mixin/from\_file.rb:30:in  
> `from\_file'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/cookbook\_version.rb:346:in  
> `load\_recipe'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/run\_context.rb:151:in  
> `load\_recipe'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/run\_context/cookbook\_compiler.rb:139:in  
> `block in compile\_recipes'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/run\_context/cookbook\_compiler.rb:137:in  
> `each'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/run\_context/cookbook\_compiler.rb:137:in  
> `compile\_recipes'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/run\_context/cookbook\_compiler.rb:74:in  
> `compile'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/run\_context.rb:86:in  
> `load'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/client.rb:224:in  
> `setup\_run\_context'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/client.rb:467:in  
> `do\_run'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/client.rb:200:in  
> `run'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application.rb:190:in  
> `run\_chef\_client'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application/client.rb:297:in  
> `block in run\_application'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application/client.rb:290:in  
> `loop'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application/client.rb:290:in  
> `run\_application'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application.rb:73:in  
> `run'
> 
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/bin/chef-client:26:in  
> `<top (required)>' /usr/bin/chef-client:23:in `load'  
> /usr/bin/chef-client:23:in `'
> 
> Any help or pointers?

---

<div class="post-metadata">

**Author:** ![Noman\_Aamir](https://avatars.discourse-cdn.com/v4/letter/n/3da27b/32.png) [@Noman\_Aamir](https://discourse.chef.io/u/Noman_Aamir)\
**Post date:** [March 13, 2013, 1:31pm UTC](https://discourse.chef.io/t/chef-cookbook-compilation-error-while-bootstrapping-the-node/3732/3 "2013-03-13T13:31:29Z")

</div>

Thanks for the response, yes I verified both encrypted and de-crypted  
values, and those shows up properly.

The following command was used:

knife data bag show test-env http-ssl

-Mahrob

On Wed, Mar 13, 2013 at 5:25 PM, Ranjib Dey [dey.ranjib@gmail.com](mailto:dey.ranjib@gmail.com) wrote:

> the httpd recipe in webapps-configs cookbook trying to access a data bag  
> with the name same as the node's chef environment and item name as  
> ''http-ssl" , and not able to retrieve it. Check manually if you have that  
> databag item. i.e. ` knife data bag show "node env" http-ssl --secret-file FILE` is showing something
> 
> On Wed, Mar 13, 2013 at 2:25 AM, Mahrob Hijazim [mahrobiyat@gmail.com](mailto:mahrobiyat@gmail.com)wrote:
> 
> > I am using chef to bootstrap a node. I have created encrypted data bags  
> > and  
> > copied the secret key on the node as /etc/chef/encrypted\_data\_bag\_secret.
> > 
> > When I try to bootstrap the node, I am getting the following error:
> > 
> > ================================================================================  
> > Recipe Compile Error in  
> > /var/chef/cache/cookbooks/webapps-configs/recipes/httpd.rb
> > 
> > ## ================================================================================ Net::HTTPServerException
> > 
> > ## 404 "Not Found" Cookbook Trace:
> > 
> > ## /var/chef/cache/cookbooks/webapps-configs/recipes/httpd.rb:12:in `from\_file' Relevant File Content:
> > 
> > /var/chef/cache/cookbooks/webapps-configs/recipes/httpd.rb:
> > 
> > 10:  
> > 11: CHEF\_ENV = node.chef\_environment  
> > 12\>\> http\_ssl\_creds = Chef::EncryptedDataBagItem.load("#{CHEF\_ENV}",  
> > "http-ssl")  
> > 13: PRIVATE\_KEY = http\_ssl\_creds["private\_key"]  
> > 14: CHAIN\_FILE= http\_ssl\_creds["chain\_file"]  
> > 15: CERT= http\_ssl\_creds["cert"]  
> > 16:
> > 
> > ERROR: Running exception handlers  
> > FATAL: Saving node information to /var/chef/cache/failed-run-data.json  
> > ERROR: Exception handlers complete  
> > Chef Client failed. 0 resources updated  
> > FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out  
> > FATAL: Net::HTTPServerException: 404 "Not Found"  
> > Here is the stack trace:
> > 
> > Net::HTTPServerException: 404 "Not Found"  
> > /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:2632:in `error!'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/rest.rb:199:in  
> > `block in raw\_http\_request'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/rest.rb:280:in  
> > `retriable\_rest\_request'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/rest.rb:164:in  
> > `raw\_http\_request'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/rest.rb:158:in  
> > `api\_request'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/rest.rb:99:in  
> > `get'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/data\_bag\_item.rb:149:in  
> > `load'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/encrypted\_data\_bag\_item.rb:294:in  
> > `load' /var/chef/cache/cookbooks/webapps-configs/recipes/httpd.rb:12:in `from\_file'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/mixin/from\_file.rb:30:in  
> > `instance\_eval'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/mixin/from\_file.rb:30:in  
> > `from\_file'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/cookbook\_version.rb:346:in  
> > `load\_recipe'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/run\_context.rb:151:in  
> > `load\_recipe'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/run\_context/cookbook\_compiler.rb:139:in  
> > `block in compile\_recipes'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/run\_context/cookbook\_compiler.rb:137:in  
> > `each'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/run\_context/cookbook\_compiler.rb:137:in  
> > `compile\_recipes'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/run\_context/cookbook\_compiler.rb:74:in  
> > `compile'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/run\_context.rb:86:in  
> > `load'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/client.rb:224:in  
> > `setup\_run\_context'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/client.rb:467:in  
> > `do\_run'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/client.rb:200:in  
> > `run'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application.rb:190:in  
> > `run\_chef\_client'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application/client.rb:297:in  
> > `block in run\_application'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application/client.rb:290:in  
> > `loop'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application/client.rb:290:in  
> > `run\_application'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application.rb:73:in  
> > `run'
> > 
> > /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/bin/chef-client:26:in  
> > `<top (required)>' /usr/bin/chef-client:23:in `load'  
> > /usr/bin/chef-client:23:in `'
> > 
> > Any help or pointers?
