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

java not found starting the slave if java is installed with a user-data/cloud-init manifest

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • ec2-plugin
    • None
    • See attached about.md

      Jenkins Core 1.609.1.1 (CloudBees Jenkins Enterprise 15.05)
      ec2:1.28 'Amazon EC2 plugin'

      Jenkins can't find the `java` executable when java is installed through a CloudInit/CloudConfig manifest.

      After the failure, if I manually click on "relaunch slave", the slave starts successfully, the java executable is found.

      It seems that the slave does not wait for cloud-config to complete before trying to connect.

      User Data / Cloud Init / Cloud Config manifest

      #cloud-config
      repo_update: true
      repo_upgrade: all
      
      packages:
       - wget
       - git
       - openjdk-7-jdk
      

      Logs of the agent startup failure

      Node ubuntu-trusty (i-c453dd2d)(i-c453dd2d) is still pending/launching, waiting 5s
      Node ubuntu-trusty (i-c453dd2d)(i-c453dd2d) is still pending/launching, waiting 5s
      Node ubuntu-trusty (i-c453dd2d)(i-c453dd2d) is still pending/launching, waiting 5s
      Node ubuntu-trusty (i-c453dd2d)(i-c453dd2d) is still pending/launching, waiting 5s
      Node ubuntu-trusty (i-c453dd2d)(i-c453dd2d) is still pending/launching, waiting 5s
      Node ubuntu-trusty (i-c453dd2d)(i-c453dd2d) is ready
      Connecting to ec2-54-237-100-245.compute-1.amazonaws.com on port 22, with timeout 10000.
      Failed to connect via ssh: The kexTimeout (10000 ms) expired.
      Waiting for SSH to come up. Sleeping 5.
      Connecting to ec2-54-237-100-245.compute-1.amazonaws.com on port 22, with timeout 10000.
      Failed to connect via ssh: The connect() operation on the socket timed out.
      Waiting for SSH to come up. Sleeping 5.
      Connecting to ec2-54-237-100-245.compute-1.amazonaws.com on port 22, with timeout 10000.
      Failed to connect via ssh: The connect() operation on the socket timed out.
      Waiting for SSH to come up. Sleeping 5.
      Connecting to ec2-54-237-100-245.compute-1.amazonaws.com on port 22, with timeout 10000.
      Failed to connect via ssh: There was a problem while connecting to ec2-54-237-100-245.compute-1.amazonaws.com:22
      Waiting for SSH to come up. Sleeping 5.
      Connecting to ec2-54-237-100-245.compute-1.amazonaws.com on port 22, with timeout 10000.
      Failed to connect via ssh: There was a problem while connecting to ec2-54-237-100-245.compute-1.amazonaws.com:22
      Waiting for SSH to come up. Sleeping 5.
      Connecting to ec2-54-237-100-245.compute-1.amazonaws.com on port 22, with timeout 10000.
      Connected via SSH.
      bootstrap()
      Getting keypair...
      Using key: cleclerc-us-east
      33:8d:c3:68:43:c6:00:07:20:92:57:0c:ce:2e:f2:25:98:c6:53:f6
      -----BEGIN RSA PRIVATE KEY-----
      MIIEpAIBAAKCAQEAtNJ+5CR+EyA8SFvBZNJBo3P+8hgAs3Z/NDEdA5uRUyQSGWry8kYJLbLkK0KH
      m99SHFOsldQTDkfcgqlBYmUomDVSC1Q9LA/AAPDafcob9QKSq8P
      Authenticating as ubuntu
      take over connection
      Creating tmp directory (/tmp) if it does not exist
      Verifying that java exists
      bash: java: command not found
      Installing Java
      https://s3.amazonaws.com/hudson-ci/jdk/linux-i586/java1.6.0_12.tgz/KlWWh2TImVebK1Nr69NEP0O6Xge/5vNE7iVMF/hg?AWSAccessKeyId=AKIAIWF7HUOPPN3GMN7A&Expires=1437999543&Signature=jRYqmpdYHXYL7C7vgLfJE0ORsJY%3D:
      2015-07-27 11:19:03 ERROR 403: Forbidden.
      Failed to download Java
      

      Logs of the successful manual startup

      Node ubuntu-trusty (i-c453dd2d)(i-c453dd2d) is ready
      Connecting to ec2-54-237-100-245.compute-1.amazonaws.com on port 22, with timeout 10000.
      Connected via SSH.
      bootstrap()
      Getting keypair...
      Using key: cleclerc-us-east
      33:8d:c3:68:43:c6:00:07:20:92:57:0c:ce:2e:f2:25:98:c6:53:f6
      -----BEGIN RSA PRIVATE KEY-----
      MIIEpAIBAAKCAQEAtNJ+5CR+EyA8SFvBZNJBo3P+8hgAs3Z/NDEdA5uRUyQSGWry8kYJLbLkK0KH
      m99SHFOsldQTDkfcgqlBYmUomDVSC1Q9LA/AAPDafcob9QKSq8P
      Authenticating as ubuntu
      take over connection
      Creating tmp directory (/tmp) if it does not exist
      Verifying that java exists
      java full version "1.7.0_79-b14"
      Copying slave.jar
      Launching slave agent (via Trilead SSH2 Connection): java  -jar /tmp/slave.jar
      <===[JENKINS REMOTING CAPACITY]===>Slave.jar version: 2.50
      This is a Unix slave
      Evacuated stdout
      Slave successfully connected and online
      

        1. about.md
          8 kB
        2. config.xml
          4 kB

            francisu Francis Upton
            cleclerc Cyrille Le Clerc
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: