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

Null pointer exception launching slave, after changing cloud name.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: ec2-plugin
    • Labels:
      None
    • Environment:
    • Similar Issues:

      Description

      I changed the name of my cloud from `dev-ec2` to `ec2` (though JCasC, but I don''t think it matters).

      After this change I got:
      ```
      Oct 13, 2020 9:31:16 AM SEVERE hudson.triggers.SafeTimerTask run

      Timer task hudson.slaves.ComputerRetentionWork@7066e107 failed
      java.lang.NullPointerException
      at hudson.plugins.ec2.EC2Computer.getSlaveTemplate(EC2Computer.java:86)
      at hudson.plugins.ec2.EC2RetentionStrategy.internalCheck(EC2RetentionStrategy.java:130)
      at hudson.plugins.ec2.EC2RetentionStrategy.check(EC2RetentionStrategy.java:107)
      at hudson.plugins.ec2.EC2RetentionStrategy.check(EC2RetentionStrategy.java:52)
      at hudson.slaves.ComputerRetentionWork$1.run(ComputerRetentionWork.java:70)
      at hudson.model.Queue._withLock(Queue.java:1398)
      at hudson.model.Queue.withLock(Queue.java:1275)
      at hudson.slaves.ComputerRetentionWork.doRun(ComputerRetentionWork.java:61)
      at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:91)
      at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
      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)
      ```

      When the plugin was tryng to launch new nodes.

      I fixed it by changing the EC2 name back - but it took a long time to find this as the error is when trying to get spot instance. I only did this after finding the source code:
      https://github.com/jenkinsci/ec2-plugin/blob/master/src/main/java/hudson/plugins/ec2/EC2SpotSlave.java#L137
      (and guessing that `getCloud()` (might be returning a null value).

      this might be related to:
      https://issues.jenkins-ci.org/browse/JENKINS-46856
      https://issues.jenkins-ci.org/browse/JENKINS-60258
      They have similar errors, but there were no actionable resolutions in them (for me at least).

        Attachments

          Activity

          Hide
          canuck1987 Tim Brown added a comment - - edited

          I am seeing the same behaviour when I change the cloud name through the UI.

          Repo steps:

          • Add EC2 Cloud and node.
          • Launch node (to ensure this is configured correctly).
          • Change EC2 Node name (through UI should be fine).
          • Try launching another node.
            I see the node fails to launch and I get a callstack like above in the Jenkins logs.
          Show
          canuck1987 Tim Brown added a comment - - edited I am seeing the same behaviour when I change the cloud name through the UI. Repo steps: Add EC2 Cloud and node. Launch node (to ensure this is configured correctly). Change EC2 Node name (through UI should be fine). Try launching another node. I see the node fails to launch and I get a callstack like above in the Jenkins logs.

            People

            Assignee:
            thoulen FABRIZIO MANFREDI
            Reporter:
            canuck1987 Tim Brown
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: