# Apache2 Cookbook Fails

**URL:** <https://discourse.chef.io/t/apache2-cookbook-fails/2334>\
**Category:** Chef Infra (archive)\
**Created:** [January 11, 2012, 10:29pm UTC](https://discourse.chef.io/t/apache2-cookbook-fails/2334 "2012-01-11T22:29:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bbaugher](https://avatars.discourse-cdn.com/v4/letter/b/97f17d/32.png) [@bbaugher](https://discourse.chef.io/u/bbaugher)\
**Post date:** [January 11, 2012, 10:29pm UTC](https://discourse.chef.io/t/apache2-cookbook-fails/2334/1 "2012-01-11T22:29:54Z")

</div>

Hi, I have been using the apache2 cookbook for a couple months now and have now  
noticed on a fresh install that it fails. I have tried this using apache 1.0.8  
and 1.0.2 (the last time I know was successful).

I am running RHEL 5.3

Here is my stacktrace,

[Wed, 11 Jan 2012 16:17:02 -0600] ERROR: execute[generate-module-list]  
(apache2::default line 86) has had an error  
[Wed, 11 Jan 2012 16:17:02 -0600] ERROR: execute[generate-module-list]  
(/var/cache/chef/cookbooks/apache2/recipes/default.rb:86:in `from_file') had an error: execute[generate-module-list] (apache2::default line 86) had an error: No such file or directory - /usr/local/bin/apache2_module_conf_generate.pl /usr/lib64/httpd/modules /etc/httpd/mods-available /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/shell_out/unix.rb:195:in`exec’  
/usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/…/lib/chef/shell\_out/unix.rb:195:in  
`fork_subprocess' /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/shell_out/unix.rb:185:in`fork’  
/usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/…/lib/chef/shell\_out/unix.rb:185:in  
`fork_subprocess' /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/shell_out/unix.rb:17:in`run\_command’  
/usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/…/lib/chef/shell\_out.rb:181:in  
`run_command' /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/mixin/shell_out.rb:30:in`shell\_out’  
/usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/…/lib/chef/mixin/shell\_out.rb:35:in  
`shell_out!' /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/provider/execute.rb:58:in`action\_run’  
/usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/…/lib/chef/resource.rb:437:in  
`send' /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource.rb:437:in`run\_action’  
/usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/…/lib/chef/runner.rb:45:in  
`run_action' /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:81:in`converge’  
/usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/…/lib/chef/runner.rb:81:in  
`each' /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:81:in`converge’  
/usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/…/lib/chef/resource\_collection.rb:94:in  
`execute_each_resource' /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in`call’  
/usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/…/lib/chef/resource\_collection/stepable\_iterator.rb:116:in  
`call_iterator_block' /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in`step’  
/usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/…/lib/chef/resource\_collection/stepable\_iterator.rb:104:in  
`iterate' /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in`each\_with\_index’  
/usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/…/lib/chef/resource\_collection.rb:92:in  
`execute_each_resource' /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:76:in`converge’  
/usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/…/lib/chef/client.rb:312:in  
`converge' /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/client.rb:160:in`run’  
/usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/…/lib/chef/application/client.rb:239:in  
`run_application' /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application/client.rb:229:in`loop’  
/usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/…/lib/chef/application/client.rb:229:in  
`run_application' /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application.rb:67:in`run’  
/usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/chef-client:26  
/usr/bin/chef-client:19:in `load’  
/usr/bin/chef-client:19  
[Wed, 11 Jan 2012 16:17:02 -0600] ERROR: Running exception handlers  
[Wed, 11 Jan 2012 16:17:02 -0600] FATAL: Saving node information to  
/var/cache/chef/failed-run-data.json  
[Wed, 11 Jan 2012 16:17:02 -0600] ERROR: Exception handlers complete  
[Wed, 11 Jan 2012 16:17:02 -0600] FATAL: Stacktrace dumped to  
/var/cache/chef/chef-stacktrace.out  
[Wed, 11 Jan 2012 16:17:02 -0600] FATAL: Errno::ENOENT:  
execute[generate-module-list] (apache2::default line 86) had an error: No such  
file or directory - /usr/local/bin/apache2\_module\_conf\_generate.pl  
/usr/lib64/httpd/modules /etc/httpd/mods-available

So this is where it gets fun, running

/usr/local/bin/apache2\_module\_conf\_generate.pl /usr/lib64/httpd/modules  
/etc/httpd/mods-available : produces the error above

perl /usr/local/bin/apache2\_module\_conf\_generate.pl /usr/lib64/httpd/modules  
/etc/httpd/mods-available : works fine and generates the .load files

/usr/bin/perl /usr/local/bin/apache2\_module\_conf\_generate.pl  
/usr/lib64/httpd/modules /etc/httpd/mods-available : Also works fine and  
generates the .load files, which is used at the top of the perl script  
#!/usr/bin/perl

Any thoughts?

---

<div class="post-metadata">

**Author:** ![Bryan\_McLellan](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/bryan_mclellan/32/81_2.png) [@Bryan\_McLellan](https://discourse.chef.io/u/Bryan_McLellan)\
**Post date:** [January 11, 2012, 10:41pm UTC](https://discourse.chef.io/t/apache2-cookbook-fails/2334/2 "2012-01-11T22:41:53Z")

</div>

On Wed, Jan 11, 2012 at 5:29 PM, [bjbq4d@gmail.com](mailto:bjbq4d@gmail.com) wrote:

> /usr/local/bin/apache2\_module\_conf\_generate.pl /usr/lib64/httpd/modules  
> /etc/httpd/mods-available : produces the error above
> 
> perl /usr/local/bin/apache2\_module\_conf\_generate.pl /usr/lib64/httpd/modules  
> /etc/httpd/mods-available : works fine and generates the .load files

The hashbang at the top of apache2\_module\_conf\_generate.pl is  
"#!/usr/bin/perl" in my copy of it. What is it in your copy?

What does /usr/bin/perl look like? Is it the actual perl binary or  
symlink somewhere else or perhaps some kind of a wrapper?

Bryan

---

<div class="post-metadata">

**Author:** ![bbaugher](https://avatars.discourse-cdn.com/v4/letter/b/97f17d/32.png) [@bbaugher](https://discourse.chef.io/u/bbaugher)\
**Post date:** [January 11, 2012, 10:46pm UTC](https://discourse.chef.io/t/apache2-cookbook-fails/2334/3 "2012-01-11T22:46:26Z")

</div>

[root@new2 mods-available]# which perl  
/usr/bin/perl  
[root@new2 mods-available]# ls /usr/bin/perl -lah  
-rwxr-xr-x 2 root root 19K Sep 24 2008 /usr/bin/perl

On Wed, Jan 11, 2012 at 4:41 PM, Bryan McLellan [btm@loftninjas.org](mailto:btm@loftninjas.org) wrote:

> On Wed, Jan 11, 2012 at 5:29 PM, [bjbq4d@gmail.com](mailto:bjbq4d@gmail.com) wrote:
> 
> > /usr/local/bin/apache2\_module\_conf\_generate.pl /usr/lib64/httpd/modules  
> > /etc/httpd/mods-available : produces the error above
> > 
> > perl /usr/local/bin/apache2\_module\_conf\_generate.pl/usr/lib64/httpd/modules  
> > /etc/httpd/mods-available : works fine and generates the .load files
> 
> The hashbang at the top of apache2\_module\_conf\_generate.pl is  
> "#!/usr/bin/perl" in my copy of it. What is it in your copy?
> 
> What does /usr/bin/perl look like? Is it the actual perl binary or  
> symlink somewhere else or perhaps some kind of a wrapper?
> 
> Bryan

--  
-Bryan

---

<div class="post-metadata">

**Author:** ![bbaugher](https://avatars.discourse-cdn.com/v4/letter/b/97f17d/32.png) [@bbaugher](https://discourse.chef.io/u/bbaugher)\
**Post date:** [January 12, 2012, 5:16pm UTC](https://discourse.chef.io/t/apache2-cookbook-fails/2334/4 "2012-01-12T17:16:08Z")

</div>

Turns out it was a problem with upload the apache2 cookbook from my windows  
machine causing it to think the interpreter was '/usr/bin/perl^M'. Running  
dos2unix on the files and re-uploading fixed the problem.

On Wed, Jan 11, 2012 at 4:29 PM, [bjbq4d@gmail.com](mailto:bjbq4d@gmail.com) wrote:

> Hi, I have been using the apache2 cookbook for a couple months now and  
> have now  
> noticed on a fresh install that it fails. I have tried this using apache  
> 1.0.8  
> and 1.0.2 (the last time I know was successful).
> 
> I am running RHEL 5.3
> 
> Here is my stacktrace,
> 
> [Wed, 11 Jan 2012 16:17:02 -0600] ERROR: execute[generate-module-list]  
> (apache2::default line 86) has had an error  
> [Wed, 11 Jan 2012 16:17:02 -0600] ERROR: execute[generate-module-list]  
> (/var/cache/chef/cookbooks/apache2/recipes/default.rb:86:in `from\_file')  
> had an  
> error:  
> execute[generate-module-list] (apache2::default line 86) had an error: No  
> such  
> file or directory - /usr/local/bin/apache2\_module\_conf\_generate.pl  
> /usr/lib64/httpd/modules /etc/httpd/mods-available
> 
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/shell\_out/unix.rb:195:in  
> `exec'
> 
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/shell\_out/unix.rb:195:in  
> `fork\_subprocess'
> 
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/shell\_out/unix.rb:185:in  
> `fork'
> 
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/shell\_out/unix.rb:185:in  
> `fork\_subprocess'
> 
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/shell\_out/unix.rb:17:in  
> `run\_command'
> 
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/shell\_out.rb:181:in  
> `run\_command'
> 
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/mixin/shell\_out.rb:30:in  
> `shell\_out'
> 
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/mixin/shell\_out.rb:35:in  
> `shell\_out!'
> 
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/provider/execute.rb:58:in  
> `action\_run'
> 
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource.rb:437:in  
> `send'
> 
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource.rb:437:in  
> `run_action' /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:45:in `run\_action'  
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:81:in  
> `converge' /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:81:in `each'  
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:81:in  
> `converge'
> 
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource\_collection.rb:94:in  
> `execute\_each\_resource'
> 
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource\_collection/stepable\_iterator.rb:116:in  
> `call'
> 
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource\_collection/stepable\_iterator.rb:116:in  
> `call\_iterator\_block'
> 
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource\_collection/stepable\_iterator.rb:85:in  
> `step'
> 
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource\_collection/stepable\_iterator.rb:104:in  
> `iterate'
> 
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource\_collection/stepable\_iterator.rb:55:in  
> `each\_with\_index'
> 
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource\_collection.rb:92:in  
> `execute_each_resource' /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:76:in `converge'  
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/client.rb:312:in  
> `converge' /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/client.rb:160:in `run'
> 
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application/client.rb:239:in  
> `run\_application'
> 
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application/client.rb:229:in  
> `loop'
> 
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application/client.rb:229:in  
> `run\_application'
> 
> /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application.rb:67:in  
> `run' /usr/lib64/ruby/gems/1.8/gems/chef-0.10.4/bin/chef-client:26 /usr/bin/chef-client:19:in `load'  
> /usr/bin/chef-client:19  
> [Wed, 11 Jan 2012 16:17:02 -0600] ERROR: Running exception handlers  
> [Wed, 11 Jan 2012 16:17:02 -0600] FATAL: Saving node information to  
> /var/cache/chef/failed-run-data.json  
> [Wed, 11 Jan 2012 16:17:02 -0600] ERROR: Exception handlers complete  
> [Wed, 11 Jan 2012 16:17:02 -0600] FATAL: Stacktrace dumped to  
> /var/cache/chef/chef-stacktrace.out  
> [Wed, 11 Jan 2012 16:17:02 -0600] FATAL: Errno::ENOENT:  
> execute[generate-module-list] (apache2::default line 86) had an error: No  
> such  
> file or directory - /usr/local/bin/apache2\_module\_conf\_generate.pl  
> /usr/lib64/httpd/modules /etc/httpd/mods-available
> 
> So this is where it gets fun, running
> 
> /usr/local/bin/apache2\_module\_conf\_generate.pl /usr/lib64/httpd/modules  
> /etc/httpd/mods-available : produces the error above
> 
> perl /usr/local/bin/apache2\_module\_conf\_generate.pl/usr/lib64/httpd/modules  
> /etc/httpd/mods-available : works fine and generates the .load files
> 
> /usr/bin/perl /usr/local/bin/apache2\_module\_conf\_generate.pl  
> /usr/lib64/httpd/modules /etc/httpd/mods-available : Also works fine and  
> generates the .load files, which is used at the top of the perl script  
> #!/usr/bin/perl
> 
> Any thoughts?

--  
-Bryan
