jenkins docker slave image won't launch

1.3k Views Asked by At

Not used jenkins very much, but working with a docker slave job. I set up a docker cloud, and I deployed an image to it. When I kick off the jenkins job the image is pulled, and then I see this error. It appears that it's a fault of trying to run remoting-4.5.jar. Is there another way to see what is happening?

HTTP/1.1 101 UPGRADED
Content-Type: application/vnd.docker.raw-stream
Connection: Upgrade
Upgrade: tcp
Api-Version: 1.40
Docker-Experimental: false
Ostype: linux
Server: Docker/19.03.13 (linux)
cannot exec in a stopped state: unknown
ERROR: Unexpected error in launching an agent. This is probably a bug in Jenkins
Also:   java.lang.Throwable: launched here
    at hudson.slaves.SlaveComputer._connect(SlaveComputer.java:283)
    at hudson.model.Computer.connect(Computer.java:435)
    at com.nirima.jenkins.plugins.docker.strategy.DockerOnceRetentionStrategy.start(DockerOnceRetentionStrategy.java:80)
    at com.nirima.jenkins.plugins.docker.strategy.DockerOnceRetentionStrategy.start(DockerOnceRetentionStrategy.java:35)
    at hudson.model.AbstractCIBase.updateComputer(AbstractCIBase.java:162)
    at hudson.model.AbstractCIBase.access$000(AbstractCIBase.java:44)
    at hudson.model.AbstractCIBase$2.run(AbstractCIBase.java:224)
    at hudson.model.Queue._withLock(Queue.java:1398)
    at hudson.model.Queue.withLock(Queue.java:1275)
    at hudson.model.AbstractCIBase.updateComputerList(AbstractCIBase.java:207)
    at jenkins.model.Jenkins.updateComputerList(Jenkins.java:1635)
    at jenkins.model.Nodes$2.run(Nodes.java:139)
    at hudson.model.Queue._withLock(Queue.java:1398)
    at hudson.model.Queue.withLock(Queue.java:1275)
    at jenkins.model.Nodes.addNode(Nodes.java:135)
    at jenkins.model.Jenkins.addNode(Jenkins.java:2158)
    at com.nirima.jenkins.plugins.docker.DockerCloud.robustlyAddNodeToJenkins(DockerCloud.java:445)
    at com.nirima.jenkins.plugins.docker.DockerCloud.access$000(DockerCloud.java:68)
    at com.nirima.jenkins.plugins.docker.DockerCloud$1.run(DockerCloud.java:381)
    at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
    at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
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:425)
    at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:392)
    at io.jenkins.docker.connector.DockerComputerAttachConnector$DockerAttachLauncher.launch(DockerComputerAttachConnector.java:319)
    at hudson.slaves.DelegatingComputerLauncher.launch(DelegatingComputerLauncher.java:64)
    at io.jenkins.docker.connector.DockerDelegatingComputerLauncher.launch(DockerDelegatingComputerLauncher.java:37)
    at hudson.slaves.SlaveComputer.lambda$_connect$0(SlaveComputer.java:294)
    at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
    at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:71)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
1

There are 1 best solutions below

1
On

Not sure if you solved this or not, but we had the same issue and it turned out to be the "Remote File System Root" field being blank. We set it to the home directory of the user specified in the "Connect Method" ("Attach Docker container" for us) section (/home/jenkins in this case) and it was able to launch the agent.