Can't get image jenkins/jnlp-slave with JNLP to work
See original GitHub issueI’m unable to get jenkins to start docker container with JNLP.
Jenkins 2.132 Docker-Plugin 1.1.5-rc592.907a3144f989 (tried 1.1.4 as well) Docker Version: 1.12.6 API version: 1.24
I have docker plugin setup with mostly default settings. Labels: slave-docker Name: docker Docker Image docker.io/jenkins/jnlp-slave:latest Remote Root: /home/jenkins Connect with JNLP
I’ve pulled down jenkins/jnlp-slave image and set pull strategy to never pull. I’m using pipeline and I can see the docker container start (docker ps -a) but then its removed. Here’s the build console output:
[Pipeline] node
Running on docker-008s1dq46jht0 on Lewisville Docker in /home/jenkins/workspace/docker-test
[Pipeline] {
[Pipeline] sh
[docker-test] Running shell script
+ docker inspect -f . jenkins/jnlp-slave
/home/jenkins/workspace/docker-test@tmp/durable-bbbcdcb2/script.sh: 2: /home/jenkins/workspace/docker-test@tmp/durable-bbbcdcb2/script.sh: docker: not found
[Pipeline] sh
[docker-test] Running shell script
+ docker pull jenkins/jnlp-slave
/home/jenkins/workspace/docker-test@tmp/durable-5886619f/script.sh: 2: /home/jenkins/workspace/docker-test@tmp/durable-5886619f/script.sh: docker: not found
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 127
Finished: FAILURE
Here’s the Jenkins log:
Jul 17, 2018 12:55:32 AM INFO com.nirima.jenkins.plugins.docker.DockerCloud provision
Asked to provision 1 slave(s) for: slave-docker
Jul 17, 2018 12:55:32 AM INFO com.nirima.jenkins.plugins.docker.DockerCloud canAddProvisionedSlave
Provisioning 'docker.io/jenkins/jnlp-slave:latest' on 'Lewi Docker'; Total containers: 0 (of 100)
Jul 17, 2018 12:55:32 AM INFO com.nirima.jenkins.plugins.docker.DockerCloud provision
Will provision 'docker.io/jenkins/jnlp-slave:latest', for label: 'slave-docker', in cloud: 'Lewi Docker'
Jul 17, 2018 12:55:32 AM INFO hudson.slaves.NodeProvisioner$StandardStrategyImpl apply
Started provisioning Image of docker.io/jenkins/jnlp-slave:latest from Lewi Docker with 1 executors. Remaining excess workload: 0
Jul 17, 2018 12:55:32 AM INFO com.nirima.jenkins.plugins.docker.DockerTemplate doProvisionNode
Trying to run container for docker.io/jenkins/jnlp-slave:latest
Jul 17, 2018 12:55:32 AM INFO com.nirima.jenkins.plugins.docker.DockerTemplate doProvisionNode
Trying to run container for node docker-008s1dq46jht0 from image: docker.io/jenkins/jnlp-slave:latest
Jul 17, 2018 12:55:32 AM INFO com.nirima.jenkins.plugins.docker.DockerTemplate doProvisionNode
Started container ID 34f5009ed64e591fa6e6712359532e65e5c447678cab9101aecbb598645df15d for node docker-008s1dq46jht0 from image: docker.io/jenkins/jnlp-slave:latest
Jul 17, 2018 12:55:33 AM INFO hudson.TcpSlaveAgentListener$ConnectionHandler run
Accepted JNLP4-connect connection #8 from lelvdck0005/10.180.168.192:56976
Jul 17, 2018 12:55:36 AM INFO hudson.slaves.NodeProvisioner$2 run
Image of docker.io/jenkins/jnlp-slave:latest provisioning successfully completed. We have now 4 computer(s)
Jul 17, 2018 12:55:38 AM INFO io.jenkins.docker.DockerTransientNode$1 println
Disconnected computer for slave 'docker-008s1dq46jht0'.
Jul 17, 2018 12:55:38 AM WARNING jenkins.slaves.DefaultJnlpSlaveReceiver channelClosed
Computer.threadPoolForRemoting [#166] for docker-008s1dq46jht0 terminated
java.nio.channels.ClosedChannelException
at org.jenkinsci.remoting.protocol.impl.ChannelApplicationLayer.onReadClosed(ChannelApplicationLayer.java:209)
at org.jenkinsci.remoting.protocol.ApplicationLayer.onRecvClosed(ApplicationLayer.java:222)
at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecvClosed(ProtocolStack.java:832)
at org.jenkinsci.remoting.protocol.FilterLayer.onRecvClosed(FilterLayer.java:287)
at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.onRecvClosed(SSLEngineFilterLayer.java:181)
at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.switchToNoSecure(SSLEngineFilterLayer.java:283)
at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.processWrite(SSLEngineFilterLayer.java:503)
at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.processQueuedWrites(SSLEngineFilterLayer.java:248)
at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.doSend(SSLEngineFilterLayer.java:200)
at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.doCloseSend(SSLEngineFilterLayer.java:213)
at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.doCloseSend(ProtocolStack.java:800)
at org.jenkinsci.remoting.protocol.ApplicationLayer.doCloseWrite(ApplicationLayer.java:173)
at org.jenkinsci.remoting.protocol.impl.ChannelApplicationLayer$ByteBufferCommandTransport.closeWrite(ChannelApplicationLayer.java:314)
at hudson.remoting.Channel.close(Channel.java:1450)
at hudson.remoting.Channel.close(Channel.java:1403)
at hudson.slaves.SlaveComputer.closeChannel(SlaveComputer.java:819)
at hudson.slaves.SlaveComputer.access$800(SlaveComputer.java:105)
at hudson.slaves.SlaveComputer$3.run(SlaveComputer.java:737)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Jul 17, 2018 12:55:38 AM INFO io.jenkins.docker.DockerTransientNode$1 println
Removed Node for slave 'docker-008s1dq46jht0'.
Jul 17, 2018 12:55:38 AM INFO org.jenkinsci.plugins.workflow.job.WorkflowRun finish
docker-test #2 completed: FAILURE
Jul 17, 2018 12:55:38 AM INFO io.jenkins.docker.DockerTransientNode$1 println
Stopped container '34f5009ed64e591fa6e6712359532e65e5c447678cab9101aecbb598645df15d' for slave 'docker-008s1dq46jht0'.
Jul 17, 2018 12:55:38 AM INFO io.jenkins.docker.DockerTransientNode$1 println
Removed container '34f5009ed64e591fa6e6712359532e65e5c447678cab9101aecbb598645df15d' for slave 'docker-008s1dq46jht0'.
What am I missing here that this isn’t working?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
JNLP method not working with generic docker images
I am successfully using docker slaves with custom images using the Attach method. The images are not based on jenkins/jnlp-slave but do have...
Read more >Jenkins jnlp slave not working on local Kubernetes cluster
Describe the pod (slave) and you will see some outputs. Check that master can talk to Kubernetes cluster by running kubectl get node...
Read more >cloudbees/jnlp-slave-with-java-build-tools - Docker Image
jnlp -slave-with-java-build-tools docker container will be deprecated effective 31 January 2021, the container image will still be available for use however ...
Read more >JNLP slave no longer works - Google Groups
I was in a slightly different situation (linux, slaves launched manually), but had the 403 as well. Fixed by going to Manage Jenkins...
Read more >Running Jenkins jobs in AWS ECS with slave agents
If you want to just get it working, with everything configured automatically, ... Under the hood Jenkins uses a technology called JNLP (Java ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@pjdarton OK, so using this:
instead of this
Is what got it working. So difficult to find the correct pipeline syntax to use.
FYI
agent { label '...is general (not docker-specific) Jenkins pipeline syntax. This asks Jenkins for any slave that satisfies the label expression which, if you’ve configured this docker plugin with a template that satisfies that label expression, will cause this docker plugin to spin up a container.The previous syntax you used was for “the other plugin” which, as you’ve just discovered, has its own usage requirements. Feel free to raise an issue against that plugin (on their github area!) if you think you can suggest a better way it should work 😉
Glad you got it sorted in the end tho’