这与任何使用厨师安装jenkins和jenkins插件的人有关。
当我尝试使用opscode-cookbooks / jenkins cookbook安装'git'插件时,我收到此错误。
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 install-plugin git ----
STDOUT: Installing a plugin from local file: git
STDERR: java.io.IOException: Failed to copy git to /var/lib/jenkins/plugins/git.jpi
at hudson.FilePath.copyTo(FilePath.java:1989)
at hudson.cli.InstallPluginCommand.run(InstallPluginCommand.java:85)
at hudson.cli.CLICommand.main(CLICommand.java:237)
at hudson.cli.CliManagerImpl.main(CliManagerImpl.java:92)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:326)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:301)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:260)
at hudson.remoting.UserRequest.perform(UserRequest.java:121)
at hudson.remoting.UserRequest.perform(UserRequest.java:49)
at hudson.remoting.Request$2.run(Request.java:325)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at hudson.cli.CliManagerImpl$1.call(CliManagerImpl.java:63)
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:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: remote file operation failed: git at hudson.remoting.Channel@3ca34885:CLI channel from /127.0.0.1: java.io.FileNotFoundException: git (Is a directory)
at hudson.FilePath.act(FilePath.java:985)
at hudson.FilePath.act(FilePath.java:967)
at hudson.FilePath.copyTo(FilePath.java:2010)
at hudson.FilePath.copyTo(FilePath.java:1984)
... 22 more
Caused by: java.io.FileNotFoundException: git (Is a directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at hudson.FilePath$41.invoke(FilePath.java:2015)
at hudson.FilePath$41.invoke(FilePath.java:2010)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2688)
at hudson.remoting.UserRequest.perform(UserRequest.java:121)
at hudson.remoting.UserRequest.perform(UserRequest.java:49)
at hudson.remoting.Request$2.run(Request.java:325)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
at ......remote call to CLI channel from /127.0.0.1(Native Method)
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1360)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
at hudson.remoting.Channel.call(Channel.java:753)
at hudson.FilePath.act(FilePath.java:978)
... 25 more
---- End output of java -jar /var/chef/cache/jenkins-cli.jar -s http://localhost:8080 install-plugin git ----
Ran java -jar /var/chef/cache/jenkins-cli.jar -s http://localhost:8080 install-plugin git returned 255
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/jenkins/libraries/_executor.rb:79:in `execute!'
/var/chef/cache/cookbooks/jenkins/libraries/plugin.rb:125:in `block (2 levels) in <class:JenkinsPlugin>'
/var/chef/cache/cookbooks/jenkins/libraries/plugin.rb:137:in `block in <class:JenkinsPlugin>'
Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/prsn_jenkins/recipes/plugins.rb
3: jenkins_plugin plugin if flag
4: end
Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/prsn_jenkins/recipes/plugins.rb:3:in `block in from_file'
jenkins_plugin("git") do
action :install
retries 0
retry_delay 2
guard_interpreter :default
cookbook_name "prsn_jenkins"
recipe_name "plugins"
version :latest
end
我的食谱使用了opscode-cookbook / jenkins。这是我的食谱的样子:
属性文件:
default['plugin_jenkins']['plugins'] = { 'active-directory' => {:enable => true}, 'git-client' => {:enable => true}, 'git' => {:enable => true} }
配方文件:
node['plugin_jenkins']['plugins'].each do |plugin, flag|
jenkins_plugin plugin if flag
end
答案 0 :(得分:0)
如果您使用的是opscode-cookbooks / jenkins,则应考虑升级该菜谱。最新的食谱(v2.3.1)似乎解决了这个问题!