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

java.lang.NoClassDefFoundError: jnr/posix/POSIXHandler

      I made a job that just does

      echo foo >foo.txt
      

      and is set to archive *.txt. Then I bound that job to a slave with a label.

      The build fails with

      + echo foo
      Archiving artifacts
      ERROR: Failed to archive artifacts: *.txt
      java.io.IOException: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: jnr/posix/POSIXHandler
      	at hudson.FilePath.copyRecursiveTo(FilePath.java:2016)
      	at jenkins.model.StandardArtifactManager.archive(StandardArtifactManager.java:57)
      	at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:140)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:757)
      	at hudson.model.Build$BuildExecution.post2(Build.java:183)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:706)
      	at hudson.model.Run.execute(Run.java:1703)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:231)
      Caused by: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: jnr/posix/POSIXHandler
      	at hudson.remoting.Channel$3.adapt(Channel.java:755)
      	at hudson.remoting.Channel$3.adapt(Channel.java:750)
      	at hudson.remoting.FutureAdapter.get(FutureAdapter.java:55)
      	at hudson.FilePath.copyRecursiveTo(FilePath.java:2014)
      	... 11 more
      Caused by: java.lang.NoClassDefFoundError: jnr/posix/POSIXHandler
      	at hudson.util.IOUtils.mode(IOUtils.java:125)
      	at hudson.util.io.TarArchiver.visit(TarArchiver.java:101)
      	at hudson.util.DirScanner.scanSingle(DirScanner.java:49)
      	at hudson.FilePath$ExplicitlySpecifiedDirScanner.scan(FilePath.java:2540)
      	at hudson.FilePath.writeToTar(FilePath.java:2052)
      	at hudson.FilePath.access$1000(FilePath.java:172)
      	at hudson.FilePath$41.invoke(FilePath.java:1993)
      	at hudson.FilePath$41.invoke(FilePath.java:1989)
      	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2461)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      	at hudson.remoting.Request$2.run(Request.java:328)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:701)
      Caused by: java.lang.ClassNotFoundException: jnr.posix.POSIXHandler (WebAppClassLoader=Jenkins v1.546@49f4bcf7 did not find class file)
      	at hudson.remoting.RemoteClassLoader$ClassLoaderProxy.fetch2(RemoteClassLoader.java:727)
      	at hudson.remoting.RemoteClassLoader$ClassLoaderProxy.fetch4(RemoteClassLoader.java:777)
      	at hudson.remoting.RemoteClassLoader$ClassLoaderProxy.fetch3(RemoteClassLoader.java:784)
      	at sun.reflect.GeneratedMethodAccessor1893.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:616)
      	at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:299)
      	at hudson.remoting.Request$2.run(Request.java:328)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:679)
      

      If I run the job on the master, it works fine.

      Somehow, the jnr-posix stuff isn't made available on the slave.

      (seems related to JENKINS-18682, which was claused because of inactivity)

          [JENKINS-21985] java.lang.NoClassDefFoundError: jnr/posix/POSIXHandler

          Daniel Beck added a comment -

          Please provide more information about your environment (and Jenkins version).

          Daniel Beck added a comment - Please provide more information about your environment (and Jenkins version).

          Jenkins 1.546, master and slave are CentOS 6, java-1.6.0-openjdk, jenkins.war on the master downloaded directly from web site

          Peter Eisentraut added a comment - Jenkins 1.546, master and slave are CentOS 6, java-1.6.0-openjdk, jenkins.war on the master downloaded directly from web site

          The stack trace is truncated and I think it's missing the nested part that's crucial.

          Kohsuke Kawaguchi added a comment - The stack trace is truncated and I think it's missing the nested part that's crucial.

          updated stack strace

          Peter Eisentraut added a comment - updated stack strace

          Pascal Grippi added a comment - - edited

          Hi,
          It looks we are curently experiencing the same issue.
          We have a slave rinnung on Win8 without issue using the artifact publisher and it worked for a while without any problem.
          But with another slave running on Lunix computer (Linux ubuntu-jenkins-uklab-node002 3.2.0-64-generic #97-Ubuntu SMP Wed Jun 4 22:03:48 UTC 2014 i686 i686 i386 GNU/Linux) it is not possible to make it works even with the most simple Job.

          Edit: Jenkins ver. 1.548

          log:

          [EnvInject] - Loading node environment variables.
          Building remotely on UBUNTU-JENKINS-UKLAB-NODE002 in workspace /var/jenkins/workspace/t_artifact_jnr_posix_issue
          Run condition [Execute Shell] enabling prebuild for step [Archive the artifacts]
          [t_artifact_jnr_posix_issue] $ /bin/sh -xe /tmp/CommandInterpreterCondition1191287595508755352.sh
          + touch test.txt
          Run condition [Execute Shell] enabling perform for step [Archive the artifacts]
          Archiving artifacts
          ERROR: Failed to archive artifacts: test.txt
          java.io.IOException: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: jnr/posix/POSIXHandler
          at hudson.FilePath.copyRecursiveTo(FilePath.java:2016)
          at jenkins.model.StandardArtifactManager.archive(StandardArtifactManager.java:57)
          at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:140)
          at org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.run(BuildStepRunner.java:110)
          at org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail.conditionalRun(BuildStepRunner.java:154)
          at org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:105)
          at org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder.perform(SingleConditionalBuilder.java:108)
          at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:784)
          at hudson.model.Build$BuildExecution.build(Build.java:199)
          at hudson.model.Build$BuildExecution.doRun(Build.java:160)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:565)
          at hudson.model.Run.execute(Run.java:1670)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:231)
          Caused by: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: jnr/posix/POSIXHandler
          at hudson.remoting.Channel$3.adapt(Channel.java:755)
          at hudson.remoting.Channel$3.adapt(Channel.java:750)
          at hudson.remoting.FutureAdapter.get(FutureAdapter.java:55)
          at hudson.FilePath.copyRecursiveTo(FilePath.java:2014)
          ... 15 more
          Caused by: java.lang.NoClassDefFoundError: jnr/posix/POSIXHandler
          at hudson.util.IOUtils.mode(IOUtils.java:125)
          at hudson.util.io.TarArchiver.visit(TarArchiver.java:101)
          at hudson.util.DirScanner.scanSingle(DirScanner.java:49)
          at hudson.FilePath$ExplicitlySpecifiedDirScanner.scan(FilePath.java:2540)
          at hudson.FilePath.writeToTar(FilePath.java:2052)
          at hudson.FilePath.access$1000(FilePath.java:172)
          at hudson.FilePath$41.invoke(FilePath.java:1993)
          at hudson.FilePath$41.invoke(FilePath.java:1989)
          at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2461)
          at hudson.remoting.UserRequest.perform(UserRequest.java:118)
          at hudson.remoting.UserRequest.perform(UserRequest.java:48)
          at hudson.remoting.Request$2.run(Request.java:328)
          at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
          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 hudson.remoting.Engine$1$1.run(Engine.java:63)
          at java.lang.Thread.run(Thread.java:745)
          Caused by: java.lang.ClassNotFoundException: jnr.posix.POSIXHandler (WebAppClassLoader=Jenkins v1.548@1dd49247 did not find class file)
          at hudson.remoting.RemoteClassLoader$ClassLoaderProxy.fetch2(RemoteClassLoader.java:727)
          at hudson.remoting.RemoteClassLoader$ClassLoaderProxy.fetch4(RemoteClassLoader.java:777)
          at hudson.remoting.RemoteClassLoader$ClassLoaderProxy.fetch3(RemoteClassLoader.java:784)
          at sun.reflect.GeneratedMethodAccessor5170.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:299)
          at hudson.remoting.Request$2.run(Request.java:328)
          at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
          at java.util.concurrent.FutureTask.run(FutureTask.java:138)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:662)
          Build step 'Conditional step (single)' changed build result to FAILURE
          Notifying upstream projects of job completion
          Finished: FAILURE

          Pascal Grippi added a comment - - edited Hi, It looks we are curently experiencing the same issue. We have a slave rinnung on Win8 without issue using the artifact publisher and it worked for a while without any problem. But with another slave running on Lunix computer (Linux ubuntu-jenkins-uklab-node002 3.2.0-64-generic #97-Ubuntu SMP Wed Jun 4 22:03:48 UTC 2014 i686 i686 i386 GNU/Linux) it is not possible to make it works even with the most simple Job. Edit: Jenkins ver. 1.548 log: [EnvInject] - Loading node environment variables. Building remotely on UBUNTU-JENKINS-UKLAB-NODE002 in workspace /var/jenkins/workspace/t_artifact_jnr_posix_issue Run condition [Execute Shell] enabling prebuild for step [Archive the artifacts] [t_artifact_jnr_posix_issue] $ /bin/sh -xe /tmp/CommandInterpreterCondition1191287595508755352.sh + touch test.txt Run condition [Execute Shell] enabling perform for step [Archive the artifacts] Archiving artifacts ERROR: Failed to archive artifacts: test.txt java.io.IOException: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: jnr/posix/POSIXHandler at hudson.FilePath.copyRecursiveTo(FilePath.java:2016) at jenkins.model.StandardArtifactManager.archive(StandardArtifactManager.java:57) at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:140) at org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.run(BuildStepRunner.java:110) at org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail.conditionalRun(BuildStepRunner.java:154) at org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:105) at org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder.perform(SingleConditionalBuilder.java:108) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:784) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:565) at hudson.model.Run.execute(Run.java:1670) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:231) Caused by: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: jnr/posix/POSIXHandler at hudson.remoting.Channel$3.adapt(Channel.java:755) at hudson.remoting.Channel$3.adapt(Channel.java:750) at hudson.remoting.FutureAdapter.get(FutureAdapter.java:55) at hudson.FilePath.copyRecursiveTo(FilePath.java:2014) ... 15 more Caused by: java.lang.NoClassDefFoundError: jnr/posix/POSIXHandler at hudson.util.IOUtils.mode(IOUtils.java:125) at hudson.util.io.TarArchiver.visit(TarArchiver.java:101) at hudson.util.DirScanner.scanSingle(DirScanner.java:49) at hudson.FilePath$ExplicitlySpecifiedDirScanner.scan(FilePath.java:2540) at hudson.FilePath.writeToTar(FilePath.java:2052) at hudson.FilePath.access$1000(FilePath.java:172) at hudson.FilePath$41.invoke(FilePath.java:1993) at hudson.FilePath$41.invoke(FilePath.java:1989) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2461) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:328) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) 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 hudson.remoting.Engine$1$1.run(Engine.java:63) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.ClassNotFoundException: jnr.posix.POSIXHandler (WebAppClassLoader=Jenkins v1.548@1dd49247 did not find class file) at hudson.remoting.RemoteClassLoader$ClassLoaderProxy.fetch2(RemoteClassLoader.java:727) at hudson.remoting.RemoteClassLoader$ClassLoaderProxy.fetch4(RemoteClassLoader.java:777) at hudson.remoting.RemoteClassLoader$ClassLoaderProxy.fetch3(RemoteClassLoader.java:784) at sun.reflect.GeneratedMethodAccessor5170.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:299) at hudson.remoting.Request$2.run(Request.java:328) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Build step 'Conditional step (single)' changed build result to FAILURE Notifying upstream projects of job completion Finished: FAILURE

          Daniel Beck added a comment -

          Are there other exceptions earlier in the (system-wide or slave) log that indicate a failure to cache/load jar files on the slave?

          Daniel Beck added a comment - Are there other exceptions earlier in the (system-wide or slave) log that indicate a failure to cache/load jar files on the slave?

          Pascal Grippi added a comment - - edited

          Hi,
          The slave log shows nothing.

          Here the complete log:

          JNLP agent connected from /10.21.141.96
          <===[JENKINS REMOTING CAPACITY]===>Slave.jar version: 2.41
          This is a Unix slave
          The following triggers are available for your jobs
          [Trigger] - Build periodically
          [Trigger] - Build when another project is promoted
          [Trigger] - Poll SCM
          [Trigger] - [BuildResultTrigger] - Monitor build results of other jobs
          [Trigger] - [FSTrigger] - Monitor files
          [Trigger] - [FSTrigger] - Monitor folder
          [Trigger] - [IvyTrigger] - Poll with an Ivy script
          [Trigger] - [ScriptTrigger] - Poll with a Groovy script
          [Trigger] - [ScriptTrigger] - Poll with a shell or batch script
          [Trigger] - [URLTrigger] - Poll with a URL
          Slave successfully connected and online

          Master side I have only the log I paste in my previous post. No more unfortunately.

          Pascal

          Pascal Grippi added a comment - - edited Hi, The slave log shows nothing. Here the complete log: JNLP agent connected from /10.21.141.96 <=== [JENKINS REMOTING CAPACITY] ===>Slave.jar version: 2.41 This is a Unix slave The following triggers are available for your jobs [Trigger] - Build periodically [Trigger] - Build when another project is promoted [Trigger] - Poll SCM [Trigger] - [BuildResultTrigger] - Monitor build results of other jobs [Trigger] - [FSTrigger] - Monitor files [Trigger] - [FSTrigger] - Monitor folder [Trigger] - [IvyTrigger] - Poll with an Ivy script [Trigger] - [ScriptTrigger] - Poll with a Groovy script [Trigger] - [ScriptTrigger] - Poll with a shell or batch script [Trigger] - [URLTrigger] - Poll with a URL Slave successfully connected and online Master side I have only the log I paste in my previous post. No more unfortunately. Pascal

          Oleg Nenashev added a comment -

          IIUC it has been fixed by Java upgrades and JNR logic removal in JENKINS-36088 (CC dnusbaum)

          Oleg Nenashev added a comment - IIUC it has been fixed by Java upgrades and JNR logic removal in  JENKINS-36088 (CC dnusbaum )

          Devin Nusbaum added a comment -

          The failures here happened during IOUtils#mode:

          Caused by: java.lang.NoClassDefFoundError: jnr/posix/POSIXHandler
          	at hudson.util.IOUtils.mode(IOUtils.java:125)
          

          After my changes this code does not use JNR by default in Jenkins 2.93 and newer, but JNA/JNR can still be enabled if desired, see here. Unless anyone has a stack trace from 2.93 or newer then I think it should be fine to close this, as it seems to be specific to JNR.

          Devin Nusbaum added a comment - The failures here happened during IOUtils#mode : Caused by: java.lang.NoClassDefFoundError: jnr/posix/POSIXHandler at hudson.util.IOUtils.mode(IOUtils.java:125) After my changes this code does not use JNR by default in Jenkins 2.93 and newer, but JNA/JNR can still be enabled if desired, see here . Unless anyone has a stack trace from 2.93 or newer then I think it should be fine to close this, as it seems to be specific to JNR.

            Unassigned Unassigned
            petere Peter Eisentraut
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: