0

I'm in a bit of a pickle. One thing first - I used the following video as a guide. The link is timestamped (https://youtu.be/6YZvp2GwT0A?t=2362).

I have a jenkins running inside a docker container. What I am now trying to do is set up an additional Docker container as a cloud agent. As described in the tutorial, I managed to set up a Docker agent and connect it to the Jenkins controller. When I use jenkins/agent:alpine-jdk11 as Docker image to start the Docker agent, everything works fine.

However, since my application is a Rails application, I need a container that supports Ruby. Fortunately, Jenkins provides a suitable image for this purpose (https://hub.docker.com/r/jenkins/jnlp-agent-ruby). But when I use this Docker image, my pipeline fails.

When I examined the Jenkins log, I found the following:

Nov 25, 2022 9:52:26 AM INFO com.nirima.jenkins.plugins.docker.DockerCloud canAddProvisionedAgent

Provisioning 'jenkins/jnlp-agent-ruby:latest' number 1 (of 2) on 'docker-agent-alpine'; Total containers: 0 (of 100)

Nov 25, 2022 9:52:26 AM INFO com.nirima.jenkins.plugins.docker.DockerCloud provision

Will provision 'jenkins/jnlp-agent-ruby:latest', for label: 'docker-agent-alpine', in cloud: 'docker-agent-alpine'

Nov 25, 2022 9:52:26 AM INFO hudson.slaves.NodeProvisioner$StandardStrategyImpl apply

Started provisioning Image of jenkins/jnlp-agent-ruby:latest from docker-agent-alpine with 1 executors. Remaining excess workload: 0

Nov 25, 2022 9:52:26 AM INFO com.nirima.jenkins.plugins.docker.DockerTemplate pullImage

Pulling image 'jenkins/jnlp-agent-ruby:latest'. This may take awhile...

Nov 25, 2022 9:52:26 AM INFO io.jenkins.docker.client.DockerAPI getOrMakeClient

Cached connection io.jenkins.docker.client.DockerAPI$SharableDockerClient@2aa162ad to DockerClientParameters{dockerUri='tcp://172.20.0.2:2375', credentialsId='null', readTimeoutInMsOrNull=300000, connectTimeoutInMsOrNull=60000}

Nov 25, 2022 9:52:27 AM INFO com.nirima.jenkins.plugins.docker.DockerTemplate pullImage

Finished pulling image 'jenkins/jnlp-agent-ruby:latest', took 1175 ms

Nov 25, 2022 9:52:27 AM INFO com.nirima.jenkins.plugins.docker.DockerTemplate doProvisionNode

Trying to run container for image "jenkins/jnlp-agent-ruby:latest"

Nov 25, 2022 9:52:27 AM INFO com.nirima.jenkins.plugins.docker.DockerTemplate doProvisionNode

Trying to run container for node docker-agent-alpine-ruby-00001o1gbhqzl from image: jenkins/jnlp-agent-ruby:latest

Nov 25, 2022 9:52:27 AM INFO com.nirima.jenkins.plugins.docker.DockerTemplate doProvisionNode

Started container ID a84d331cc1a2bf97edb7932de8393f3601f8d210789875481a57951e4a2c1dff for node docker-agent-alpine-ruby-00001o1gbhqzl from image: jenkins/jnlp-agent-ruby:latest

Nov 25, 2022 9:52:27 AM SEVERE com.github.dockerjava.api.async.ResultCallbackTemplate onError

Error during callback
com.github.dockerjava.api.exception.NotFoundException: Status 404: {"message":"Could not find the file /home/jenkins in container a84d331cc1a2bf97edb7932de8393f3601f8d210789875481a57951e4a2c1dff"}

    at com.github.dockerjava.netty.handler.HttpResponseHandler.channelRead0(HttpResponseHandler.java:97)
    at com.github.dockerjava.netty.handler.HttpResponseHandler.channelRead0(HttpResponseHandler.java:32)
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
    at io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:271)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
    at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:321)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:295)
    at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
    at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:829)

Has anyone an idea how to fix this problem.

Many thanks in advance.

Theoran
  • 87
  • 1
  • 8

0 Answers0