Apache2 Cookbook Fails


#1

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:inexec’
/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:infork’
/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:inrun_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:inshell_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:inaction_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:inrun_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:inconverge’
/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:inconverge’
/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:incall’
/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:instep’
/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:ineach_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:inconverge’
/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:inrun’
/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:inloop’
/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:inrun’
/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?


#2

On Wed, Jan 11, 2012 at 5:29 PM, 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


#3

[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 wrote:

On Wed, Jan 11, 2012 at 5:29 PM, 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


#4

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 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:inrun_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:ineach’
/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:inconverge’
/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:inrun’

/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:inload’
/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