amd64java.lang.ClassCastException: hudson.model.Hudson cannot be cast to hudson.model.Slave

Jenkins JIRA | sudhir pandey | 3 years ago
  1. 0

    We have couple of slaves machines thats added by cmd line api using an xml file. but when we try to delete those slaves jenkins master usability breaks and we have to restart the jenkins process in master to make it again. The command line output when trying to delete a slave via command line java -jar jenkins-cli.jar -s http://server/ delete-node buildslave1-ubuntu-12-04-amd64java.lang.ClassCastException: hudson.model.Hudson cannot be cast to hudson.model.Slave at hudson.slaves.SlaveComputer.grabLauncher(SlaveComputer.java:687) at hudson.slaves.SlaveComputer.setNode(SlaveComputer.java:661) at hudson.model.AbstractCIBase.updateComputer(AbstractCIBase.java:118) at hudson.model.AbstractCIBase.updateComputerList(AbstractCIBase.java:175) at jenkins.model.Jenkins.updateComputerList(Jenkins.java:1219) at jenkins.model.Jenkins.setNodes(Jenkins.java:1715) at jenkins.model.Jenkins.removeNode(Jenkins.java:1710) at hudson.model.Computer.doDoDelete(Computer.java:1257) 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:616) at hudson.cli.declarative.MethodBinder.call(MethodBinder.java:102) at hudson.cli.declarative.CLIRegisterer$1.main(CLIRegisterer.java:168) at hudson.cli.CliManagerImpl.main(CliManagerImpl.java:92) at sun.reflect.GeneratedMethodAccessor175.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.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:280) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:239) 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:1146) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:679) And here is the server log seen after firing a node deletion command from command line or trying to delete the node from jenkins Web UI. Constant stream of Oct 25, 2013 12:54:15 PM hudson.triggers.SafeTimerTask run SEVERE: Timer task hudson.model.Queue$MaintainTask@5eb17728 failed java.lang.ClassCastException: hudson.model.Hudson cannot be cast to hudson.model.Slave at hudson.slaves.SlaveComputer.getNode(SlaveComputer.java:181) at hudson.slaves.SlaveComputer.getNode(SlaveComputer.java:96) at jenkins.model.Jenkins$9.compare(Jenkins.java:1546) at jenkins.model.Jenkins$9.compare(Jenkins.java:1542) at java.util.Arrays.mergeSort(Arrays.java:1283) at java.util.Arrays.mergeSort(Arrays.java:1294) at java.util.Arrays.sort(Arrays.java:1223) at jenkins.model.Jenkins.getComputers(Jenkins.java:1542) at hudson.model.Queue.maintain(Queue.java:978) at hudson.model.Queue$MaintainTask.doRun(Queue.java:1998) at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:54) at java.util.TimerThread.mainLoop(Timer.java:534) at java.util.TimerThread.run(Timer.java:484) And attached is the snap shot of jenkins UI when server starts to log those error. and its completely unusable, the only way to get back the working web ui is to restart the jenkins service.

    Jenkins JIRA | 3 years ago | sudhir pandey
    amd64java.lang.ClassCastException: hudson.model.Hudson cannot be cast to hudson.model.Slave
  2. 0

    We have couple of slaves machines thats added by cmd line api using an xml file. but when we try to delete those slaves jenkins master usability breaks and we have to restart the jenkins process in master to make it again. The command line output when trying to delete a slave via command line java -jar jenkins-cli.jar -s http://server/ delete-node buildslave1-ubuntu-12-04-amd64java.lang.ClassCastException: hudson.model.Hudson cannot be cast to hudson.model.Slave at hudson.slaves.SlaveComputer.grabLauncher(SlaveComputer.java:687) at hudson.slaves.SlaveComputer.setNode(SlaveComputer.java:661) at hudson.model.AbstractCIBase.updateComputer(AbstractCIBase.java:118) at hudson.model.AbstractCIBase.updateComputerList(AbstractCIBase.java:175) at jenkins.model.Jenkins.updateComputerList(Jenkins.java:1219) at jenkins.model.Jenkins.setNodes(Jenkins.java:1715) at jenkins.model.Jenkins.removeNode(Jenkins.java:1710) at hudson.model.Computer.doDoDelete(Computer.java:1257) 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:616) at hudson.cli.declarative.MethodBinder.call(MethodBinder.java:102) at hudson.cli.declarative.CLIRegisterer$1.main(CLIRegisterer.java:168) at hudson.cli.CliManagerImpl.main(CliManagerImpl.java:92) at sun.reflect.GeneratedMethodAccessor175.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.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:280) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:239) 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:1146) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:679) And here is the server log seen after firing a node deletion command from command line or trying to delete the node from jenkins Web UI. Constant stream of Oct 25, 2013 12:54:15 PM hudson.triggers.SafeTimerTask run SEVERE: Timer task hudson.model.Queue$MaintainTask@5eb17728 failed java.lang.ClassCastException: hudson.model.Hudson cannot be cast to hudson.model.Slave at hudson.slaves.SlaveComputer.getNode(SlaveComputer.java:181) at hudson.slaves.SlaveComputer.getNode(SlaveComputer.java:96) at jenkins.model.Jenkins$9.compare(Jenkins.java:1546) at jenkins.model.Jenkins$9.compare(Jenkins.java:1542) at java.util.Arrays.mergeSort(Arrays.java:1283) at java.util.Arrays.mergeSort(Arrays.java:1294) at java.util.Arrays.sort(Arrays.java:1223) at jenkins.model.Jenkins.getComputers(Jenkins.java:1542) at hudson.model.Queue.maintain(Queue.java:978) at hudson.model.Queue$MaintainTask.doRun(Queue.java:1998) at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:54) at java.util.TimerThread.mainLoop(Timer.java:534) at java.util.TimerThread.run(Timer.java:484) And attached is the snap shot of jenkins UI when server starts to log those error. and its completely unusable, the only way to get back the working web ui is to restart the jenkins service.

    Jenkins JIRA | 3 years ago | sudhir pandey
    amd64java.lang.ClassCastException: hudson.model.Hudson cannot be cast to hudson.model.Slave

    Root Cause Analysis

    1. amd64java.lang.ClassCastException

      hudson.model.Hudson cannot be cast to hudson.model.Slave

      at hudson.slaves.SlaveComputer.grabLauncher()
    2. Hudson
      AbstractCIBase.updateComputerList
      1. hudson.slaves.SlaveComputer.grabLauncher(SlaveComputer.java:687)
      2. hudson.slaves.SlaveComputer.setNode(SlaveComputer.java:661)
      3. hudson.model.AbstractCIBase.updateComputer(AbstractCIBase.java:118)
      4. hudson.model.AbstractCIBase.updateComputerList(AbstractCIBase.java:175)
      4 frames
    3. jenkins.model
      Jenkins.removeNode
      1. jenkins.model.Jenkins.updateComputerList(Jenkins.java:1219)
      2. jenkins.model.Jenkins.setNodes(Jenkins.java:1715)
      3. jenkins.model.Jenkins.removeNode(Jenkins.java:1710)
      3 frames
    4. Hudson
      Computer.doDoDelete
      1. hudson.model.Computer.doDoDelete(Computer.java:1257)
      1 frame
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:616)
      4 frames
    6. Hudson
      CliManagerImpl.main
      1. hudson.cli.declarative.MethodBinder.call(MethodBinder.java:102)
      2. hudson.cli.declarative.CLIRegisterer$1.main(CLIRegisterer.java:168)
      3. hudson.cli.CliManagerImpl.main(CliManagerImpl.java:92)
      3 frames
    7. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor175.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      3. java.lang.reflect.Method.invoke(Method.java:616)
      3 frames
    8. Hudson :: Remoting Layer
      InterceptingExecutorService$1.call
      1. hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:299)
      2. hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:280)
      3. hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:239)
      4. hudson.remoting.UserRequest.perform(UserRequest.java:118)
      5. hudson.remoting.UserRequest.perform(UserRequest.java:48)
      6. hudson.remoting.Request$2.run(Request.java:326)
      7. hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      7 frames
    9. Hudson
      CliManagerImpl$1.call
      1. hudson.cli.CliManagerImpl$1.call(CliManagerImpl.java:63)
      1 frame
    10. Hudson :: Remoting Layer
      InterceptingExecutorService$2.call
      1. hudson.remoting.InterceptingExecutorService$2.call(InterceptingExecutorService.java:95)
      1 frame
    11. Java RT
      Thread.run
      1. java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      2. java.util.concurrent.FutureTask.run(FutureTask.java:166)
      3. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      5. java.lang.Thread.run(Thread.java:679)
      5 frames