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

Slave couldn't connect to Jenkins

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: docker-slaves-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.86, OpenJDK 1.8.0_151, docker 17.03.2-ce
    • Similar Issues:

      Description

      After upgrading Jenkins to the latest version docker slaves from image jenkinsci/slave keep failing to connect. In job I see error:

      Start Docker container to host the build
      Start Docker container to host the build
      FATAL: hudson/slaves/CommandLauncher
      java.lang.NoClassDefFoundError: hudson/slaves/CommandLauncher
      	at it.dockins.dockerslaves.drivers.CliDockerDriver.launchRemotingContainer(CliDockerDriver.java:188)
      	at it.dockins.dockerslaves.DefaultDockerProvisioner.launchRemotingContainer(DefaultDockerProvisioner.java:88)
      	at it.dockins.dockerslaves.DockerComputerLauncher.launch(DockerComputerLauncher.java:58)
      	at it.dockins.dockerslaves.DockerComputerLauncher.launch(DockerComputerLauncher.java:49)
      	at it.dockins.dockerslaves.api.OneShotSlave.provision(OneShotSlave.java:123)
      	at it.dockins.dockerslaves.api.OneShotSlave.createLauncher(OneShotSlave.java:154)
      	at it.dockins.dockerslaves.DockerSlave.createLauncher(DockerSlave.java:96)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:531)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:462)
      	at hudson.model.Run.execute(Run.java:1724)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:421)
      Finished: FAILURE
      

      If I start docker slave from jenkinsci/slave (version 3.10) manually by command docker run --entrypoint java jenkinsci/slave -Djava.io.tmpdir=/home/jenkins/.tmp -jar /usr/share/jenkins/slave.jar I get:

      <===[JENKINS REMOTING CAPACITY]===>rO0ABXNyABpodWRzb24ucmVtb3RpbmcuQ2FwYWJpbGl0eQAAAAAAAAABAgABSgAEbWFza3hwAAAAAAAAAP4=Exception in thread "main" java.io.EOFException: unexpected stream termination
      	at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:378)
      	at hudson.remoting.ChannelBuilder.build(ChannelBuilder.java:323)
      	at hudson.remoting.Launcher.main(Launcher.java:742)
      	at hudson.remoting.Launcher.runWithStdinStdout(Launcher.java:680)
      	at hudson.remoting.Launcher.run(Launcher.java:362)
      	at hudson.remoting.Launcher.main(Launcher.java:277)
      

      As result I see a lot of failed containers:

      CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                      PORTS               NAMES
      1343f5ffadce        jenkinsci/slave     "java -Djava.io.tm..."   48 seconds ago      Created                                         tender_mcclintock
      4d4aff0b1214        jenkinsci/slave     "java -Djava.io.tm..."   48 seconds ago      Created                                         awesome_edison
      62dbdceea285        jenkinsci/slave     "java -Djava.io.tm..."   5 minutes ago       Created                                         vibrant_sammet
      8e08e05c59b2        jenkinsci/slave     "java -Djava.io.tm..."   5 minutes ago       Created                                         jovial_wilson
      fc0df12e1d73        jenkinsci/slave     "java -Djava.io.tm..."   6 minutes ago       Created                                         determined_spence
      c245474332ee        jenkinsci/slave     "java -Djava.io.tm..."   6 minutes ago       Created                                         hopeful_feynman
      6a7a718db63d        jenkinsci/slave     "java -Djava.io.tm..."   10 minutes ago      Created                                         stupefied_ardinghelli
      

        Attachments

          Activity

          nitrogear Alex Grinko created issue -
          nitrogear Alex Grinko made changes -
          Field Original Value New Value
          Description After upgrading Jenkins to the latest version docker slaves from image jenkinsci/slave keep failing to connect. In job I see error:
          {code:java}
          Start Docker container to host the build
          Start Docker container to host the build
          FATAL: hudson/slaves/CommandLauncher
          java.lang.NoClassDefFoundError: hudson/slaves/CommandLauncher
          at it.dockins.dockerslaves.drivers.CliDockerDriver.launchRemotingContainer(CliDockerDriver.java:188)
          at it.dockins.dockerslaves.DefaultDockerProvisioner.launchRemotingContainer(DefaultDockerProvisioner.java:88)
          at it.dockins.dockerslaves.DockerComputerLauncher.launch(DockerComputerLauncher.java:58)
          at it.dockins.dockerslaves.DockerComputerLauncher.launch(DockerComputerLauncher.java:49)
          at it.dockins.dockerslaves.api.OneShotSlave.provision(OneShotSlave.java:123)
          at it.dockins.dockerslaves.api.OneShotSlave.createLauncher(OneShotSlave.java:154)
          at it.dockins.dockerslaves.DockerSlave.createLauncher(DockerSlave.java:96)
          at hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:531)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:462)
          at hudson.model.Run.execute(Run.java:1724)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:97)
          at hudson.model.Executor.run(Executor.java:421)
          Finished: FAILURE
          {code}
          If I start docker slave from jenkinsci/slave (version 3.10) manually by command docker run --entrypoint java jenkinsci/slave -Djava.io.tmpdir=/home/jenkins/.tmp -jar /usr/share/jenkins/slave.jar I get:
          {code:java}
          <===[JENKINS REMOTING CAPACITY]===>rO0ABXNyABpodWRzb24ucmVtb3RpbmcuQ2FwYWJpbGl0eQAAAAAAAAABAgABSgAEbWFza3hwAAAAAAAAAP4=Exception in thread "main" java.io.EOFException: unexpected stream termination
          at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:378)
          at hudson.remoting.ChannelBuilder.build(ChannelBuilder.java:323)
          at hudson.remoting.Launcher.main(Launcher.java:742)
          at hudson.remoting.Launcher.runWithStdinStdout(Launcher.java:680)
          at hudson.remoting.Launcher.run(Launcher.java:362)
          at hudson.remoting.Launcher.main(Launcher.java:277)
          {code}
          After upgrading Jenkins to the latest version docker slaves from image jenkinsci/slave keep failing to connect. In job I see error:
          {code:java}
          Start Docker container to host the build
          Start Docker container to host the build
          FATAL: hudson/slaves/CommandLauncher
          java.lang.NoClassDefFoundError: hudson/slaves/CommandLauncher
          at it.dockins.dockerslaves.drivers.CliDockerDriver.launchRemotingContainer(CliDockerDriver.java:188)
          at it.dockins.dockerslaves.DefaultDockerProvisioner.launchRemotingContainer(DefaultDockerProvisioner.java:88)
          at it.dockins.dockerslaves.DockerComputerLauncher.launch(DockerComputerLauncher.java:58)
          at it.dockins.dockerslaves.DockerComputerLauncher.launch(DockerComputerLauncher.java:49)
          at it.dockins.dockerslaves.api.OneShotSlave.provision(OneShotSlave.java:123)
          at it.dockins.dockerslaves.api.OneShotSlave.createLauncher(OneShotSlave.java:154)
          at it.dockins.dockerslaves.DockerSlave.createLauncher(DockerSlave.java:96)
          at hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:531)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:462)
          at hudson.model.Run.execute(Run.java:1724)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:97)
          at hudson.model.Executor.run(Executor.java:421)
          Finished: FAILURE
          {code}
          If I start docker slave from jenkinsci/slave (version 3.10) manually by command docker run --entrypoint java jenkinsci/slave -Djava.io.tmpdir=/home/jenkins/.tmp -jar /usr/share/jenkins/slave.jar I get:
          {code:java}
          <===[JENKINS REMOTING CAPACITY]===>rO0ABXNyABpodWRzb24ucmVtb3RpbmcuQ2FwYWJpbGl0eQAAAAAAAAABAgABSgAEbWFza3hwAAAAAAAAAP4=Exception in thread "main" java.io.EOFException: unexpected stream termination
          at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:378)
          at hudson.remoting.ChannelBuilder.build(ChannelBuilder.java:323)
          at hudson.remoting.Launcher.main(Launcher.java:742)
          at hudson.remoting.Launcher.runWithStdinStdout(Launcher.java:680)
          at hudson.remoting.Launcher.run(Launcher.java:362)
          at hudson.remoting.Launcher.main(Launcher.java:277)
          {code}

          As result I see a lot of failed containers:
          {code}
          CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
          1343f5ffadce jenkinsci/slave "java -Djava.io.tm..." 48 seconds ago Created tender_mcclintock
          4d4aff0b1214 jenkinsci/slave "java -Djava.io.tm..." 48 seconds ago Created awesome_edison
          62dbdceea285 jenkinsci/slave "java -Djava.io.tm..." 5 minutes ago Created vibrant_sammet
          8e08e05c59b2 jenkinsci/slave "java -Djava.io.tm..." 5 minutes ago Created jovial_wilson
          fc0df12e1d73 jenkinsci/slave "java -Djava.io.tm..." 6 minutes ago Created determined_spence
          c245474332ee jenkinsci/slave "java -Djava.io.tm..." 6 minutes ago Created hopeful_feynman
          6a7a718db63d jenkinsci/slave "java -Djava.io.tm..." 10 minutes ago Created stupefied_ardinghelli
          {code}
          nitrogear Alex Grinko made changes -
          Attachment docker.inspect.txt [ 40152 ]
          nitrogear Alex Grinko made changes -
          Component/s docker-slaves-plugin [ 20839 ]
          Hide
          danielbeck Daniel Beck added a comment -

          Interesting, it shouldn't be possible to install docker-slaves plugin without getting the command-launcher plugin. How did you install docker-slaves plugin on the master?

          Show
          danielbeck Daniel Beck added a comment - Interesting, it shouldn't be possible to install docker-slaves plugin without getting the command-launcher plugin. How did you install docker-slaves plugin on the master?
          danielbeck Daniel Beck made changes -
          Component/s remoting [ 15489 ]
          Hide
          nitrogear Alex Grinko added a comment - - edited

          I found the root cause of the issue - command-launcher class was removed from core Jenkins in 2.86. When I upgraded from 2.73 version I didn't get any notification that I should install command-launcher plugin.
          So resolution is just to install command-launcher after upgrade.

          Show
          nitrogear Alex Grinko added a comment - - edited I found the root cause of the issue - command-launcher class was removed from core Jenkins in 2.86. When I upgraded from 2.73 version I didn't get any notification that I should install command-launcher plugin. So resolution is just to install command-launcher after upgrade.
          Hide
          danielbeck Daniel Beck added a comment -

           So resolution is just to install command-launcher after upgrade.

          The point above is that this should happen automatically on upgrade or installing docker-slaves. So that this isn't happening would be a bug if you installed the docker-slaves plugin using one of the supported methods.

          Show
          danielbeck Daniel Beck added a comment -  So resolution is just to install command-launcher after upgrade. The point above is that this should happen automatically on upgrade or installing docker-slaves. So that this isn't happening would be a bug if you installed the docker-slaves plugin using one of the supported methods.
          Hide
          nitrogear Alex Grinko added a comment -

          Then we could call it a bug - docker-slaves plugin was installed from Jenkins menu and Jenkins upgrade was done via apt-get.

          Show
          nitrogear Alex Grinko added a comment - Then we could call it a bug - docker-slaves plugin was installed from Jenkins menu and Jenkins upgrade was done via apt-get.
          Hide
          danielbeck Daniel Beck added a comment -

          Alex Grinko Do you still have the jenkins.log from around the time of the upgrade? It should contain entries related to a detected Jenkins upgrade.

          Show
          danielbeck Daniel Beck added a comment - Alex Grinko Do you still have the jenkins.log from around the time of the upgrade? It should contain entries related to a detected Jenkins upgrade.

            People

            • Assignee:
              Unassigned
              Reporter:
              nitrogear Alex Grinko
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: