Episode 4: Running into an error when running "sudo chef-client" to load to the node from the Chef Server

119 views
Skip to first unread message

Jon Tudor

unread,
Apr 3, 2015, 6:02:57 PM4/3/15
to learnchef-funda...@googlegroups.com
Hello,

I am receiving an error that I can't seem to troubleshoot when running "sudo chef-client" to load the recipe to the node from the chef server at the end of episode 4. I'm running this command from the node via SSH through Putty. I have gone through all code shown in this episodes video and have not been able to find any differences in my code.

Any assistance to help troubleshoot this issue would be greatly appreciated. See error output from Putty below. Thanks!

-----------------------

    ================================================================================
    Error executing action `start` on resource 'service[httpd]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    Expected process to exit with [0], but received '1'
    ---- Begin output of /sbin/service httpd start ----
    STDOUT: Starting httpd: [FAILED]
    STDERR: httpd: Syntax error on line 221 of /etc/httpd/conf/httpd.conf: Syntax error on line 2 of /etc/httpd/conf.d/bears.conf: /etc/httpd/conf.d/bears.conf:2: <VirtualHost> was not closed.
    ---- End output of /sbin/service httpd start ----
    Ran /sbin/service httpd start returned 1

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/apache/recipes/default.rb

     13: service "httpd" do
     14:   action [ :enable, :start]
     15: end
     16:

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/apache/recipes/default.rb:13:in `from_file'

    service("httpd") do
      action [:enable, :start]
      supports {:restart=>false, :reload=>false, :status=>true}
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      service_name "httpd"
      enabled true
      pattern "httpd"
      declared_type :service
      cookbook_name "apache"
      recipe_name "default"
    end


Running handlers:
[2015-04-03T17:41:27-04:00] ERROR: Running exception handlers
Running handlers complete
[2015-04-03T17:41:27-04:00] ERROR: Exception handlers complete
[2015-04-03T17:41:27-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 0 resources updated in 6.676840798 seconds
[2015-04-03T17:41:28-04:00] ERROR: service[httpd] (apache::default line 13) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /sbin/service httpd start ----
STDOUT: Starting httpd: [FAILED]
STDERR: httpd: Syntax error on line 221 of /etc/httpd/conf/httpd.conf: Syntax error on line 2 of /etc/httpd/conf.d/bears.conf: /etc/httpd/conf.d/bears.conf:2: <VirtualHost> was not closed.
---- End output of /sbin/service httpd start ----
Ran /sbin/service httpd start returned 1
[2015-04-03T17:41:28-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
[root@CentOS63 ~]# STDERR: httpd: Syntax error on line 221 of /etc/httpd/conf/httpd.conf:
-bash: STDERR:: command not found

------------------------

Jon Tudor

unread,
Apr 6, 2015, 12:42:56 PM4/6/15
to learnchef-funda...@googlegroups.com
To close this loop for anyone who is looking at this topic. I was able to solve this issue by simply creating a new VM and then bootstrapping the node with the updated webserver role.

Jing Xie

unread,
May 22, 2015, 2:04:16 PM5/22/15
to learnchef-funda...@googlegroups.com
Me too. I recived the same error in Linux
Message has been deleted

Jing Xie

unread,
May 22, 2015, 2:16:41 PM5/22/15
to learnchef-funda...@googlegroups.com
I used my own VM as the node and got the same error of running chef-client when I bootstrap the node
Reply all
Reply to author
Forward
0 new messages