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

File Leak Detector plugin breaks CLI interface

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      jenkins-1.480.1
      Linux, Oracle jdk1.7.0_11, headless mode enabled
    • Similar Issues:

      Description

      After activation of the File Leak Detector Plugin via the 'activate' button, the Jenkins CLI stops working:

      $ java -jar jenkins-cli.jar -s http://myjenkins:8080 help
      Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
      at $Proxy2.main(Unknown Source)
      at hudson.cli.CLI.execute(CLI.java:322)
      at hudson.cli.CLI._main(CLI.java:468)
      at hudson.cli.CLI.main(CLI.java:373)
      Caused by: java.io.IOException: Remote call on CLI connection to http://myjenkins:8080 failed
      at hudson.remoting.Channel.call(Channel.java:673)
      at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:158)
      ... 4 more
      Caused by: java.lang.IllegalAccessError: org/kohsuke/args4j/CmdLineParser$1
      at org.kohsuke.args4j.CmdLineParser.<init>(CmdLineParser.java:94)
      at hudson.cli.CLICommand.main(CLICommand.java:211)
      at hudson.cli.CliManagerImpl.main(CliManagerImpl.java:92)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:275)
      at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:256)
      at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:215)
      at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      at hudson.remoting.Request$2.run(Request.java:326)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      at hudson.cli.CliManagerImpl$1.call(CliManagerImpl.java:63)
      at hudson.remoting.InterceptingExecutorService$2.call(InterceptingExecutorService.java:95)
      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:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)

      The corresponding line in args4j::CmdLineParser.java is

      Collections.sort(options, new Comparator<OptionHandler>() {
      public int compare(OptionHandler o1, OptionHandler o2)

      { return o1.option.toString().compareTo(o2.option.toString()); }

      });

      Please have a look - the plugin is really useful, but the CLI is essential.

      PS
      I tried to file this issue against the 'file-leak-detector' component, but that doesn't exist. Please forward as appropriate.

        Attachments

          Activity

          Hide
          mabahj Markus added a comment -

          We seem to be getting the same message on Jenkins ver. 1.509.2 after enabling File Leak Detector.

          [bash|jenkins|~/bin]$ java -jar jenkins-cli.jar -s http://jenkins:8080/ help
          Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
          at $Proxy2.main(Unknown Source)
          at hudson.cli.CLI.execute(CLI.java:333)
          at hudson.cli.CLI._main(CLI.java:499)
          at hudson.cli.CLI.main(CLI.java:384)
          Caused by: java.io.IOException: Remote call on CLI connection to http://jenkins.nordicsemi.no:8080/ failed
          at hudson.remoting.Channel.call(Channel.java:681)
          at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:158)
          ... 4 more
          Caused by: java.lang.IllegalAccessError: org/kohsuke/args4j/CmdLineParser$1
          at org.kohsuke.args4j.CmdLineParser.<init>(CmdLineParser.java:94)
          at hudson.cli.CLICommand.main(CLICommand.java:211)
          at hudson.cli.CliManagerImpl.main(CliManagerImpl.java:92)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:606)
          at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:275)
          at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:256)
          at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:215)
          at hudson.remoting.UserRequest.perform(UserRequest.java:118)
          at hudson.remoting.UserRequest.perform(UserRequest.java:48)
          at hudson.remoting.Request$2.run(Request.java:326)
          at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
          at hudson.cli.CliManagerImpl$1.call(CliManagerImpl.java:63)
          at hudson.remoting.InterceptingExecutorService$2.call(InterceptingExecutorService.java:95)
          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:1145)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at java.lang.Thread.run(Thread.java:724)
          
          Show
          mabahj Markus added a comment - We seem to be getting the same message on Jenkins ver. 1.509.2 after enabling File Leak Detector. [bash|jenkins|~/bin]$ java -jar jenkins-cli.jar -s http://jenkins:8080/ help Exception in thread "main" java.lang.reflect.UndeclaredThrowableException at $Proxy2.main(Unknown Source) at hudson.cli.CLI.execute(CLI.java:333) at hudson.cli.CLI._main(CLI.java:499) at hudson.cli.CLI.main(CLI.java:384) Caused by: java.io.IOException: Remote call on CLI connection to http://jenkins.nordicsemi.no:8080/ failed at hudson.remoting.Channel.call(Channel.java:681) at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:158) ... 4 more Caused by: java.lang.IllegalAccessError: org/kohsuke/args4j/CmdLineParser$1 at org.kohsuke.args4j.CmdLineParser.<init>(CmdLineParser.java:94) at hudson.cli.CLICommand.main(CLICommand.java:211) at hudson.cli.CliManagerImpl.main(CliManagerImpl.java:92) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:275) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:256) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:215) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at hudson.cli.CliManagerImpl$1.call(CliManagerImpl.java:63) at hudson.remoting.InterceptingExecutorService$2.call(InterceptingExecutorService.java:95) 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:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:724)
          Hide
          jglick Jesse Glick added a comment -

          I suspect the problem is that org.kohsuke:file-leak-detector assembles (jar-with-dependencies) args4j:args4j, which gets injected into the (boot?) classpath when the Java agent is loaded, and that clashes with the version bundled in jenkins-core.jar!/WEB-INF/lib/.

          Show
          jglick Jesse Glick added a comment - I suspect the problem is that org.kohsuke:file-leak-detector assembles ( jar-with-dependencies ) args4j:args4j , which gets injected into the (boot?) classpath when the Java agent is loaded, and that clashes with the version bundled in jenkins-core.jar!/WEB-INF/lib/ .
          Hide
          jglick Jesse Glick added a comment -

          Workaround: run some CLI command (such as help) before activating the detector.

          Show
          jglick Jesse Glick added a comment - Workaround: run some CLI command (such as help ) before activating the detector.
          Show
          jglick Jesse Glick added a comment - https://github.com/kohsuke/file-leak-detector/pull/6 and https://github.com/jenkinsci/file-leak-detector-plugin/pull/1 should fix this.
          Hide
          mabahj Markus added a comment -

          I can confirm that the workaround makes it possible for us to run CLI commands while the File Leak Detector is active.

          Show
          mabahj Markus added a comment - I can confirm that the workaround makes it possible for us to run CLI commands while the File Leak Detector is active.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jesse Glick
          Path:
          pom.xml
          http://jenkins-ci.org/commit/file-leak-detector-plugin/a3d5e17f074a9726bb0cb68ece8d20663e652661
          Log:
          [FIXED JENKINS-16544] Use Shade plugin to avoid breaking Jenkins CLI.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml http://jenkins-ci.org/commit/file-leak-detector-plugin/a3d5e17f074a9726bb0cb68ece8d20663e652661 Log: [FIXED JENKINS-16544] Use Shade plugin to avoid breaking Jenkins CLI.

            People

            Assignee:
            jglick Jesse Glick
            Reporter:
            arost Alexander Ost
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: