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

Jenkins CLI hangs with InvocationTargetException

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Component/s: cli
    • Labels:
    • Environment:
      Jenkins ver. 1.565.1
      Java build 1.7.0_55-b13
    • Similar Issues:

      Description

      CLI commands hangs with no console output but following Exception in Jenkins.err.log:

      >> java -jar jenkins-cli.jar -s http://ciserver:8080/ help
      _

      Aug 22, 2014 6:47:11 AM hudson.TcpSlaveAgentListener$ConnectionHandler run
      INFO: Accepted connection #3 from /192.168.1.200:58954
      Exception in thread "TCP slave agent connection handler #3 with /192.168.1.200:58954" java.lang.Error: java.lang.reflect.InvocationTargetException
              at hudson.cli.CliProtocol2$Handler2.run(CliProtocol2.java:76)
              at hudson.cli.CliProtocol2.handle(CliProtocol2.java:32)
              at hudson.TcpSlaveAgentListener$ConnectionHandler.run(TcpSlaveAgentListener.java:157)
      Caused by: java.lang.reflect.InvocationTargetException
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.lang.reflect.Method.invoke(Unknown Source)
              at hudson.cli.CliProtocol2$Handler2.run(CliProtocol2.java:63)
              ... 2 more
      Caused by: java.lang.NullPointerException
              at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.get(InstanceIdentity.java:126)
              ... 7 more
      

        Attachments

          Activity

          Hide
          brennx0r Brenna Flood added a comment -

          I experienced this issue. My setup:

          Jenkins 2.7.4 - 2.11.11
          Docker - CentOS 6.8
          JDK 1.8.111
          No security setup (this is a test instance - chef + kitchen)

          The cause of the behavior in my case was that the identity file in the Jenkins root could not be loaded. To correct the issue, I simply removed the file and restarted the Jenkins service.

          Show
          brennx0r Brenna Flood added a comment - I experienced this issue. My setup: Jenkins 2.7.4 - 2.11.11 Docker - CentOS 6.8 JDK 1.8.111 No security setup (this is a test instance - chef + kitchen) The cause of the behavior in my case was that the identity file in the Jenkins root could not be loaded. To correct the issue, I simply removed the file and restarted the Jenkins service.
          Hide
          v2v Victor Martinez added a comment -

          It works after upgrading to the latest version: 2.19.1 and the below plugins:

          • credentials = '2.1.0'
          • ssh_credentials = '1.12'
          • build_pipeline_plugin = '1.4.4'
          • findbugs = '4.62'
          • jquery = '1.11.2-0'
          • token_macro = '1.12.1'

          Cheers

          Show
          v2v Victor Martinez added a comment - It works after upgrading to the latest version: 2.19.1 and the below plugins: credentials = '2.1.0' ssh_credentials = '1.12' build_pipeline_plugin = '1.4.4' findbugs = '4.62' jquery = '1.11.2-0' token_macro = '1.12.1' Cheers
          Hide
          v2v Victor Martinez added a comment -

          Hi there,

          Unfortunately I've just seen this issue with the previous LTS release:

          • jenkins version: 2.7.4
          • Java: 1.7.0_111
          command
          $ telnet 127.0.0.1 8080
          Trying 127.0.0.1...
          Connected to 127.0.0.1.
          Escape character is '^]'.
          ^Connection closed by foreign host.
          
          $ java -jar /usr/share/jenkins/jenkins-cli.jar -s http://127.0.0.1:8080 help
          
          jenkins.log
          Oct 13, 2016 2:25:08 PM hudson.TcpSlaveAgentListener$ConnectionHandler run
          INFO: Accepted connection #4 from /127.0.0.1:46816
          Oct 13, 2016 2:25:08 PM hudson.init.impl.InstallUncaughtExceptionHandler$DefaultUncaughtExceptionHandler uncaughtException
          SEVERE: A thread (TCP agent connection handler #4 with /127.0.0.1:46816/1601) died unexpectedly due to an uncaught exception, this may leave your Jenkins in a bad way and is usually indicative of a bug in the code.
          java.lang.Error: java.lang.reflect.InvocationTargetException
          	at hudson.cli.CliProtocol2$Handler2.run(CliProtocol2.java:74)
          	at hudson.cli.CliProtocol2.handle(CliProtocol2.java:33)
          	at hudson.TcpSlaveAgentListener$ConnectionHandler.run(TcpSlaveAgentListener.java:182)
          Caused by: java.lang.reflect.InvocationTargetException
          	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.cli.CliProtocol2$Handler2.run(CliProtocol2.java:65)
          	... 2 more
          Caused by: java.lang.NullPointerException
          	at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.get(InstanceIdentity.java:152)
          	... 7 more
          

          I'll double check whether with the latest release 2.19.X works fine

          Show
          v2v Victor Martinez added a comment - Hi there, Unfortunately I've just seen this issue with the previous LTS release: jenkins version: 2.7.4 Java: 1.7.0_111 command $ telnet 127.0.0.1 8080 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]' . ^Connection closed by foreign host. $ java -jar /usr/share/jenkins/jenkins-cli.jar -s http: //127.0.0.1:8080 help jenkins.log Oct 13, 2016 2:25:08 PM hudson.TcpSlaveAgentListener$ConnectionHandler run INFO: Accepted connection #4 from /127.0.0.1:46816 Oct 13, 2016 2:25:08 PM hudson.init.impl.InstallUncaughtExceptionHandler$DefaultUncaughtExceptionHandler uncaughtException SEVERE: A thread (TCP agent connection handler #4 with /127.0.0.1:46816/1601) died unexpectedly due to an uncaught exception, this may leave your Jenkins in a bad way and is usually indicative of a bug in the code. java.lang.Error: java.lang.reflect.InvocationTargetException at hudson.cli.CliProtocol2$Handler2.run(CliProtocol2.java:74) at hudson.cli.CliProtocol2.handle(CliProtocol2.java:33) at hudson.TcpSlaveAgentListener$ConnectionHandler.run(TcpSlaveAgentListener.java:182) Caused by: java.lang.reflect.InvocationTargetException 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.cli.CliProtocol2$Handler2.run(CliProtocol2.java:65) ... 2 more Caused by: java.lang.NullPointerException at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.get(InstanceIdentity.java:152) ... 7 more I'll double check whether with the latest release 2.19.X works fine
          Hide
          danielbeck Daniel Beck added a comment -

          1.565.x has been out of community support for over a year. For this issue to be relevant, needs to happen with a recent release (1.609.x preferably, 1.596.x if absolutely necessary).

          If the identify file gets corrupted while Jenkins is running, consider making it readonly for the user Jenkins is running as to see what fails to work because of that.

          Show
          danielbeck Daniel Beck added a comment - 1.565.x has been out of community support for over a year. For this issue to be relevant, needs to happen with a recent release (1.609.x preferably, 1.596.x if absolutely necessary). If the identify file gets corrupted while Jenkins is running, consider making it readonly for the user Jenkins is running as to see what fails to work because of that.
          Hide
          saar_netzer Saar Netzer added a comment - - edited

          This issue is happening now again.
          When running jenkins_cli command it hangs.
          Every couple of days the identity file is getting corrupted.
          Moving it and restarting Jenkins resolving the problem as a new identity file is created.
          This happen when Jenkins is running and not on shutdown/restart of the platform.
          Jenkins Version 1.565.3
          Java build 1.7.0_75-b13

          Show
          saar_netzer Saar Netzer added a comment - - edited This issue is happening now again. When running jenkins_cli command it hangs. Every couple of days the identity file is getting corrupted. Moving it and restarting Jenkins resolving the problem as a new identity file is created. This happen when Jenkins is running and not on shutdown/restart of the platform. Jenkins Version 1.565.3 Java build 1.7.0_75-b13

            People

            • Assignee:
              saar_netzer Saar Netzer
              Reporter:
              rimar Marcel Richter
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: