# Error executing action \`run\` - jenkins\_cli

**URL:** <https://discourse.chef.io/t/error-executing-action-run-jenkins-cli/4410>\
**Category:** Chef Infra (archive)\
**Created:** [September 6, 2013, 5:15pm UTC](https://discourse.chef.io/t/error-executing-action-run-jenkins-cli/4410 "2013-09-06T17:15:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Hayes](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Michael\_Hayes](https://discourse.chef.io/u/Michael_Hayes)\
**Post date:** [September 6, 2013, 5:15pm UTC](https://discourse.chef.io/t/error-executing-action-run-jenkins-cli/4410/1 "2013-09-06T17:15:27Z")

</div>

Not sure why I can’t call this jenkins\_cli command (it’s literally from the sample code on github. Could it be authentication related?

In my cookbook: recipes/jenkins.rb

include\_recipe “jenkins”

%w{ git github }.each do |plugin|  
jenkins\_cli "install-plugin #{plugin}"  
jenkins\_cli "safe-restart"  
end

Chef Solo output:

```
* jenkins_execute[java -jar /home/jenkins/jenkins-cli.jar -s http://syncopated-soaring:8080 install-plugin git] action run

```

# ================================================================================ Error executing action `run` on resource ‘jenkins\_execute[java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git]’

## Chef::Exceptions::Exec

java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git returned 1, expected 0

## Cookbook Trace:

/root/chef-solo/cookbooks-1/jenkins/providers/execute.rb:46:in `action\_run’

## Resource Declaration:

# In /root/chef-solo/cookbooks-1/jenkins/providers/cli.rb

```
49: jenkins_execute command do
50: cwd home
51: block { |stdout| new_resource.block.call(stdout) } if new_resource.block
52: end
53: end

```

## Compiled Resource:

# Declared in /root/chef-solo/cookbooks-1/jenkins/providers/cli.rb:49:in `action\_run’

jenkins\_execute(“java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git”) do  
action :run  
retries 0  
retry\_delay 2  
command "java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git"  
cookbook\_name :rackbox  
cwd "/home/jenkins"  
end

[2013-09-06T16:12:03+00:00] ERROR: Running exception handlers  
[2013-09-06T16:12:03+00:00] ERROR: Exception handlers complete  
[2013-09-06T16:12:03+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out  
Chef Client failed. 5 resources updated  
[2013-09-06T16:12:03+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

---

<div class="post-metadata">

**Author:** ![Michael\_Hayes](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Michael\_Hayes](https://discourse.chef.io/u/Michael_Hayes)\
**Post date:** [September 6, 2013, 6:49pm UTC](https://discourse.chef.io/t/error-executing-action-run-jenkins-cli/4410/2 "2013-09-06T18:49:39Z")

</div>

I thought maybe it's an issue with the `'hostname` which doesn't resolve, but I tried changing it to the ip address and it still doesn't work.

On Sep 6, 2013, at 12:15 PM, Michael Hayes [hayesmp@thefrontside.net](mailto:hayesmp@thefrontside.net) wrote:

> Not sure why I can't call this jenkins\_cli command (it's literally from the sample code on github. Could it be authentication related?
> 
> In my cookbook: recipes/jenkins.rb
> 
> include\_recipe "jenkins"
> 
> %w{ git github }.each do |plugin|  
> jenkins\_cli "install-plugin #{plugin}"  
> jenkins\_cli "safe-restart"  
> end
> 
> Chef Solo output:
> 
> - jenkins\_execute[java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git] action run  
> ================================================================================  
> Error executing action `run` on resource 'jenkins\_execute[java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git]'  
> ================================================================================
> 
> ## Chef::Exceptions::Exec
> 
> java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git returned 1, expected 0
> 
> ## Cookbook Trace:
> 
> /root/chef-solo/cookbooks-1/jenkins/providers/execute.rb:46:in `action\_run'
> 
> ## Resource Declaration:
> 
> # In /root/chef-solo/cookbooks-1/jenkins/providers/cli.rb
> 
> 49: jenkins\_execute command do  
> 50: cwd home  
> 51: block { |stdout| new\_resource.block.call(stdout) } if new\_resource.block  
> 52: end  
> 53: end
> 
> ## Compiled Resource:
> 
> # Declared in /root/chef-solo/cookbooks-1/jenkins/providers/cli.rb:49:in `action\_run'
> 
> jenkins\_execute("java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git") do  
> action :run  
> retries 0  
> retry\_delay 2  
> command "java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git"  
> cookbook\_name :rackbox  
> cwd "/home/jenkins"  
> end
> 
> [2013-09-06T16:12:03+00:00] ERROR: Running exception handlers  
> [2013-09-06T16:12:03+00:00] ERROR: Exception handlers complete  
> [2013-09-06T16:12:03+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out  
> Chef Client failed. 5 resources updated  
> [2013-09-06T16:12:03+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

---

<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:** [September 6, 2013, 6:56pm UTC](https://discourse.chef.io/t/error-executing-action-run-jenkins-cli/4410/3 "2013-09-06T18:56:15Z")

</div>

Try running chef with `-l debug` for more verbose output about the error. There are some changes to the jenkins cookbook that will make errors like this more informative, there should be a new release pretty soon.

--  
Daniel DeLeo

On Friday, September 6, 2013 at 11:49 AM, Michael Hayes wrote:

> I thought maybe it's an issue with the `'hostname` which doesn't resolve, but I tried changing it to the ip address and it still doesn't work.
> 
> On Sep 6, 2013, at 12:15 PM, Michael Hayes \<[hayesmp@thefrontside.net](mailto:hayesmp@thefrontside.net) ([mailto:hayesmp@thefrontside.net](mailto:hayesmp@thefrontside.net))\> wrote:
> 
> > Not sure why I can't call this jenkins\_cli command (it's literally from the sample code on github. Could it be authentication related?
> > 
> > In my cookbook: recipes/jenkins.rb
> > 
> > include\_recipe "jenkins"
> > 
> > %w{ git github }.each do |plugin|  
> > jenkins\_cli "install-plugin #{plugin}"  
> > jenkins\_cli "safe-restart"  
> > end
> > 
> > Chef Solo output:
> > 
> > - jenkins\_execute[java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git] action run  
> > ================================================================================  
> > Error executing action `run` on resource 'jenkins\_execute[java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git]'  
> > ================================================================================
> > 
> > ## Chef::Exceptions::Exec
> > 
> > java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git returned 1, expected 0
> > 
> > ## Cookbook Trace:
> > 
> > /root/chef-solo/cookbooks-1/jenkins/providers/execute.rb:46:in `action\_run'
> > 
> > ## Resource Declaration:
> > 
> > # In /root/chef-solo/cookbooks-1/jenkins/providers/cli.rb
> > 
> > 49: jenkins\_execute command do  
> > 50: cwd home  
> > 51: block { |stdout| new\_resource.block.call(stdout) } if new\_resource.block  
> > 52: end  
> > 53: end
> > 
> > ## Compiled Resource:
> > 
> > # Declared in /root/chef-solo/cookbooks-1/jenkins/providers/cli.rb:49:in `action\_run'
> > 
> > jenkins\_execute("java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git") do  
> > action :run  
> > retries 0  
> > retry\_delay 2  
> > command "java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git"  
> > cookbook\_name :rackbox  
> > cwd "/home/jenkins"  
> > end
> > 
> > [2013-09-06T16:12:03+00:00] ERROR: Running exception handlers  
> > [2013-09-06T16:12:03+00:00] ERROR: Exception handlers complete  
> > [2013-09-06T16:12:03+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out  
> > Chef Client failed. 5 resources updated  
> > [2013-09-06T16:12:03+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

---

<div class="post-metadata">

**Author:** ![Michael\_Hayes](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Michael\_Hayes](https://discourse.chef.io/u/Michael_Hayes)\
**Post date:** [September 6, 2013, 7:37pm UTC](https://discourse.chef.io/t/error-executing-action-run-jenkins-cli/4410/4 "2013-09-06T19:37:20Z")

</div>

It appears to have worked correctly when i used the verbose output option for knife solo:

- jenkins\_execute[java -jar /home/jenkins/jenkins-cli.jar -s [http://166.78.108.63:8080](http://166.78.108.63:8080) install-plugin git] action run[2013-09-06T19:26:37+00:00] INFO: Processing jenkins\_execute[java -jar /home/jenkins/jenkins-cli.jar -s [http://166.78.108.63:8080](http://166.78.108.63:8080) install-plugin git] action run (/root/chef-solo/cookbooks-1/jenkins/providers/cli.rb line 49)  
[2013-09-06T19:26:37+00:00] DEBUG: Platform ubuntu version 12.04 found  
[2013-09-06T19:26:37+00:00] DEBUG: Executing java -jar /home/jenkins/jenkins-cli.jar -s [http://166.78.108.63:8080](http://166.78.108.63:8080) install-plugin git

> Try running chef with `-l debug` for more verbose output about the error. There are some changes to the jenkins cookbook that will make errors like this more informative, there should be a new release pretty soon.
> 
> --  
> Daniel DeLeo
> 
> On Friday, September 6, 2013 at 11:49 AM, Michael Hayes wrote:
> 
> > I thought maybe it's an issue with the `'hostname` which doesn't resolve, but I tried changing it to the ip address and it still doesn't work.
> > 
> > On Sep 6, 2013, at 12:15 PM, Michael Hayes [hayesmp@thefrontside.net](mailto:hayesmp@thefrontside.net) wrote:
> > 
> > > Not sure why I can't call this jenkins\_cli command (it's literally from the sample code on github. Could it be authentication related?
> > > 
> > > In my cookbook: recipes/jenkins.rb
> > > 
> > > include\_recipe "jenkins"
> > > 
> > > %w{ git github }.each do |plugin|  
> > > jenkins\_cli "install-plugin #{plugin}"  
> > > jenkins\_cli "safe-restart"  
> > > end
> > > 
> > > Chef Solo output:
> > > 
> > > - jenkins\_execute[java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git] action run  
> > > ================================================================================  
> > > Error executing action `run` on resource 'jenkins\_execute[java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git]'  
> > > ================================================================================
> > > 
> > > ## Chef::Exceptions::Exec
> > > 
> > > java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git returned 1, expected 0
> > > 
> > > ## Cookbook Trace:
> > > 
> > > /root/chef-solo/cookbooks-1/jenkins/providers/execute.rb:46:in `action\_run'
> > > 
> > > ## Resource Declaration:
> > > 
> > > # In /root/chef-solo/cookbooks-1/jenkins/providers/cli.rb
> > > 
> > > 49: jenkins\_execute command do  
> > > 50: cwd home  
> > > 51: block { |stdout| new\_resource.block.call(stdout) } if new\_resource.block  
> > > 52: end  
> > > 53: end
> > > 
> > > ## Compiled Resource:
> > > 
> > > # Declared in /root/chef-solo/cookbooks-1/jenkins/providers/cli.rb:49:in `action\_run'
> > > 
> > > jenkins\_execute("java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git") do  
> > > action :run  
> > > retries 0  
> > > retry\_delay 2  
> > > command "java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git"  
> > > cookbook\_name :rackbox  
> > > cwd "/home/jenkins"  
> > > end
> > > 
> > > [2013-09-06T16:12:03+00:00] ERROR: Running exception handlers  
> > > [2013-09-06T16:12:03+00:00] ERROR: Exception handlers complete  
> > > [2013-09-06T16:12:03+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out  
> > > Chef Client failed. 5 resources updated  
> > > [2013-09-06T16:12:03+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

---

<div class="post-metadata">

**Author:** ![Michael\_Hayes](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Michael\_Hayes](https://discourse.chef.io/u/Michael_Hayes)\
**Post date:** [September 6, 2013, 9:27pm UTC](https://discourse.chef.io/t/error-executing-action-run-jenkins-cli/4410/5 "2013-09-06T21:27:33Z")

</div>

Nope. It worked that one time and I have no idea why...

On Sep 6, 2013, at 2:37 PM, Michael Hayes [hayesmp@thefrontside.net](mailto:hayesmp@thefrontside.net) wrote:

> It appears to have worked correctly when i used the verbose output option for knife solo:
> 
> - jenkins\_execute[java -jar /home/jenkins/jenkins-cli.jar -s [http://166.78.108.63:8080](http://166.78.108.63:8080) install-plugin git] action run[2013-09-06T19:26:37+00:00] INFO: Processing jenkins\_execute[java -jar /home/jenkins/jenkins-cli.jar -s [http://166.78.108.63:8080](http://166.78.108.63:8080) install-plugin git] action run (/root/chef-solo/cookbooks-1/jenkins/providers/cli.rb line 49)  
> [2013-09-06T19:26:37+00:00] DEBUG: Platform ubuntu version 12.04 found  
> [2013-09-06T19:26:37+00:00] DEBUG: Executing java -jar /home/jenkins/jenkins-cli.jar -s [http://166.78.108.63:8080](http://166.78.108.63:8080) install-plugin git
> 
> > Try running chef with `-l debug` for more verbose output about the error. There are some changes to the jenkins cookbook that will make errors like this more informative, there should be a new release pretty soon.
> > 
> > --  
> > Daniel DeLeo
> > 
> > On Friday, September 6, 2013 at 11:49 AM, Michael Hayes wrote:
> > 
> > > I thought maybe it's an issue with the `'hostname` which doesn't resolve, but I tried changing it to the ip address and it still doesn't work.
> > > 
> > > On Sep 6, 2013, at 12:15 PM, Michael Hayes [hayesmp@thefrontside.net](mailto:hayesmp@thefrontside.net) wrote:
> > > 
> > > > Not sure why I can't call this jenkins\_cli command (it's literally from the sample code on github. Could it be authentication related?
> > > > 
> > > > In my cookbook: recipes/jenkins.rb
> > > > 
> > > > include\_recipe "jenkins"
> > > > 
> > > > %w{ git github }.each do |plugin|  
> > > > jenkins\_cli "install-plugin #{plugin}"  
> > > > jenkins\_cli "safe-restart"  
> > > > end
> > > > 
> > > > Chef Solo output:
> > > > 
> > > > - jenkins\_execute[java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git] action run  
> > > > ================================================================================  
> > > > Error executing action `run` on resource 'jenkins\_execute[java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git]'  
> > > > ================================================================================
> > > > 
> > > > ## Chef::Exceptions::Exec
> > > > 
> > > > java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git returned 1, expected 0
> > > > 
> > > > ## Cookbook Trace:
> > > > 
> > > > /root/chef-solo/cookbooks-1/jenkins/providers/execute.rb:46:in `action\_run'
> > > > 
> > > > ## Resource Declaration:
> > > > 
> > > > # In /root/chef-solo/cookbooks-1/jenkins/providers/cli.rb
> > > > 
> > > > 49: jenkins\_execute command do  
> > > > 50: cwd home  
> > > > 51: block { |stdout| new\_resource.block.call(stdout) } if new\_resource.block  
> > > > 52: end  
> > > > 53: end
> > > > 
> > > > ## Compiled Resource:
> > > > 
> > > > # Declared in /root/chef-solo/cookbooks-1/jenkins/providers/cli.rb:49:in `action\_run'
> > > > 
> > > > jenkins\_execute("java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git") do  
> > > > action :run  
> > > > retries 0  
> > > > retry\_delay 2  
> > > > command "java -jar /home/jenkins/jenkins-cli.jar -s [http://syncopated-soaring:8080](http://syncopated-soaring:8080) install-plugin git"  
> > > > cookbook\_name :rackbox  
> > > > cwd "/home/jenkins"  
> > > > end
> > > > 
> > > > [2013-09-06T16:12:03+00:00] ERROR: Running exception handlers  
> > > > [2013-09-06T16:12:03+00:00] ERROR: Exception handlers complete  
> > > > [2013-09-06T16:12:03+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out  
> > > > Chef Client failed. 5 resources updated  
> > > > [2013-09-06T16:12:03+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
