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

1.37 slave launcher prefixing breaks installations without prefix strings.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • ec2-plugin
    • None
    • 1.37

      After upgrading to 1.37, none of my spot instances would register with jenkins as a node.

      1.37 introduced the ability to add a prefix command before the launchstring for EC2UnixLaunchers (https://github.com/jenkinsci/ec2-plugin/pull/224), however if one is not using a prefix command, it breaks the launch string somehow.  The logs were showing two spaces in front of the command. 

      INFO: Launching slave agent (via Trilead SSH2 Connection):  java  -jar /tmp/slave.jar

      And when I would ssh into the slaves, there was no slave.jar running.

       

      So I patched out the prefix string here: 

      https://github.com/jenkinsci/ec2-plugin/blob/d5fbd012bf0c18e85ee85653694cf6c51ad4cd3b/src/main/java/hudson/plugins/ec2/ssh/EC2UnixLauncher.java#L218

      To remove the prefix part:

      String launchString = "java " + (jvmopts != null ? jvmopts : "") + " -jar " + tmpDir + "/slave.jar";

      then I repackaged the plugin, upgraded to my bespoke version, and everything was working again.

      Im not sure if this is a weird bug with the trilead ssh client that doesnt like commands to be prefixed with spaces or what, but at least that fixed the issue allowing me to use 1.37

            francisu Francis Upton
            mixologic Ryan Aslett
            Votes:
            4 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: