[JIRA] (JENKINS-59682) EC2 Plugin terminates windows instance right after connecting when using ssh.

0 views
Skip to first unread message

cimpoiesgeorge@gmail.com (JIRA)

unread,
Oct 7, 2019, 5:01:04 AM10/7/19
to jenkinsc...@googlegroups.com
George Cimpoies created an issue
 
Jenkins / Bug JENKINS-59682
EC2 Plugin terminates windows instance right after connecting when using ssh.
Issue Type: Bug Bug
Assignee: FABRIZIO MANFREDI
Attachments: Capture.PNG, Capture2.PNG, Capture3.PNG
Components: ec2-plugin
Created: 2019-10-07 09:00
Environment: EC2 Plugin 1.46.1
Jenkins 2.187
Priority: Blocker Blocker
Reporter: George Cimpoies
collapseBuild Executor Status
Oct 07, 2019 10:54:25 AM hudson.plugins.ec2.EC2Cloud
INFO: Launching instance: i-0b3686cd8938dd562
Oct 07, 2019 10:54:25 AM hudson.plugins.ec2.EC2Cloud
INFO: bootstrap()
Oct 07, 2019 10:54:25 AM hudson.plugins.ec2.EC2Cloud
INFO: Getting keypair...
Oct 07, 2019 10:54:25 AM hudson.plugins.ec2.EC2Cloud
INFO: Using private key jenkins-builder (SHA-1 fingerprint f3:b6:14:0d:dd:ef:5e:4a:30:e8:3e:47:6f:30:46:f4:b6:dc:8a:b0)
Oct 07, 2019 10:54:25 AM hudson.plugins.ec2.EC2Cloud
INFO: Authenticating as cluj
Oct 07, 2019 10:54:25 AM hudson.plugins.ec2.EC2Cloud
INFO: Connecting to 10.230.0.233 on port 22, with timeout 10000.
Oct 07, 2019 10:54:35 AM hudson.plugins.ec2.EC2Cloud
INFO: Failed to connect via ssh: The kexTimeout (10000 ms) expired.
Oct 07, 2019 10:54:35 AM hudson.plugins.ec2.EC2Cloud
INFO: Waiting for SSH to come up. Sleeping 5.
Oct 07, 2019 10:54:40 AM hudson.plugins.ec2.EC2Cloud
INFO: Connecting to 10.230.0.233 on port 22, with timeout 10000.
Oct 07, 2019 10:54:50 AM hudson.plugins.ec2.EC2Cloud
INFO: Failed to connect via ssh: The kexTimeout (10000 ms) expired.
Oct 07, 2019 10:54:50 AM hudson.plugins.ec2.EC2Cloud
INFO: Waiting for SSH to come up. Sleeping 5.
Oct 07, 2019 10:54:55 AM hudson.plugins.ec2.EC2Cloud
INFO: Connecting to 10.230.0.233 on port 22, with timeout 10000.
Oct 07, 2019 10:55:05 AM hudson.plugins.ec2.EC2Cloud
INFO: Failed to connect via ssh: The kexTimeout (10000 ms) expired.
Oct 07, 2019 10:55:05 AM hudson.plugins.ec2.EC2Cloud
INFO: Waiting for SSH to come up. Sleeping 5.
Oct 07, 2019 10:55:10 AM hudson.plugins.ec2.EC2Cloud
INFO: Connecting to 10.230.0.233 on port 22, with timeout 10000.
Oct 07, 2019 10:55:20 AM hudson.plugins.ec2.EC2Cloud
INFO: Failed to connect via ssh: The kexTimeout (10000 ms) expired.
Oct 07, 2019 10:55:20 AM hudson.plugins.ec2.EC2Cloud
INFO: Waiting for SSH to come up. Sleeping 5.
Oct 07, 2019 10:55:25 AM hudson.plugins.ec2.EC2Cloud
INFO: Connecting to 10.230.0.233 on port 22, with timeout 10000.
Oct 07, 2019 10:55:27 AM hudson.plugins.ec2.EC2Cloud
INFO: Connected via SSH.
Oct 07, 2019 10:55:27 AM hudson.plugins.ec2.EC2Cloud
INFO: connect fresh as root
Oct 07, 2019 10:55:28 AM hudson.plugins.ec2.EC2Cloud
INFO: Connecting to 10.230.0.233 on port 22, with timeout 10000.
Oct 07, 2019 10:55:28 AM hudson.plugins.ec2.EC2Cloud
INFO: Connected via SSH.
Oct 07, 2019 10:55:29 AM hudson.plugins.ec2.EC2Cloud
INFO: Creating tmp directory (/tmp) if it does not exist
The syntax of the command is incorrect.
Oct 07, 2019 10:55:29 AM hudson.plugins.ec2.EC2Cloud
INFO: Verifying: java -fullversion
java full version "1.8.0_131-b11"
Oct 07, 2019 10:55:31 AM hudson.plugins.ec2.EC2Cloud
INFO: Verifying: which scp
/usr/bin/scp
Oct 07, 2019 10:55:32 AM hudson.plugins.ec2.EC2Cloud
INFO: Copying remoting.jar to: /tmp
Oct 07, 2019 10:55:33 AM hudson.plugins.ec2.EC2Cloud
INFO: Launching remoting agent (via Trilead SSH2 Connection):  java  -jar /tmp/remoting.jar -workDir C:\Users\cluj
HTTP ERROR 404Problem accessing /computer/EC2%20(Itiviti%20AWS)%20-%20Windows%20Jenkins%20node%20autoconnecting%20to%20deb-jenkins-prd%20using%20Swarm%20plugin%20(i-0b3686cd8938dd562)/logText/progressiveHtml. Reason:    Not Found
Powered by Jetty:// 9.4.z-SNAPSHOT

When trying to set up the connection between AWS & Jenkins windows nodes via ssh, the node gets immediately terminated after connecting via ssh. Please find attached the Jenkins AWS Configuration.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

cimpoiesgeorge@gmail.com (JIRA)

unread,
Oct 7, 2019, 5:04:04 AM10/7/19
to jenkinsc...@googlegroups.com

cimpoiesgeorge@gmail.com (JIRA)

unread,
Oct 7, 2019, 5:04:04 AM10/7/19
to jenkinsc...@googlegroups.com

cimpoiesgeorge@gmail.com (JIRA)

unread,
Oct 7, 2019, 5:04:04 AM10/7/19
to jenkinsc...@googlegroups.com
George Cimpoies updated an issue
Change By: George Cimpoies
Attachment: Capture3.PNG
Attachment: Capture2.PNG
Attachment: Capture.PNG

cimpoiesgeorge@gmail.com (JIRA)

unread,
Oct 7, 2019, 5:04:04 AM10/7/19
to jenkinsc...@googlegroups.com

cimpoiesgeorge@gmail.com (JIRA)

unread,
Oct 7, 2019, 5:05:02 AM10/7/19
to jenkinsc...@googlegroups.com
George Cimpoies commented on Bug JENKINS-59682
 
Re: EC2 Plugin terminates windows instance right after connecting when using ssh.

According to https://issues.jenkins-ci.org/browse/JENKINS-58193 the issue was released in 1.44.2, but it is reproducible with version 1.46.1

cimpoiesgeorge@gmail.com (JIRA)

unread,
Oct 8, 2019, 1:00:05 AM10/8/19
to jenkinsc...@googlegroups.com
George Cimpoies updated an issue
Change By: George Cimpoies
{code:java}
{code}

When trying to set up the connection between AWS & Jenkins windows nodes via ssh, the node gets immediately terminated after connecting via ssh. Please find attached the Jenkins AWS Configuration.


 

 

*EDIT*

**I've downgraded to version 1.43 and the node is not terminated anymore, but I get:
{code:java}
INFO: Waiting for SSH to come up. Sleeping 5.INFO: Waiting for SSH to come up. Sleeping 5.Oct 08, 2019 6:55:11 AM hudson.plugins.ec2.EC2CloudINFO: Connecting to 10.230.0.193 on port 22, with timeout 10000.Oct 08, 2019 6:55:12 AM hudson.plugins.ec2.EC2CloudINFO: Connected via SSH.Oct 08, 2019 6:55:12 AM hudson.plugins.ec2.EC2CloudINFO: connect fresh as rootOct 08, 2019 6:55:12 AM hudson.plugins.ec2.EC2CloudINFO: Connecting to 10.230.0.193 on port 22, with timeout 10000.Oct 08, 2019 6:55:13 AM hudson.plugins.ec2.EC2CloudINFO: Connected via SSH.Oct 08, 2019 6:55:14 AM hudson.plugins.ec2.EC2CloudINFO: Creating tmp directory (/tmp) if it does not existThe syntax of the command is incorrect.Oct 08, 2019 6:55:14 AM hudson.plugins.ec2.EC2CloudINFO: Verifying: java -fullversionjava full version "1.8.0_131-b11"Oct 08, 2019 6:55:17 AM hudson.plugins.ec2.EC2CloudINFO: Verifying: which scp/usr/bin/scpOct 08, 2019 6:55:19 AM hudson.plugins.ec2.EC2CloudINFO: Copying slave.jar to: /tmpOct 08, 2019 6:55:20 AM hudson.plugins.ec2.EC2CloudINFO: Launching slave agent (via SSH client process): ssh -o StrictHostKeyChecking=no -i /tmp/ec2_527682778172280023.pem cl...@10.230.0.193 -p 22  java  -jar /tmp/slave.jar[10/08/19 06:55:20] Launching agent$ ssh -o StrictHostKeyChecking=no -i /tmp/ec2_527682778172280023.pem cl...@10.230.0.193 -p 22  java  -jar /tmp/slave.jarWarning: Permanently added '10.230.0.193' (ECDSA) to the list of known hosts.Error: Unable to access jarfile /tmp/slave.jarERROR: Unable to launch the agent for EC2 (Itiviti AWS) - AWS Windows Node (i-0d24e1b4cc97b791d)java.io.EOFException: unexpected stream termination at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:415) at hudson.remoting.ChannelBuilder.build(ChannelBuilder.java:360) at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:431) at hudson.slaves.CommandLauncher.launch(CommandLauncher.java:153) at hudson.plugins.ec2.ssh.EC2UnixLauncher.launchScript(EC2UnixLauncher.java:234) 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)ERROR: Process terminated with exit code 1
{code}
 

