# Chef-run failure for a custom recipe

**URL:** <https://discourse.chef.io/t/chef-run-failure-for-a-custom-recipe/6631>\
**Category:** Chef Infra (archive)\
**Created:** [May 6, 2015, 5:08am UTC](https://discourse.chef.io/t/chef-run-failure-for-a-custom-recipe/6631 "2015-05-06T05:08:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![okram999](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/okram999/32/1083_2.png) [@okram999](https://discourse.chef.io/u/okram999)\
**Post date:** [May 6, 2015, 5:08am UTC](https://discourse.chef.io/t/chef-run-failure-for-a-custom-recipe/6631/1 "2015-05-06T05:08:44Z")

</div>

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 [http://127.0.0.1:8080](http://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](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](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](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](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](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](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](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

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [May 7, 2015, 3:30pm UTC](https://discourse.chef.io/t/chef-run-failure-for-a-custom-recipe/6631/2 "2015-05-07T15:30:17Z")

</div>

On Tuesday, May 5, 2015 at 10:08 PM, niristotle okram wrote:

> 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)
> 
> # ================================================================================ 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](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](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](http://localhost:8080) -i "/var/chef/cache/jenkins-key" groovy /tmp/groovy20150505-27740-1o9e28c returned 143

This command is not returning after 60s, and it’s not producing any output to explain why. If you expect that the command _should_ take longer than 60s, then you need to increase the timeout (you might have to edit the cookbook’s provider code for this). If the command is supposed to run in a much shorter time, then there’s probably a network issue where the packets are getting silently dropped (this is common behavior for firewalls, in order to make port scans slower/less reliable, but there’s other ways this behavior can occur also). Of course a network issue seems a lot less likely on localhost.

> --  
> Regards  
> nirish okram

--  
Daniel DeLeo

---

<div class="post-metadata">

**Author:** ![okram999](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/okram999/32/1083_2.png) [@okram999](https://discourse.chef.io/u/okram999)\
**Post date:** [May 7, 2015, 5:10pm UTC](https://discourse.chef.io/t/chef-run-failure-for-a-custom-recipe/6631/3 "2015-05-07T17:10:37Z")

</div>

thanks, let me try with an aws instance type: m3.medium where the n/w  
performance is moderate. If this fails, i will check if i can find where  
the timeout of 60secs is set in the cookbook.

ps: i love chef but Ruby is not by best fren yet 🙂

On Thu, May 7, 2015 at 8:30 AM, Daniel DeLeo [dan@kallistec.com](mailto:dan@kallistec.com) wrote:

> On Tuesday, May 5, 2015 at 10:08 PM, niristotle okram wrote:
> 
> > 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)
> 
> ================================================================================
> 
> > 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](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](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](http://localhost:8080) -i "/var/chef/cache/jenkins-key" groovy  
> > /tmp/groovy20150505-27740-1o9e28c returned 143
> 
> This command is not returning after 60s, and it’s not producing any output  
> to explain why. If you expect that the command _should_ take longer than  
> 60s, then you need to increase the timeout (you might have to edit the  
> cookbook’s provider code for this). If the command is supposed to run in a  
> much shorter time, then there’s probably a network issue where the packets  
> are getting silently dropped (this is common behavior for firewalls, in  
> order to make port scans slower/less reliable, but there’s other ways this  
> behavior can occur also). Of course a network issue seems a lot less likely  
> on localhost.
> 
> > --  
> > Regards  
> > nirish okram
> 
> --  
> Daniel DeLeo

--  
Regards  
nirish okram
