Running 2.19.4 with the daften/feature/jenkins2 cookbook. Having some trouble getting an ssh slave working:
* jenkins_ssh_slave[bosxjenkspd01] action create
================================================================================
Error executing action `create` on resource 'jenkins_ssh_slave[bosxjenkspd01]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of "/usr/lib/jvm/java-8-oracle-amd64/bin/java" -jar "/var/chef/cache/jenkins-cli.jar" -s http://localhost:8080 groovy /tmp/groovy20161210-8184-1kyquh1 ----
STDOUT:
STDERR: ERROR: Unexpected exception occurred while performing groovy command.
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
RemoteClass: 44: unable to resolve class hudson.plugins.sshslaves.SSHLauncher
@ line 44, column 11.
new hudson.plugins.sshslaves.SSHLauncher(
^
1 error
at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:946)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:593)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:542)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
at groovy.lang.GroovyShell.run(GroovyShell.java:517)
at groovy.lang.GroovyShell.run(GroovyShell.java:497)
at hudson.cli.GroovyCommand.run(GroovyCommand.java:86)
at hudson.cli.CLICommand.main(CLICommand.java:257)
at hudson.cli.CliManagerImpl.main(CliManagerImpl.java:93)
at sun.reflect.GeneratedMethodAccessor176.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:887)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:862)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:821)
at hudson.remoting.UserRequest.perform(UserRequest.java:153)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at hudson.remoting.Request$2.run(Request.java:332)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at hudson.cli.CliManagerImpl$1.call(CliManagerImpl.java:64) [219/1083]
at hudson.remoting.CallableDecoratorAdapter.call(CallableDecoratorAdapter.java:18)
at hudson.remoting.CallableDecoratorList$1.call(CallableDecoratorList.java:21)
at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
---- End output of "/usr/lib/jvm/java-8-oracle-amd64/bin/java" -jar "/var/chef/cache/jenkins-cli.jar" -s http://localhost:8080 groovy /tmp/groovy20161210-8184-1kyquh1 ----
Ran "/usr/lib/jvm/java-8-oracle-amd64/bin/java" -jar "/var/chef/cache/jenkins-cli.jar" -s http://localhost:8080 groovy /tmp/groovy20161210-8184-1kyquh1 returned 1
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/jenkins/libraries/_executor.rb:84:in `execute!'
/var/chef/cache/cookbooks/jenkins/libraries/_executor.rb:137:in `groovy!'
/var/chef/cache/cookbooks/jenkins/libraries/slave.rb:152:in `block in action_create'
/var/chef/cache/cookbooks/jenkins/libraries/slave.rb:151:in `action_create'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:78:in `run_action'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block (2 levels) in converge'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `each'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block in converge'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:105:in `converge'
Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/mycompany-jenkins/recipes/bel_master.rb
98: jenkins_ssh_slave 'bosxjenkspd01' do
99: description 'OSX Jenkins Slave'
100: remote_fs '/Users/mycompany'
101: labels ['osx']
102: host 'bosxjenkspd01.ourdomain.com'
103: user 'mycompany'
104: credentials 'c3d75067-d1c2-475f-94d8-49d32f9ad63d'
105: notifies :execute, 'jenkins_command[safe-restart]', :delayed
106: end
107:
Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/mycompany-jenkins/recipes/bel_master.rb:98:in `from_file'
jenkins_ssh_slave("bosxjenkspd01") do
action [:create]
retries 0
retry_delay 2
default_guard_interpreter :default
declared_type :jenkins_ssh_slave
cookbook_name "mycompany-jenkins"
recipe_name "bel_master"
description "OSX Jenkins Slave"
remote_fs "/Users/mycompany"
labels ["osx"]
host "bosxjenkspd01.ourdomain.com"
user "mycompany"
credentials "c3d75067-d1c2-475f-94d8-49d32f9ad63d"
slave_name "bosxjenkspd01"
usage_mode "normal"
end
Anyone happen to have any ideas what’s wrong? I install the following plugins and do a safe-restart before I start configuring this, like so:
# Install a set of given plugins
jenkins2_plugins = %w(mailer credentials ssh-credentials ssh-slaves)
jenkins2_plugins.each do |jp|
jenkins_plugin jp do
action [:install]
notifies :execute, 'jenkins_command[safe-restart]', :immediately
end
end