cimpoiesgeorge@gmail.com (JIRA)

unread,
Oct 8, 2019, 1:02:03 AM10/8/19
to jenkinsc...@googlegroups.com
Oct 08, 2019 6:55:11 AM hudson.plugins.ec2. EC2CloudINFO EC2Cloud
INFO
: Connecting to 10.230.0.193 on port 22, with timeout 10000.
Oct 08, 2019 6:55:12 AM hudson.plugins.ec2. EC2CloudINFO EC2Cloud
INFO
: Connected via SSH.
Oct 08, 2019 6:55:12 AM hudson.plugins.ec2. EC2CloudINFO EC2Cloud
INFO
: connect fresh as rootOct root
Oct
08, 2019 6:55:12 AM hudson.plugins.ec2. EC2CloudINFO EC2Cloud
INFO
: Connecting to 10.230.0.193 on port 22, with timeout 10000.
Oct 08, 2019 6:55:13 AM hudson.plugins.ec2. EC2CloudINFO EC2Cloud
INFO
: Connected via SSH.
Oct 08, 2019 6:55:14 AM hudson.plugins.ec2. EC2CloudINFO EC2Cloud
INFO
: Creating tmp directory (/tmp) if it does not existThe syntax of the command is incorrect.
Oct 08, 2019 6:55:14 AM hudson.plugins.ec2. EC2CloudINFO EC2Cloud
INFO
: Verifying: java -fullversionjava full version "1.8.0_131-b11"
Oct 08, 2019 6:55:17 AM hudson.plugins.ec2.EC2CloudINFO: Verifying: which scp/usr/bin/ scpOct scp
Oct
08, 2019 6:55:19 AM hudson.plugins.ec2. EC2CloudINFO EC2Cloud
INFO
: Copying slave.jar to: / tmpOct tmp
Oct
08, 2019 6:55:20 AM hudson.plugins.ec2. EC2CloudINFO EC2Cloud
INFO
: Launching slave agent (via SSH client process): ssh -o StrictHostKeyChecking=no -i /tmp/ec2_527682778172280023.pem cl...@10.230.0.193 -p 22  java  -jar /tmp/slave.jar[10/08/19 06:55:20] Launching agent$ ssh -o StrictHostKeyChecking=no -i /tmp/ec2_527682778172280023.pem cl...@10.230.0.193 -p 22  java  -jar /tmp/slave.jarWarning: Permanently added '10.230.0.193' (ECDSA) to the list of known hosts.
Error: Unable to access jarfile /tmp/slave.jarERROR: Unable to launch the agent for EC2 (Itiviti AWS) - AWS Windows Node (i-0d24e1b4cc97b791d)
java.io.EOFException: unexpected stream termination at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:415) at hudson.remoting.ChannelBuilder.build(ChannelBuilder.java:360) at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:431) at hudson.slaves.CommandLauncher.launch(CommandLauncher.java:153) at hudson.plugins.ec2.ssh.EC2UnixLauncher.launchScript(EC2UnixLauncher.java:234) 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)
ERROR: Process terminated with exit code 1
{code}
 

cimpoiesgeorge@gmail.com (JIRA)

unread,
Oct 8, 2019, 1:44:04 AM10/8/19
to jenkinsc...@googlegroups.com
INFO: Connecting to 10.230.0.193 on port 22, with timeout 10000.
Oct 08, 2019 6:55:12 AM hudson.plugins.ec2.EC2Cloud
INFO: Connected via SSH.
Oct 08, 2019 6:55:12 AM hudson.plugins.ec2.EC2Cloud

INFO: connect fresh as root
Oct 08, 2019 6:55:12 AM hudson.plugins.ec2.EC2Cloud
INFO: Connecting to 10.230.0.193 on port 22, with timeout 10000.
Oct 08, 2019 6:55:13 AM hudson.plugins.ec2.EC2Cloud
INFO: Connected via SSH.
Oct 08, 2019 6:55:14 AM hudson.plugins.ec2.EC2Cloud
INFO: Creating tmp directory (/tmp) if it does not existThe syntax of the command is incorrect.

Oct 08, 2019 6:55:14 AM hudson.plugins.ec2.EC2Cloud
INFO: Verifying: java -fullversionjava full version "1.8.0_131-b11"
Oct 08, 2019 6:55:17 AM hudson.plugins.ec2.EC2CloudINFO: Verifying: which scp/usr/bin/scp
Oct 08, 2019 6:55:19 AM hudson.plugins.ec2.EC2Cloud
INFO: Copying slave.jar to: /tmp

Oct 08, 2019 6:55:20 AM hudson.plugins.ec2.EC2Cloud
INFO: Launching slave agent (via SSH client process): ssh -o StrictHostKeyChecking=no -i /tmp/ec2_527682778172280023.pem cl...@10.230.0.193 -p 22  java  -jar /tmp/slave.jar[10/08/19 06:55:20] Launching agent$ ssh -o StrictHostKeyChecking=no -i /tmp/ec2_527682778172280023.pem cl...@10.230.0.193 -p 22  java  -jar /tmp/slave.jarWarning: Permanently added '10.230.0.193' (ECDSA) to the list of known hosts.
Error: Unable to access jarfile /tmp/slave. jarERROR jar
ERROR
: Unable to launch the agent for EC2 (Itiviti AWS) - AWS Windows Node (i-0d24e1b4cc97b791d)

java.io.EOFException: unexpected stream termination at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:415) at hudson.remoting.ChannelBuilder.build(ChannelBuilder.java:360) at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:431) at hudson.slaves.CommandLauncher.launch(CommandLauncher.java:153) at hudson.plugins.ec2.ssh.EC2UnixLauncher.launchScript(EC2UnixLauncher.java:234) 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)
ERROR: Process terminated with exit code 1
{code}
 

raihaan.shouhell@autodesk.com (JIRA)

unread,
Oct 8, 2019, 2:08:03 AM10/8/19
to jenkinsc...@googlegroups.com
Raihaan Shouhell commented on Bug JENKINS-59682
 
Re: EC2 Plugin terminates windows instance right after connecting when using ssh.

Your node is a windows node but you seem to have unix paths everywhere.

You are also accessing the node via ssh.

Assuming you do want to access it via ssh you need to set the temp directory to be a windows path. The default temp directory is a unix path, that is where i think your issue lies.

This is unrelated to 58193

cimpoiesgeorge@gmail.com (JIRA)

unread,
Oct 8, 2019, 2:14:04 AM10/8/19
to jenkinsc...@googlegroups.com

Raihaan Shouhell you are correct, I want to force the connection to be via ssh(even if the node is a windows one). Where is the temp directory located? Thanks in advance!

cimpoiesgeorge@gmail.com (JIRA)

unread,
Oct 8, 2019, 2:22:02 AM10/8/19
to jenkinsc...@googlegroups.com
George Cimpoies edited a comment on Bug JENKINS-59682
[~raihaan] you are correct, I want to force the connection to be via ssh(even if the node is a windows one). Where is the temp directory located? I can't find any configuration related to the temp directory on Jenkins' side.

Thanks in advance!

cimpoiesgeorge@gmail.com (JIRA)

unread,
Oct 8, 2019, 2:41:03 AM10/8/19
to jenkinsc...@googlegroups.com
George Cimpoies updated an issue
Change By: George Cimpoies
Comment:
[~raihaan] you are correct, I want to force the connection to be via ssh(even if the node is a windows one). Where is the temp directory located? I can't find any configuration related to the temp directory on Jenkins' side.

Thanks in advance!

raihaan.shouhell@autodesk.com (JIRA)

unread,
Oct 9, 2019, 10:36:05 PM10/9/19
to jenkinsc...@googlegroups.com

cimpoiesgeorge@gmail.com (JIRA)

unread,
Oct 10, 2019, 3:16:03 AM10/10/19
to jenkinsc...@googlegroups.com

Raihaan Shouhell works perfectly after overriding the temp directory. I'll close the issue. Just out of curiosity, is there any other option to force the plugin to connect to a windows node through ssh, other than setting the ami type to unix? (even though the ami is actually windows). Thanks!

cimpoiesgeorge@gmail.com (JIRA)

unread,
Oct 10, 2019, 3:16:04 AM10/10/19
to jenkinsc...@googlegroups.com
George Cimpoies closed an issue as Not A Defect
 
Change By: George Cimpoies
Status: Open Closed
Resolution: Not A Defect

raihaan.shouhell@autodesk.com (JIRA)

unread,
Oct 10, 2019, 3:19:02 AM10/10/19
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages