# apache2 problem

**URL:** <https://discourse.chef.io/t/apache2-problem/5534>\
**Category:** Chef Infra (archive)\
**Created:** [July 3, 2014, 6:58am UTC](https://discourse.chef.io/t/apache2-problem/5534 "2014-07-03T06:58:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Indra\_k](https://avatars.discourse-cdn.com/v4/letter/i/c89c15/32.png) [@Indra\_k](https://discourse.chef.io/u/Indra_k)\
**Post date:** [July 3, 2014, 6:58am UTC](https://discourse.chef.io/t/apache2-problem/5534/1 "2014-07-03T06:58:11Z")

</div>

Hi,

```
    When i running apache2 package it shows error:

       chef-client -o recipe['apache2']

       Starting Chef Client, version 11.4.4

```

172.16.1.121  
172.16.1.121 resolving cookbooks for run list: [“apache2”]  
172.16.1.121  
172.16.1.121 Synchronizing Cookbooks:  
172.16.1.121  
172.16.1.121 - apache2  
172.16.1.121  
172.16.1.121 Compiling Cookbooks…  
172.16.1.121  
172.16.1.121 Converging 32 resources  
172.16.1.121  
172.16.1.121 Recipe: apache2::default  
172.16.1.121  
172.16.1.121 \* package[apache2] action install  
172.16.1.121  
172.16.1.121  
172.16.1.121 ================================================================================  
172.16.1.121  
172.16.1.121 Error executing action `install` on resource 'package[apache2]'  
172.16.1.121  
172.16.1.121 ================================================================================  
172.16.1.121  
172.16.1.121  
172.16.1.121  
172.16.1.121  
172.16.1.121 Chef::Exceptions::Exec  
172.16.1.121  
172.16.1.121 ----------------------  
172.16.1.121  
172.16.1.121 apt-get -q -y install apache2=2.2.22-1ubuntu1.4 returned 100, expected 0  
172.16.1.121  
172.16.1.121  
172.16.1.121  
172.16.1.121  
172.16.1.121 Resource Declaration:  
172.16.1.121  
172.16.1.121 ---------------------  
172.16.1.121  
172.16.1.121 # In /var/chef/cache/cookbooks/apache2/recipes/default.rb  
172.16.1.121  
172.16.1.121  
172.16.1.121 23: package “apache2” do  
172.16.1.121  
172.16.1.121 24: package\_name node[‘apache’][‘package’]  
172.16.1.121  
172.16.1.121 25: end  
172.16.1.121  
172.16.1.121 26:  
172.16.1.121  
172.16.1.121  
172.16.1.121  
172.16.1.121  
172.16.1.121  
172.16.1.121  
172.16.1.121 Compiled Resource:  
172.16.1.121  
172.16.1.121 ------------------  
172.16.1.121  
172.16.1.121 # Declared in /var/chef/cache/cookbooks/apache2/recipes/default.rb:23:in `from_file' 172.16.1.121 172.16.1.121 172.16.1.121 package("apache2") do 172.16.1.121 172.16.1.121 action :install 172.16.1.121 172.16.1.121 retries 0 172.16.1.121 172.16.1.121 retry_delay 2 172.16.1.121 172.16.1.121 package_name "apache2" 172.16.1.121 172.16.1.121 version "2.2.22-1ubuntu1.4" 172.16.1.121 172.16.1.121 cookbook_name "apache2" 172.16.1.121 172.16.1.121 recipe_name "default" 172.16.1.121 172.16.1.121 end 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 Chef Client failed. 0 resources updated 172.16.1.121 admini@system05:~/chef-repo$ knife cookbook upload apache2 /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/systemu-2.5.2/lib/systemu.rb:31: warning: Insecure world writable dir /home/admini in PATH, mode 040777 Uploading apache2 [1.2.0] Uploaded 1 cookbook. admini@system05:~/chef-repo$ knife ssh name:ubuntu 'chef-client -o recipe[apache2]' -x root -P 'p@ssw0rd' -a ipaddress /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/systemu-2.5.2/lib/systemu.rb:31: warning: Insecure world writable dir /home/admini in PATH, mode 040777 172.16.1.121 Starting Chef Client, version 11.4.4 172.16.1.121 172.16.1.121 resolving cookbooks for run list: ["apache2"] 172.16.1.121 172.16.1.121 Synchronizing Cookbooks: 172.16.1.121 172.16.1.121 - apache2 172.16.1.121 172.16.1.121 Compiling Cookbooks... 172.16.1.121 172.16.1.121 Converging 32 resources 172.16.1.121 172.16.1.121 Recipe: apache2::default 172.16.1.121 172.16.1.121 * package[apache2] action install 172.16.1.121 172.16.1.121 172.16.1.121 ================================================================================ 172.16.1.121 172.16.1.121 Error executing action`install`on resource 'package[apache2]' 172.16.1.121 172.16.1.121 ================================================================================ 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 Chef::Exceptions::Exec 172.16.1.121 172.16.1.121 ---------------------- 172.16.1.121 172.16.1.121 apt-get -q -y install apache2=2.2.22-1ubuntu1.4 returned 100, expected 0 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 Resource Declaration: 172.16.1.121 172.16.1.121 --------------------- 172.16.1.121 172.16.1.121 # In /var/chef/cache/cookbooks/apache2/recipes/default.rb 172.16.1.121 172.16.1.121 172.16.1.121 23: package node['apache']['package'] do 172.16.1.121 172.16.1.121 24: action :install 172.16.1.121 172.16.1.121 25: end 172.16.1.121 172.16.1.121 26: 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 Compiled Resource: 172.16.1.121 172.16.1.121 ------------------ 172.16.1.121 172.16.1.121 # Declared in /var/chef/cache/cookbooks/apache2/recipes/default.rb:23:in`from\_file’  
172.16.1.121  
172.16.1.121  
172.16.1.121 package(“apache2”) do  
172.16.1.121  
172.16.1.121 action [:install]  
172.16.1.121  
172.16.1.121 retries 0  
172.16.1.121  
172.16.1.121 retry\_delay 2  
172.16.1.121  
172.16.1.121 package\_name "apache2"  
172.16.1.121  
172.16.1.121 version "2.2.22-1ubuntu1.4"  
172.16.1.121  
172.16.1.121 cookbook\_name "apache2"  
172.16.1.121  
172.16.1.121 recipe\_name "default"  
172.16.1.121  
172.16.1.121 end  
172.16.1.121  
172.16.1.121  
172.16.1.121  
172.16.1.121  
172.16.1.121  
172.16.1.121  
172.16.1.121 Chef Client failed. 0 resources updated

Thanks,  
Indra

---

<div class="post-metadata">

**Author:** ![coderanger](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/coderanger/32/5_2.png) [@coderanger](https://discourse.chef.io/u/coderanger)\
**Post date:** [July 3, 2014, 7:11am UTC](https://discourse.chef.io/t/apache2-problem/5534/2 "2014-07-03T07:11:54Z")

</div>

As noted in the output, apt-get failed. This is usually due to outdated apt cache files, use the apt cookbook to run apt-get update as part of the chef converge.

--Noah

On Jul 2, 2014, at 11:58 PM, Indra k [indra.k@cloudenablers.com](mailto:indra.k@cloudenablers.com) wrote:

> Hi,
> 
> ```
> When i running apache2 package it shows error:
> 
> chef-client -o recipe['apache2']
> 
> Starting Chef Client, version 11.4.4
> 
> ```
> 
> 172.16.1.121  
> 172.16.1.121 resolving cookbooks for run list: ["apache2"]  
> 172.16.1.121  
> 172.16.1.121 Synchronizing Cookbooks:  
> 172.16.1.121  
> 172.16.1.121 - apache2  
> 172.16.1.121  
> 172.16.1.121 Compiling Cookbooks...  
> 172.16.1.121  
> 172.16.1.121 Converging 32 resources  
> 172.16.1.121  
> 172.16.1.121 Recipe: apache2::default  
> 172.16.1.121  
> 172.16.1.121 \* package[apache2] action install  
> 172.16.1.121  
> 172.16.1.121  
> 172.16.1.121 ================================================================================  
> 172.16.1.121  
> 172.16.1.121 Error executing action `install` on resource 'package[apache2]'  
> 172.16.1.121  
> 172.16.1.121 ================================================================================  
> 172.16.1.121  
> 172.16.1.121  
> 172.16.1.121  
> 172.16.1.121  
> 172.16.1.121 Chef::Exceptions::Exec  
> 172.16.1.121  
> 172.16.1.121 ----------------------  
> 172.16.1.121  
> 172.16.1.121 apt-get -q -y install apache2=2.2.22-1ubuntu1.4 returned 100, expected 0  
> 172.16.1.121  
> 172.16.1.121  
> 172.16.1.121  
> 172.16.1.121  
> 172.16.1.121 Resource Declaration:  
> 172.16.1.121  
> 172.16.1.121 ---------------------  
> 172.16.1.121  
> 172.16.1.121 # In /var/chef/cache/cookbooks/apache2/recipes/default.rb  
> 172.16.1.121  
> 172.16.1.121  
> 172.16.1.121 23: package "apache2" do  
> 172.16.1.121  
> 172.16.1.121 24: package\_name node['apache']['package']  
> 172.16.1.121  
> 172.16.1.121 25: end  
> 172.16.1.121  
> 172.16.1.121 26:  
> 172.16.1.121  
> 172.16.1.121  
> 172.16.1.121  
> 172.16.1.121  
> 172.16.1.121  
> 172.16.1.121  
> 172.16.1.121 Compiled Resource:  
> 172.16.1.121  
> 172.16.1.121 ------------------  
> 172.16.1.121  
> 172.16.1.121 # Declared in /var/chef/cache/cookbooks/apache2/recipes/default.rb:23:in `from_file' 172.16.1.121 172.16.1.121 172.16.1.121 package("apache2") do 172.16.1.121 172.16.1.121 action :install 172.16.1.121 172.16.1.121 retries 0 172.16.1.121 172.16.1.121 retry_delay 2 172.16.1.121 172.16.1.121 package_name "apache2" 172.16.1.121 172.16.1.121 version "2.2.22-1ubuntu1.4" 172.16.1.121 172.16.1.121 cookbook_name "apache2" 172.16.1.121 172.16.1.121 recipe_name "default" 172.16.1.121 172.16.1.121 end 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 Chef Client failed. 0 resources updated 172.16.1.121 admini@system05:~/chef-repo$ knife cookbook upload apache2 /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/systemu-2.5.2/lib/systemu.rb:31: warning: Insecure world writable dir /home/admini in PATH, mode 040777 Uploading apache2 [1.2.0] Uploaded 1 cookbook. admini@system05:~/chef-repo$ knife ssh name:ubuntu 'chef-client -o recipe[apache2]' -x root -P 'p@ssw0rd' -a ipaddress /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/systemu-2.5.2/lib/systemu.rb:31: warning: Insecure world writable dir /home/admini in PATH, mode 040777 172.16.1.121 Starting Chef Client, version 11.4.4 172.16.1.121 172.16.1.121 resolving cookbooks for run list: ["apache2"] 172.16.1.121 172.16.1.121 Synchronizing Cookbooks: 172.16.1.121 172.16.1.121 - apache2 172.16.1.121 172.16.1.121 Compiling Cookbooks... 172.16.1.121 172.16.1.121 Converging 32 resources 172.16.1.121 172.16.1.121 Recipe: apache2::default 172.16.1.121 172.16.1.121 * package[apache2] action install 172.16.1.121 172.16.1.121 172.16.1.121 ================================================================================ 172.16.1.121 172.16.1.121 Error executing action `install`on resource 'package[apache2]' 172.16.1.121 172.16.1.121 ================================================================================ 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 Chef::Exceptions::Exec 172.16.1.121 172.16.1.121 ---------------------- 172.16.1.121 172.16.1.121 apt-get -q -y install apache2=2.2.22-1ubuntu1.4 returned 100, expected 0 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 Resource Declaration: 172.16.1.121 172.16.1.121 --------------------- 172.16.1.121 172.16.1.121 # In /var/chef/cache/cookbooks/apache2/recipes/default.rb 172.16.1.121 172.16.1.121 172.16.1.121 23: package node['apache']['package'] do 172.16.1.121 172.16.1.121 24: action :install 172.16.1.121 172.16.1.121 25: end 172.16.1.121 172.16.1.121 26: 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 172.16.1.121 Compiled Resource: 172.16.1.121 172.16.1.121 ------------------ 172.16.1.121 172.16.1.121 # Declared in /var/chef/cache/cookbooks/apache2/recipes/default.rb:23:in`from\_file'  
> 172.16.1.121  
> 172.16.1.121  
> 172.16.1.121 package("apache2") do  
> 172.16.1.121  
> 172.16.1.121 action [:install]  
> 172.16.1.121  
> 172.16.1.121 retries 0  
> 172.16.1.121  
> 172.16.1.121 retry\_delay 2  
> 172.16.1.121  
> 172.16.1.121 package\_name "apache2"  
> 172.16.1.121  
> 172.16.1.121 version "2.2.22-1ubuntu1.4"  
> 172.16.1.121  
> 172.16.1.121 cookbook\_name "apache2"  
> 172.16.1.121  
> 172.16.1.121 recipe\_name "default"  
> 172.16.1.121  
> 172.16.1.121 end  
> 172.16.1.121  
> 172.16.1.121  
> 172.16.1.121  
> 172.16.1.121  
> 172.16.1.121  
> 172.16.1.121  
> 172.16.1.121 Chef Client failed. 0 resources updated
> 
> Thanks,  
> Indra
