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

Artifactory plugin: java.lang.ClassNotFoundException: hudson.matrix.MatrixRun

XMLWordPrintable

      We handle several Jenkins instances and we updated them all from 2.46.2 to 2.121.2. The plugins were also updated immediately afterwards. *

      The Artifactory plugin, specifically, was updated from 2.13.0 to 2.16.0.

      After that, the UI job configuration of Freestyle jobs AND the execution of pipelines jobs started throwing the following Exception:

      java.lang.ClassNotFoundException: hudson.matrix.MatrixRun
          at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1374)
          at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1327)
          at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1080)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
          at org.jfrog.hudson.util.BuildUniqueIdentifierHelper.getBuildNumber(BuildUniqueIdentifierHelper.java:134)
          at org.jfrog.hudson.pipeline.types.buildInfo.BuildInfo.<init>(BuildInfo.java:54)
          at org.jfrog.hudson.pipeline.steps.CreateBuildInfoStep$Execution.run(CreateBuildInfoStep.java:30)
          at org.jfrog.hudson.pipeline.steps.CreateBuildInfoStep$Execution.run(CreateBuildInfoStep.java:19)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:42)
          at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:229)
          at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:153)
          at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)
          at org.jfrog.hudson.pipeline.Utils.appendBuildInfo(Utils.java:355)
          at org.jfrog.hudson.pipeline.types.ArtifactoryServer.download(ArtifactoryServer.java:96)
          at org.jfrog.hudson.pipeline.types.ArtifactoryServer.download(ArtifactoryServer.java:72)
          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 org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
          at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
          at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
          at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
          at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:47)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
          at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:20)
      Caused: java.lang.NoClassDefFoundError: hudson/matrix/MatrixRun
          at org.jfrog.hudson.util.BuildUniqueIdentifierHelper.getBuildNumber(BuildUniqueIdentifierHelper.java:134)
          at org.jfrog.hudson.pipeline.types.buildInfo.BuildInfo.<init>(BuildInfo.java:54)
          at org.jfrog.hudson.pipeline.steps.CreateBuildInfoStep$Execution.run(CreateBuildInfoStep.java:30)
          at org.jfrog.hudson.pipeline.steps.CreateBuildInfoStep$Execution.run(CreateBuildInfoStep.java:19)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:42)
          at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:229)
          at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:153)
          at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)
          at org.jfrog.hudson.pipeline.Utils.appendBuildInfo(Utils.java:355)
          at org.jfrog.hudson.pipeline.types.ArtifactoryServer.download(ArtifactoryServer.java:96)
          at org.jfrog.hudson.pipeline.types.ArtifactoryServer.download(ArtifactoryServer.java:72)
          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 org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
          at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
          at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
          at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
          at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:47)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
          at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:20)
          at WorkflowScript.run(WorkflowScript:17)
          at ___cps.transform___(Native Method)
          at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:57)
          at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
          at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
          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 com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
          at com.cloudbees.groovy.cps.impl.LocalVariableBlock$LocalVariable.get(LocalVariableBlock.java:39)
          at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
          at com.cloudbees.groovy.cps.impl.LocalVariableBlock.evalLValue(LocalVariableBlock.java:28)
          at com.cloudbees.groovy.cps.LValueBlock$BlockImpl.eval(LValueBlock.java:55)
          at com.cloudbees.groovy.cps.LValueBlock.eval(LValueBlock.java:16)
          at com.cloudbees.groovy.cps.Next.step(Next.java:83)
          at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
          at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
          at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)
          at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)
          at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
          at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:332)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$200(CpsThreadGroup.java:83)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:244)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:232)
          at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131)
          at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
          at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748)
      Finished: FAILURE
      

      We tried uninstalling/installing/reinstalling the Matrix Project plugin. No success.

      Downgrading Artifactory back to the previous version "fixes" the issue.

      Then we noticed a pattern: the issue happens in instances where the Git plugin is not installed. Installing the Git plugin in the faulty instances would "fix" them.

      ------

      The Artifactory pom file lists git as optional dependency. But we still do not understand how the absence of the Git plugin would cause a ClassNotFoundException related to hudson.matrix.MatrixRun.

      Artifactory does not declare any dependency to the Matrix Project plugin. So, we wonder whether it did become a hard dependency but no one detected it because... hey... git is a standard plugin nowadays....

      As mentioned above, having Artifactory + Matrix Project plugins installed still causes the issue. So we also wonder if the Artifactory plugin isn't – maybe – running with its own classloader somehow...

      Either way, making the Git plugin an explicit hard dependency of Artifactory should solve the issue....

       

      * Side-note: We tell the Jenkins admins to update their stuff more often to avoid those big-bang updates. Next time we will chop fingers off...

            eyalbe Eyal Ben Moshe
            rafaelrezend Rafael Rezende
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: