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

Jenkins worker unable to start SPOT instance.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • ec2-plugin
    • None
    • Jenkins Version 2.147
      Jenkins Amazon EC2 Plugin version: 1.40.1, 1.41

      I have a problem running jenkins worker with SPOT instance with jenkins amazon EC2 plugin version 1.40.1. 

      Jenkins Amazon EC2 Plugin version 1.39 is working well 

      On-Demand instance with the same settings is starting well (1.40.1).

      log on demand:

      I have a problem running jenkins worker with SPOT instance with jenkins amazon EC2 plugin version 1.40.1. I have a problem running jenkins worker with SPOT instance with jenkins amazon EC2 plugin version 1.40.1 and 1.41

       
      Jenkins Amazon EC2 Plugin version 1.39 is working well 

      On-Demand instance with the same settings is starting well (1.40.1).
      log on demand:

      Oct 18, 2018 10:40:55 PM hudson.plugins.ec2.EC2Cloud
       INFO: Launching instance: i-0f79d897f46bcad22
       Oct 18, 2018 10:40:55 PM hudson.plugins.ec2.EC2Cloud
       INFO: bootstrap()
       Oct 18, 2018 10:40:55 PM hudson.plugins.ec2.EC2Cloud
       INFO: Getting keypair...
       Oct 18, 2018 10:40:55 PM hudson.plugins.ec2.EC2Cloud
       INFO: Using key: Jenkins
       25:9f:b6:d8:f9:e2:a7:d8:72:f4:37:b0:f6:d8:4d:0e
       -----BEGIN RSA PRIVATE KEY-----
       MIIEpAIBAAKCAQEAs2RqjBAQKnw8I7grFSlBx21Chh4U34dsn9QhX4HUqbNcFsaV
       d3FbnLaDpsYPjRbXfvapnaIOiTBvCquDiluzP4rww/SoDUg5XpiKih+wMBpgsZb
       Oct 18, 2018 10:40:55 PM hudson.plugins.ec2.EC2Cloud
       INFO: Authenticating as ubuntu
       Oct 18, 2018 10:40:55 PM hudson.plugins.ec2.EC2Cloud
       INFO: Connecting to 10.78.44.158 on port 22, with timeout 10000.
       Oct 18, 2018 10:41:05 PM hudson.plugins.ec2.EC2Cloud
       INFO: Failed to connect via ssh: The kexTimeout (10000 ms) expired.
       Oct 18, 2018 10:41:05 PM hudson.plugins.ec2.EC2Cloud
       INFO: Waiting for SSH to come up. Sleeping 5.
       Oct 18, 2018 10:41:10 PM hudson.plugins.ec2.EC2Cloud
       INFO: Connecting to 10.78.44.158 on port 22, with timeout 10000.
       Oct 18, 2018 10:41:20 PM hudson.plugins.ec2.EC2Cloud
       INFO: Failed to connect via ssh: The kexTimeout (10000 ms) expired.
      

       

      SPOT instance (1.40.1): 
      only changes: 

      set "Use spot instance"

      The current Spot price for a T2Large in the us-west-2a availability zone is $0.127

      Spot Max Bid Price: 0.2

      Log with spot instance:

       

      Oct 18, 2018 10:44:06 PM hudson.plugins.ec2.EC2Cloud
      INFO: Launching instance: null
      Oct 18, 2018 10:44:06 PM hudson.plugins.ec2.EC2Cloud
      INFO: bootstrap()
      Oct 18, 2018 10:44:06 PM hudson.plugins.ec2.EC2Cloud
      INFO: Getting keypair...
      Oct 18, 2018 10:44:06 PM hudson.plugins.ec2.EC2Cloud
      INFO: Using key: Jenkins
      25:9f:b6:d8:f9:e2:a7:d8:72:f4:37:b0:f6:d8:4d:0e
      -----BEGIN RSA PRIVATE KEY-----
      MIIEpAIBAAKCAQEAs2RqjBAQKnw8I7grFSlBx21Chh4U34dsn9QhX4HUqbNcFsaV
      d3FbnLaDpsYPjRbXfvapnaIOiTBvCquDiluzP4rww/SoDUg5XpiKih+wMBpgsZb
      Oct 18, 2018 10:44:06 PM hudson.plugins.ec2.EC2Cloud
      INFO: Authenticating as ubuntu
      ERROR: Unexpected error in launching an agent. This is probably a bug in Jenkins
      java.lang.NullPointerException
          at hudson.plugins.ec2.ssh.EC2UnixLauncher.getEC2HostAddress(EC2UnixLauncher.java:368)
          at hudson.plugins.ec2.ssh.EC2UnixLauncher.connectToSsh(EC2UnixLauncher.java:318)
          at hudson.plugins.ec2.ssh.EC2UnixLauncher.bootstrap(EC2UnixLauncher.java:282)
          at hudson.plugins.ec2.ssh.EC2UnixLauncher.launchScript(EC2UnixLauncher.java:130)
          at hudson.plugins.ec2.EC2ComputerLauncher.launch(EC2ComputerLauncher.java:48)
          at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:294)
          at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
          at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:71)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          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)
      

      tested on fresh install of jenkins and ec2 plugin,

       

            thoulen FABRIZIO MANFREDI
            aplsms Andrii Petrenko
            Votes:
            5 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: