# Jenkins Community Cookbook throws Java error

**URL:** <https://discourse.chef.io/t/jenkins-community-cookbook-throws-java-error/6651>\
**Category:** Chef Infra (archive)\
**Created:** [June 11, 2015, 6:09pm UTC](https://discourse.chef.io/t/jenkins-community-cookbook-throws-java-error/6651 "2015-06-11T18:09:41Z")\
**Posts on this page:** 2\
**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:** [June 11, 2015, 6:09pm UTC](https://discourse.chef.io/t/jenkins-community-cookbook-throws-java-error/6651/1 "2015-06-11T18:09:41Z")

</div>

hi,  
Can someone help shed some lights on what is this java error for the custom  
resource in the community jenkins cookbook?

================================================================================  
Error executing action `create` on resource  
’jenkins\_private\_key\_credentials[xyz]’

================================================================================

```
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '255'
---- Begin output of "java" -jar "/var/chef/cache/jenkins-cli.jar" -s

```

[http://localhost:8080](http://localhost:8080) -i “/var/chef/cache/jenkins-key” groovy  
/tmp/groovy20150611-12633-1ntx19c ----  
STDOUT:  
STDERR: java.io.EOFException  
at java.io.DataInputStream.readBoolean(DataInputStream.java:244)  
at hudson.cli.Connection.readBoolean(Connection.java:93)  
at hudson.cli.CLI.authenticate(CLI.java:573)  
at hudson.cli.CLI.\_main(CLI.java:484)  
at hudson.cli.CLI.main(CLI.java:390)  
---- End output of “java” -jar “/var/chef/cache/jenkins-cli.jar” -s  
[http://localhost:8080](http://localhost:8080) -i “/var/chef/cache/jenkins-key” groovy  
/tmp/groovy20150611-12633-1ntx19c ----  
Ran “java” -jar “/var/chef/cache/jenkins-cli.jar” -s  
[http://localhost:8080](http://localhost:8080) -i “/var/chef/cache/jenkins-key” groovy  
/tmp/groovy20150611-12633-1ntx19c returned 255

So, this is the part of my recipe (where its failing) which uses the  
chef-community Jenkins cookbook.

ruby\_block ‘set private key’ do  
block { node.run\_state[:jenkins\_private\_key] =  
data\_bag[“jenkins\_private\_key”] }  
end

_if node[:jenkins][:master\_config][:credentials]  
node[:jenkins][:master\_config][:credentials].each do |name,  
credential| jenkins\_private\_key\_credentials credential[“name”] do  
description credential[“description”] private\_key  
data\_bag["#{credential[“databag\_key\_name”]}"] if credential[“id”]  
id credential[“id”] end end endend_

---

<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:** [June 11, 2015, 8:23pm UTC](https://discourse.chef.io/t/jenkins-community-cookbook-throws-java-error/6651/2 "2015-06-11T20:23:40Z")

</div>

like its something related to the version of jenkins's war in use. An older  
version of war when used in the cookbook, dont have the issue. I will post  
this on github of the jenkins cookbook.

On Thu, Jun 11, 2015 at 11:09 AM, niristotle okram [nirish.okram@gmail.com](mailto:nirish.okram@gmail.com)  
wrote:

> hi,  
> Can someone help shed some lights on what is this java error for the  
> custom resource in the community jenkins cookbook?
> 
> ================================================================================  
> Error executing action `create` on resource  
> 'jenkins\_private\_key\_credentials[xyz]'
> 
> ================================================================================
> 
> ```
> Mixlib::ShellOut::ShellCommandFailed
> ------------------------------------
> Expected process to exit with [0], but received '255'
> ---- Begin output of "java" -jar "/var/chef/cache/jenkins-cli.jar" -s
> 
> ```
> 
> [http://localhost:8080](http://localhost:8080) -i "/var/chef/cache/jenkins-key" groovy  
> /tmp/groovy20150611-12633-1ntx19c ----  
> STDOUT:  
> STDERR: java.io.EOFException  
> at java.io.DataInputStream.readBoolean(DataInputStream.java:244)  
> at hudson.cli.Connection.readBoolean(Connection.java:93)  
> at hudson.cli.CLI.authenticate(CLI.java:573)  
> at hudson.cli.CLI.\_main(CLI.java:484)  
> at hudson.cli.CLI.main(CLI.java:390)  
> ---- End output of "java" -jar "/var/chef/cache/jenkins-cli.jar" -s  
> [http://localhost:8080](http://localhost:8080) -i "/var/chef/cache/jenkins-key" groovy  
> /tmp/groovy20150611-12633-1ntx19c ----  
> Ran "java" -jar "/var/chef/cache/jenkins-cli.jar" -s  
> [http://localhost:8080](http://localhost:8080) -i "/var/chef/cache/jenkins-key" groovy  
> /tmp/groovy20150611-12633-1ntx19c returned 255
> 
> So, this is the part of my recipe (where its failing) which uses the  
> chef-community Jenkins cookbook.
> 
> ruby\_block 'set private key' do  
> block { node.run\_state[:jenkins\_private\_key] = data\_bag["jenkins\_private\_key"] }  
> end
> 
> _if node[:jenkins][:master\_config][:credentials] node[:jenkins][:master\_config][:credentials].each do |name, credential| jenkins\_private\_key\_credentials credential["name"] do description credential["description"] private\_key data\_bag["#{credential["databag\_key\_name"]}"] if credential["id"] id credential["id"] end end endend_

--  
Regards  
nirish okram
