[JIRA] [ec2-plugin] (JENKINS-29654) java not found starting the slave if java is installed with a user-data/cloud-init manifest

2 views
Skip to first unread message

cleclerc@cloudbees.com (JIRA)

unread,
Jul 27, 2015, 11:02:05 AM7/27/15
to jenkinsc...@googlegroups.com
Cyrille Le Clerc created an issue
 
Jenkins / Bug JENKINS-29654
java not found starting the slave if java is installed with a user-data/cloud-init manifest
Issue Type: Bug Bug
Assignee: Francis Upton
Attachments: about.md, config.xml
Components: ec2-plugin
Created: 27/Jul/15 3:01 PM
Environment: See attached about.md

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

Priority: Minor Minor
Reporter: Cyrille Le Clerc

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
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

jenkins-ci.org@meneguello.com (JIRA)

unread,
Jan 25, 2017, 12:53:02 PM1/25/17
to jenkinsc...@googlegroups.com
Bruno Meneguello commented on Bug JENKINS-29654
 
Re: java not found starting the slave if java is installed with a user-data/cloud-init manifest

Cloud-Init runs as service, but init script is run as soon ssh becomes available. You need something that waits the initialization to be completed. I suggest to check if /run/cloud-init/result.json exists then proceed.

This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

raihaan.shouhell@autodesk.com (JIRA)

unread,
Sep 2, 2019, 2:35:01 AM9/2/19
to jenkinsc...@googlegroups.com
Raihaan Shouhell closed an issue as Won't Fix
 

Java must be available when ssh is available. Users should modify their setups to reflect this

Change By: Raihaan Shouhell
Status: Open Closed
Resolution: Won't Fix
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)
Reply all
Reply to author
Forward
0 new messages