Hi,
Can anyone let me know - what wrong i am doing here?
Each time i try to install the jenkins version ‘1.638’ (install method is
set to war) using the Chef’s Jenkins cookbook i run into this
================================================================================
Error executing action `create` on resource
‘jenkins_private_key_credentials[jenkins]’
================================================================================
Mixlib::ShellOut::ShellCommandFailed
Hi,
Can anyone let me know - what wrong i am doing here?
Each time i try to install the jenkins version ‘1.638’ (install method is set to war) using the Chef’s Jenkins cookbook i run into this
================================================================================
Error executing action create
on resource ‘jenkins_private_key_credentials[jenkins]’
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '255'
---- 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/groovy20151115-29047-oikpm3 ----
STDOUT:
STDERR: java.io.EOFException
at java.io.DataInputStream.readBoolean(DataInputStream.java:244)
at hudson.cli.Connection.readBoolean(Connection.java:95)
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 "/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/groovy20151115-29047-oikpm3 ----
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/groovy20151115-29047-oikpm3 returned 255
===================================================
Here is a gist of the wrapper recipe that installs the jenkins master: https://gist.github.com/okram999/1a2883cc6ffd0d197091
The install doesn’t set up any kind of authentication. It creates a user and also creates a credential. Creating the credential is where its failing.
Below are some of the attributes related to the jenkins install
default[‘jenkins’][‘master’][‘install_method’] = 'war’
default[‘jenkins’][‘master’][‘version’] = ‘1.638’ #if i change this to 1.589 it works!!!
default[‘jenkins’][‘master’][‘source’] = "#{node[‘jenkins’][‘master’][‘mirror’]}/war/#{node[‘jenkins’][‘master’][‘version’]}/jenkins.war"
default[‘jenkins’][‘master’][‘listen_address’] = '127.0.0.1’
default[‘jenkins’][‘master’][‘log_directory’] = ‘/var/log/jenkins’
Can anyone from the jenkins cookbook team or who is using the cookbook, tell if they had the same issue with the version of jenkins? IMHO i don’t think its the cookbooks issue
Can you point us at an example that fails in this way? I’m using the jenkins cookbook in a few different places, and the only time I’ve encountered an error like yours if it I supply authentication data to a Jenkins instance that doesn’t require it.
@martinb3 i am using the cookbooks resource to create the jenkins global credentials. This credential will be used for master - slave comm.
This is the code (line 90-100 in jenkins_master.rb · GitHub ) that does that, using the custom resource of the cookbok (jenkins_private_key_credentials) & this is the block where its failing.
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 end end
Chef Attributes defined:
default['jenkins']['master_config']['credentials']['jenkins'] = { 'name' => 'jenkins', 'description' => 'Jenkins ssh user', 'databag_key_name' => "jenkins_private_key", }
The chef run throws the below error
Mixlib::ShellOut::ShellCommandFailed
Expected process to exit with [0], but received '255'
---- 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/groovy20151115-29047-oikpm3 ----
STDOUT:
STDERR: java.io.EOFException
at java.io.DataInputStream.readBoolean(DataInputStream.java:244)
at hudson.cli.Connection.readBoolean(Connection.java:95)
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 "/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/groovy20151115-29047-oikpm3 ----
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/groovy20151115-29047-oikpm3 returned 255
PS: the same works on jenkins 1.5 (1.589 to be precise)