Reputation: 89
I'm trying to use Chef to create a local virtual host and for that I had added the "recipe[apache2]" recipe in my runlist and it worked great until I also added another recipe in the runlist that includes the default apache2 recipe. Now, even if I remove the new recipe from the runlist action 'start' fails with the following error. Anyone knows what's the reason for this?
================================================================================
Error executing action `start` on resource 'service[apache2]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of /etc/init.d/apache2 start ----
STDOUT: * Starting web server apache2
Action 'start' failed.
The Apache error log may have more information.
...fail!
STDERR: Syntax error on line 2 of /etc/apache2/sites-enabled/example.conf:
ServerName takes one argument, The hostname and port of the server
---- End output of /etc/init.d/apache2 start ----
Ran /etc/init.d/apache2 start returned 1
Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/apache2/recipes/default.rb
210: service 'apache2' do
211: action :start
212: end
Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/apache2/recipes/default.rb:210:in `from_file'
service("apache2") do
action [:start]
supports {:restart=>true, :reload=>true, :status=>true}
retries 0
retry_delay 2
service_name "apache2"
pattern "apache2"
restart_command "/usr/sbin/invoke-rc.d apache2 restart && sleep 1"
reload_command "/usr/sbin/invoke-rc.d apache2 reload && sleep 1"
cookbook_name "apache2"
recipe_name "default"
end
[2014-03-04T17:52:20+00:00] INFO: Running queued delayed notifications before re-raising exception
[2014-03-04T17:52:20+00:00] ERROR: Running exception handlers
[2014-03-04T17:52:20+00:00] ERROR: Exception handlers complete
[2014-03-04T17:52:20+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2014-03-04T17:52:20+00:00] INFO: Sending resource update report (run-id: 3d91fc5b-cf02-4788-bb56-f03ebe274702)
[2014-03-04T17:52:21+00:00] ERROR: service[apache2] (apache2::default line 210) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /etc/init.d/apache2 start ----
STDOUT: * Starting web server apache2
Action 'start' failed.
The Apache error log may have more information.
...fail!
STDERR: Syntax error on line 2 of /etc/apache2/sites-enabled/example.conf:
ServerName takes one argument, The hostname and port of the server
---- End output of /etc/init.d/apache2 start ----
Ran /etc/init.d/apache2 start returned 1
[2014-03-04T17:52:21+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Upvotes: 0
Views: 2552
Reputation: 37580
Have a look at /etc/apache2/sites-enabled/example.conf
: The output says
ServerName takes one argument, The hostname and port of the server
Obviously, you're not passing the sever_name
attribute - have a look at the README and at the used template:
web_app "my_site" do
server_name node['hostname']
server_aliases [node['fqdn'], "my-site.example.com"]
docroot "/srv/www/my_site"
end
If this doesn't help, please edit your post and add the code of how you define the example site.
Upvotes: 1