[JIRA] [ssh-agent-plugin] (JENKINS-34930) ClassCastException when trying to start ssh-agent

已查看 5 次
跳至第一个未读帖子

bartvanwissen@gmail.com (JIRA)

未读,
2016年5月18日 15:35:012016/5/18
收件人 jenkinsc...@googlegroups.com
bart van Wissen created an issue
 
Jenkins / Bug JENKINS-34930
ClassCastException when trying to start ssh-agent
Issue Type: Bug Bug
Assignee: Unassigned
Components: ssh-agent-plugin
Created: 2016/May/18 7:34 PM
Priority: Major Major
Reporter: bart van Wissen

I'm getting the following Exception stack trace when in my build log:

FATAL: [ssh-agent] Unable to start agent
hudson.util.IOException2: [ssh-agent] Unable to start agent
	at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper.createSSHAgentEnvironment(SSHAgentBuildWrapper.java:231)
	at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper.preCheckout(SSHAgentBuildWrapper.java:189)
	at jenkins.scm.SCMCheckoutStrategy.preCheckout(SCMCheckoutStrategy.java:76)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:528)
	at hudson.model.Run.execute(Run.java:1741)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:98)
	at hudson.model.Executor.run(Executor.java:410)
Caused by: java.lang.RuntimeException: Failed to register BouncyCastle as the defaut JCE provider
	at org.apache.sshd.common.util.SecurityUtils.register(SecurityUtils.java:102)
	at org.apache.sshd.common.util.SecurityUtils.isBouncyCastleRegistered(SecurityUtils.java:81)
	at com.cloudbees.jenkins.plugins.sshagent.jna.JNRRemoteAgent.addIdentity(JNRRemoteAgent.java:80)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:884)
	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:859)
	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:818)
	at hudson.remoting.UserRequest.perform(UserRequest.java:152)
	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 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)
	at ......remote call to New jenkins slave (i-2bd55aa7)(Native Method)
	at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416)
	at hudson.remoting.UserResponse.retrieve(UserRequest.java:252)
	at hudson.remoting.Channel.call(Channel.java:781)
	at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:249)
	at com.sun.proxy.$Proxy81.addIdentity(Unknown Source)
	at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$SSHAgentEnvironment.<init>(SSHAgentBuildWrapper.java:339)
	at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper.createSSHAgentEnvironment(SSHAgentBuildWrapper.java:224)
	... 7 more
Caused by: java.lang.InternalError: cannot create instance of org.bouncycastle.jcajce.provider.symmetric.IDEA$Mappings : java.lang.ClassCastException: org.bouncycastle.jcajce.provider.symmetric.IDEA$Mappings cannot be cast to org.bouncycastle.jcajce.provider.util.AlgorithmProvider
	at org.bouncycastle.jce.provider.BouncyCastleProvider.loadAlgorithms(Unknown Source)
	at org.bouncycastle.jce.provider.BouncyCastleProvider.setup(Unknown Source)
	at org.bouncycastle.jce.provider.BouncyCastleProvider.access$000(Unknown Source)
	at org.bouncycastle.jce.provider.BouncyCastleProvider$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.bouncycastle.jce.provider.BouncyCastleProvider.<init>(Unknown Source)
	at org.apache.sshd.common.util.SecurityUtils$BouncyCastleRegistration.run(SecurityUtils.java:114)
	at org.apache.sshd.common.util.SecurityUtils.register(SecurityUtils.java:96)
	at org.apache.sshd.common.util.SecurityUtils.isBouncyCastleRegistered(SecurityUtils.java:81)
	at com.cloudbees.jenkins.plugins.sshagent.jna.JNRRemoteAgent.addIdentity(JNRRemoteAgent.java:80)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:884)
	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:859)
	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:818)
	at hudson.remoting.UserRequest.perform(UserRequest.java:152)
	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 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)

I did add this line to my java.security file but that didn't help:

security.provider.11=org.bouncycastle.jce.provider.BouncyCastleProvider
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

b2jrock@java.net (JIRA)

未读,
2016年5月19日 23:59:012016/5/19
收件人 jenkinsc...@googlegroups.com
b2jrock commented on Bug JENKINS-34930
 
Re: ClassCastException when trying to start ssh-agent

If you have the docker-buildstep plugin enabled, you might want to try disabling it.

Both these plugins include the bouncycastle provider, but they might not have compatible versions:
/var/lib/jenkins/plugins/ssh-agent/WEB-INF/lib/bcprov-jdk15on-1.53.jar
/var/lib/jenkins/plugins/docker-build-step/WEB-INF/lib/bcprov-jdk15on-1.51.jar

bartvanwissen@gmail.com (JIRA)

未读,
2016年5月20日 05:11:012016/5/20
收件人 jenkinsc...@googlegroups.com

I don't have that plugin, but I did a find plugins -name bcprov -print and discovered that there are two other plugins which come with bouncycastle:

plugins/ec2/WEB-INF/lib/bcprov-jdk15-140.jar
plugins/ssh-agent/WEB-INF/lib/bcprov-jdk15on-1.47.jar
plugins/vagrant/WEB-INF/classes/vendor/gems/jruby/1.8/gems/bouncy-castle-java-1.5.0146.1/lib/bcprov-jdk15-146.jar

I cannot disable the ec2 plugin though, because it manages our slaves.

bartvanwissen@gmail.com (JIRA)

未读,
2016年5月20日 05:48:012016/5/20
收件人 jenkinsc...@googlegroups.com

Removing the vagrant subdirectory seems to have done the trick. Thanks.

回复全部
回复作者
转发
0 个新帖子