Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-36935

java.lang.ClassNotFoundException: org.bouncycastle.openssl.PEMReader

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: ssh-agent-plugin
    • Labels:
      None
    • 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
    • Similar Issues:

      Description

      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.

        Attachments

          Issue Links

            Activity

            Hide
            johnrothermel John Rothermel added a comment -

            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.

            Show
            johnrothermel John Rothermel added a comment - 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.
            Hide
            jglick Jesse Glick added a comment -

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

            Show
            jglick Jesse Glick added a comment - Seems to cause a failure in the WorkflowPluginTest.sshGitInsideDocker acceptance test under 1.651.3 but not under 2.19.2.
            Hide
            sebglon sébastien glon added a comment - - edited

            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

            Show
            sebglon sébastien glon added a comment - - edited 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
            Hide
            sebglon sébastien glon added a comment -

            [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.

            Show
            sebglon sébastien glon added a comment - [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.
            Hide
            jglick Jesse Glick added a comment -

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

            Show
            jglick Jesse Glick added a comment - Presumably ceases to be an issue for most people after JENKINS-36997 in 1.14.
            Hide
            sebglon sébastien glon added a comment -

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

            Show
            sebglon sébastien glon added a comment - It's good for me on Jenkins 2.45 and ssh-agent 1.14
            Hide
            jglick Jesse Glick added a comment -

            Lowering priority accordingly—should only affect builds on nodes lacking an ssh-agent executable.

            Show
            jglick Jesse Glick added a comment - Lowering priority accordingly—should only affect builds on nodes lacking an ssh-agent executable.

              People

              • Assignee:
                Unassigned
                Reporter:
                dennisfoconnor Dennis O'Connor
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: