[JIRA] (JENKINS-36935) java.lang.ClassNotFoundException: org.bouncycastle.openssl.PEMReader

414 views
Skip to first unread message

doconnor@mygrocerydeals.com (JIRA)

unread,
Jul 25, 2016, 5:24:01 PM7/25/16
to jenkinsc...@googlegroups.com
Dennis O'Connor created an issue
 
Jenkins / Bug JENKINS-36935
java.lang.ClassNotFoundException: org.bouncycastle.openssl.PEMReader
Issue Type: Bug Bug
Assignee: Unassigned
Components: ssh-agent-plugin
Created: 2016/Jul/25 9:23 PM
Environment: Running on Amazon Linux 2015.03.01, Jenkins Master is the official 2.7.1 docker image, Slave docker images running from official Java 8 docker images
Priority: Minor Minor
Reporter: Dennis O'Connor

I upgraded to 1.13. My builds now get the following error:
java.io.IOException: Remote call on Docker Slave-e37abcfefda7 failed
at hudson.remoting.Channel.call(Channel.java:789)
at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:249)
at com.sun.proxy.$Proxy100.addIdentity(Unknown Source)
at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$SSHAgentEnvironment.add(SSHAgentBuildWrapper.java:395)
at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper.preCheckout(SSHAgentBuildWrapper.java:229)
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.NoClassDefFoundError: org/bouncycastle/openssl/PEMReader
at jenkins.bouncycastle.api.PEMEncodable.decode(PEMEncodable.java:146)
at com.cloudbees.jenkins.plugins.sshagent.jna.JNRRemoteAgent.addIdentity(JNRRemoteAgent.java:79)
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:498)
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 Docker Slave-e37abcfefda7(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)
... 10 more
Caused by: java.lang.ClassNotFoundException: org.bouncycastle.openssl.PEMReader
at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1376)
at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326)
at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1079)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at hudson.remoting.RemoteClassLoader$ClassLoaderProxy.fetch4(RemoteClassLoader.java:761)
at hudson.remoting.RemoteClassLoader$ClassLoaderProxy.fetch3(RemoteClassLoader.java:803)
at sun.reflect.GeneratedMethodAccessor132.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:884)
at hudson.remoting.Request$2.run(Request.java:332)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at org.jenkinsci.remoting.CallableDecorator.call(CallableDecorator.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)
at ......remote call to channel(Native Method)
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416)
at hudson.remoting.Request.call(Request.java:172)
at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:252)
at com.sun.proxy.$Proxy5.fetch3(Unknown Source)
at hudson.remoting.RemoteClassLoader.findClass(RemoteClassLoader.java:171)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at jenkins.bouncycastle.api.PEMEncodable.decode(PEMEncodable.java:146)
at com.cloudbees.jenkins.plugins.sshagent.jna.JNRRemoteAgent.addIdentity(JNRRemoteAgent.java:79)
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:498)
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)

Downgrading to 1.10 is a temporary workaround.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

johnrothermel@gmail.com (JIRA)

unread,
Sep 6, 2016, 10:10:01 AM9/6/16
to jenkinsc...@googlegroups.com
John Rothermel commented on Bug JENKINS-36935
 
Re: java.lang.ClassNotFoundException: org.bouncycastle.openssl.PEMReader

I ran into this same issue. Found that the bouncycastle-api-plugin did not get upgraded. I upgraded it to 1.648.3 and ssh-agent started working properly.

jglick@cloudbees.com (JIRA)

unread,
Nov 7, 2016, 12:07:01 PM11/7/16
to jenkinsc...@googlegroups.com
Jesse Glick updated an issue

Seems to cause a failure in the WorkflowPluginTest.sshGitInsideDocker acceptance test under 1.651.3 but not under 2.19.2.

Change By: Jesse Glick
Priority: Minor Critical

glon.sebastien@free.fr (JIRA)

unread,
Nov 30, 2016, 3:11:02 AM11/30/16
to jenkinsc...@googlegroups.com
sébastien glon edited a comment on Bug JENKINS-36935
 
Re: java.lang.ClassNotFoundException: org.bouncycastle.openssl.PEMReader
same error for me on 2 server:
Jenkins 2.14
* bouncycastle 2.16.0
* ssh-agent 1.13

Jenkins 2.19
* bouncycastle 2.16.0
* ssh-agent 1.13

glon.sebastien@free.fr (JIRA)

unread,
Nov 30, 2016, 3:11:02 AM11/30/16
to jenkinsc...@googlegroups.com

same error for me on 2 server:
Jenkins 2.14

  • bouncycastle 2.16.0
  • ssh-agent 1.13
    Jenkins 2.19
  • bouncycastle 2.16.0
  • ssh-agent 1.13

glon.sebastien@free.fr (JIRA)

unread,
Nov 30, 2016, 3:43:04 AM11/30/16
to jenkinsc...@googlegroups.com

glon.sebastien@free.fr (JIRA)

unread,
Nov 30, 2016, 3:46:01 AM11/30/16
to jenkinsc...@googlegroups.com
 
Re: java.lang.ClassNotFoundException: org.bouncycastle.openssl.PEMReader

[Pipeline] {
[Pipeline] sshagent
[ssh-agent] Using credentials jgit
[ssh-agent] Looking for ssh-agent implementation...
[ssh-agent] Java/JNR ssh-agent
[ssh-agent] Registered BouncyCastle on the remote agent
[ssh-agent] Unable to read key: problem creating RSA private key: java.lang.SecurityException: class "org.bouncycastle.asn1.ASN1Sequence"'s signer information does not match signer information of other classes in the same package
org.bouncycastle.openssl.PEMException: problem creating RSA private key: java.lang.SecurityException: class "org.bouncycastle.asn1.ASN1Sequence"'s signer information does not match signer information of other classes in the same package
at org.bouncycastle.openssl.PEMParser$KeyPairParser.parseObject(Unknown Source)
at org.bouncycastle.openssl.PEMParser.readObject(Unknown Source)
at jenkins.bouncycastle.api.PEMEncodable.decode(PEMEncodable.java:153)


at com.cloudbees.jenkins.plugins.sshagent.jna.JNRRemoteAgent.addIdentity(JNRRemoteAgent.java:79)
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:498)

at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:890)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:865)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:824)
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 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)

Caused by: org.bouncycastle.openssl.PEMException: problem creating RSA private key: java.lang.SecurityException: class "org.bouncycastle.asn1.ASN1Sequence"'s signer information does not match signer information of other classes in the same package
at org.bouncycastle.openssl.PEMParser$RSAKeyPairParser.parse(Unknown Source)
... 19 more
Caused by: java.lang.SecurityException: class "org.bouncycastle.asn1.ASN1Sequence"'s signer information does not match signer information of other classes in the same package
at java.lang.ClassLoader.checkCerts(ClassLoader.java:898)
at java.lang.ClassLoader.preDefineClass(ClassLoader.java:668)
at java.lang.ClassLoader.defineClass(ClassLoader.java:761)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at hudson.remoting.RemoteClassLoader.findClass(RemoteClassLoader.java:149)


at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

... 20 more
[ssh-agent] Started.

glon.sebastien@free.fr (JIRA)

unread,
Nov 30, 2016, 6:05:04 AM11/30/16
to jenkinsc...@googlegroups.com
same error for me on 2 server:
Jenkins 2.14
* bouncycastle 2.16.0
* ssh-agent 1.13

Jenkins 2.19
* bouncycastle 2.16.0
* ssh-agent 1.13


Same on 2.34

jglick@cloudbees.com (JIRA)

unread,
Feb 10, 2017, 2:02:01 PM2/10/17
to jenkinsc...@googlegroups.com
Jesse Glick commented on Bug JENKINS-36935
 
Re: java.lang.ClassNotFoundException: org.bouncycastle.openssl.PEMReader

Presumably ceases to be an issue for most people after JENKINS-36997 in 1.14.

glon.sebastien@free.fr (JIRA)

unread,
Mar 23, 2017, 9:51:02 AM3/23/17
to jenkinsc...@googlegroups.com
sébastien glon commented on Bug JENKINS-36935
 
Re: java.lang.ClassNotFoundException: org.bouncycastle.openssl.PEMReader

It's good for me on Jenkins 2.45 and ssh-agent 1.14

This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages