[chef] chef-run failure for a custom recipe


Chronological Thread 
  • From: niristotle okram < >
  • To:
  • Subject: [chef] chef-run failure for a custom recipe
  • Date: Tue, 5 May 2015 22:08:44 -0700


i have this recipe for jenkins and i am trying to use it on an aws node for some test. i am using using chef-solo & knife-sole.  

The point of failure is in this part of the recipe (the highlighted) 

template "#{node[:jenkins][:master][:home]}/config.xml" do
  source 'config.xml.erb'
  variables(
    master_executors: node[:jenkins][:master_config][:master_executors],
    ldap: localLdap,
    clouds: node[:jenkins][:master][:clouds] || nil,
    views: node[:jenkins][:master][:views] || nil
  )
  notifies :restart, 'service[jenkins]', :immediately
end

ruby_block 'set private key' do
  block { node.run_state[:jenkins_private_key] = data_bag["jenkins_private_key"] }
end


As per the debug log, its pointing to a time-out somewhere. Is this something, that i need to tweak on the AWS node? I have the SSH, HTTP, HTTPS already listening on all inbounds and the 127.0.0.1 is listening on 8080. 


netstat -ntlp
(No info could be read for "-p": geteuid()=500 but you should be root.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name   
tcp        0      0 0.0.0.0:51810               0.0.0.0:*                   LISTEN      -                   
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      -                   
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      -                   
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      -                   
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      -                   
tcp        0      0 :::55235                    :::*                        LISTEN      -                   
tcp        0      0 :::54666                    :::*                        LISTEN      -                   
tcp        0      0 :::111                      :::*                        LISTEN      -                   
tcp        0      0 ::ffff:127.0.0.1:8080       :::*                        LISTEN      -                   
tcp        0      0 :::38485                    :::*                        LISTEN      -                   
tcp        0      0 :::22                       :::*                        LISTEN      -     



Below is a piece the debug log, & the extended log is here:  http://pastebin.com/fqNp9zkp  

[2015-05-05T21:17:11-07:00] DEBUG: found target_uid == nil, so no owner was specified on resource, not managing owner
[2015-05-05T21:17:11-07:00] DEBUG: found target_gid == nil, so no group was specified on resource, not managing group
 (up to date)
DEBUG: sudo -E -p 'knife sudo password: ' chef-solo -c ~/chef-solo/solo.rb -j ~/chef-solo/dna.json -l debug stdout:     
    DEBUG: sudo -E -p 'knife sudo password: ' chef-solo -c ~/chef-solo/solo.rb -j ~/chef-solo/dna.json -l debug stdout: 
    ================================================================================
    Error executing action `create` on resource 'jenkins_private_key_credentials[user_build]'
    ================================================================================
    
    Mixlib::ShellOut::CommandTimeout
    --------------------------------
    Command timed out after 60s:
    Command exceeded allowed execution time, process terminated
    ---- Begin output of "/usr/lib/jvm/java/bin/java" -jar "/var/chef/cache/jenkins-cli.jar" -s http://localhost:8080 -i "/var/chef/cache/jenkins-key" groovy /tmp/groovy20150505-27740-1o9e28c ----
    STDOUT: 
    STDERR: 
    ---- End output of "/usr/lib/jvm/java/bin/java" -jar "/var/chef/cache/jenkins-cli.jar" -s http://localhost:8080 -i "/var/chef/cache/jenkins-key" groovy /tmp/groovy20150505-27740-1o9e28c ----
    Ran "/usr/lib/jvm/java/bin/java" -jar "/var/chef/cache/jenkins-cli.jar" -s http://localhost:8080 -i "/var/chef/cache/jenkins-key" groovy /tmp/groovy20150505-27740-1o9e28c returned 143
    
    Cookbook Trace:
    ---------------
    /home/ec2-user/chef-solo/cookbooks-2/jenkins/libraries/_executor.rb:81:in `execute!'
    /home/ec2-user/chef-solo/cookbooks-2/jenkins/libraries/_executor.rb:127:in `groovy!'
    /home/ec2-user/chef-solo/cookbooks-2/jenkins/libraries/credentials.rb:205:in `current_credentials'
    /home/ec2-user/chef-solo/cookbooks-2/jenkins/libraries/credentials_private_key.rb:117:in `current_credentials'
    /home/ec2-user/chef-solo/cookbooks-2/jenkins/libraries/credentials.rb:79:in `load_current_resource'
    /home/ec2-user/chef-solo/cookbooks-2/jenkins/libraries/credentials_private_key.rb:69:in `load_current_resource'
    
    Resource Declaration:
    ---------------------
    # In /home/ec2-user/chef-solo/cookbooks-2/mytest_jenkins/recipes/jenkins_master.rb
    
     96:     jenkins_private_key_credentials credential["name"] do
     97:       description credential["description"]
     98:       private_key data_bag["#{credential["databag_key_name"]}"]
     99:       if credential["id"]
    100:         id credential["id"]
    101:       end
    

    ================================================================================
    Error executing action `create` on resource 'jenkins_private_key_credentials[user_build]'
    ================================================================================
    
    Mixlib::ShellOut::CommandTimeout
    --------------------------------
    Command timed out after 60s:
    Command exceeded allowed execution time, process terminated
    ---- Begin output of "/usr/lib/jvm/java/bin/java" -jar "/var/chef/cache/jenkins-cli.jar" -s http://localhost:8080 -i "/var/chef/cache/jenkins-key" groovy /tmp/groovy20150505-27740-1o9e28c ----
    STDOUT: 
    STDERR: 
    ---- End output of "/usr/lib/jvm/java/bin/java" -jar "/var/chef/cache/jenkins-cli.jar" -s http://localhost:8080 -i "/var/chef/cache/jenkins-key" groovy /tmp/groovy20150505-27740-1o9e28c ----
    Ran "/usr/lib/jvm/java/bin/java" -jar "/var/chef/cache/jenkins-cli.jar" -s http://localhost:8080 -i "/var/chef/cache/jenkins-key" groovy /tmp/groovy20150505-27740-1o9e28c returned 143
    
    Cookbook Trace:
    ---------------
    /home/ec2-user/chef-solo/cookbooks-2/jenkins/libraries/_executor.rb:81:in `execute!'
    /home/ec2-user/chef-solo/cookbooks-2/jenkins/libraries/_executor.rb:127:in `groovy!'
    /home/ec2-user/chef-solo/cookbooks-2/jenkins/libraries/credentials.rb:205:in `current_credentials'
    /home/ec2-user/chef-solo/cookbooks-2/jenkins/libraries/credentials_private_key.rb:117:in `current_credentials'
    /home/ec2-user/chef-solo/cookbooks-2/jenkins/libraries/credentials.rb:79:in `load_current_resource'
    /home/ec2-user/chef-solo/cookbooks-2/jenkins/libraries/credentials_private_key.rb:69:in `load_current_resource'















--
Regards
nirish okram



Archive powered by MHonArc 2.6.16.

§