Cannot start Jenkins docker jnlp agent via agent template

Hi everyone,

I have deployed Jenkin with via docker-compose as below (Jenkins docker image latest)

jenkins:
    image: ${JENKINS_IMAGE_TAG}
    container_name: jenkins
    networks:
      - devops-network
      - traefik-network
    ports:
      - ${JENKINS_PORT}:8080
      - 50000:50000
    environment:
      - DOCKER_TLS_CERTDIR=/certs
    volumes:
      - "$PWD/jenkins_home:/var/jenkins_home"
      - jenkins-docker-certs:/certs/client
      - /var/run/docker.sock:/var/run/docker.sock
      - /usr/bin/docker:/usr/bin/docker
    privileged: true
    user: root
    healthcheck:
      test: timeout 10s bash -c ':> /dev/tcp/127.0.0.1/8080' || exit 1
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 90s
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.jenkins.rule=Host(`${JENKINS_HOSTNAME}`)"
      - "traefik.http.routers.jenkins.service=jenkins"
      - "traefik.http.routers.jenkins.entrypoints=websecure"
      - "traefik.http.services.jenkins.loadbalancer.server.port=8080"
      - "traefik.http.routers.jenkins.tls=true"
      - "traefik.http.routers.jenkins.tls.certresolver=letsencrypt"
      - "traefik.http.services.jenkins.loadbalancer.passhostheader=true"
      - "traefik.http.routers.jenkins.middlewares=compresstraefik"
      - "traefik.http.middlewares.compresstraefik.compress=true"
      - "traefik.docker.network=traefik-network"
    restart: unless-stopped

In the firewall, I have allowed port 443 (Jenkins server) and 50000 for agent. And fixed port 50000 for agent on Jenkins configuration also

Agent template

I wrote some maven pipeline tests but I got the error, can’t start the maven agent build with error below

2024-05-18 16:35:11.509+0000 [id=46]    INFO    c.n.j.plugins.docker.DockerCloud#canAddProvisionedAgent: Provisioning 'jenkins/jnlp-agent-maven' number 1 (of 3) on 'Local Docker'; Total containers: 0 (of 20)
2024-05-18 16:35:11.509+0000 [id=46]    INFO    c.n.j.plugins.docker.DockerCloud#provision: Will provision 'jenkins/jnlp-agent-maven', for label: 'maven', in cloud: 'Local Docker'
2024-05-18 16:35:11.509+0000 [id=554]   INFO    c.n.j.p.docker.DockerTemplate#pullImage: Pulling image 'jenkins/jnlp-agent-maven:latest'. This may take awhile...
2024-05-18 16:35:14.160+0000 [id=554]   INFO    c.n.j.p.docker.DockerTemplate#pullImage: Finished pulling image 'jenkins/jnlp-agent-maven:latest', took 2650 ms
2024-05-18 16:35:14.162+0000 [id=554]   INFO    c.n.j.p.docker.DockerTemplate#doProvisionNode: Trying to run container for image "jenkins/jnlp-agent-maven"
2024-05-18 16:35:14.162+0000 [id=554]   INFO    c.n.j.p.docker.DockerTemplate#doProvisionNode: Trying to run container for node maven-agent-0001a0moy1h1w from image: jenkins/jnlp-agent-maven
2024-05-18 16:35:14.212+0000 [id=554]   INFO    c.n.j.p.docker.DockerTemplate#doProvisionNode: Started container ID 553ddf15e2305e6b2e4d445ceed536ca595c2e635623296bad3b069e3d3a8b35 for node maven-agent-0001a0moy1h1w from image: jenkins/jnlp-agent-maven
2024-05-18 16:35:14.800+0000 [id=554]   SEVERE  c.n.j.p.docker.DockerCloud$1#run: Error in provisioning; template='DockerTemplate{configVersion=2, labelString='maven', connector=DockerComputerAttachConnector{}, remoteFs='/home/jenkins/agent', instanceCap=3, mode=EXCLUSIVE, retentionStrategy=com.nirima.jenkins.plugins.docker.strategy.DockerOnceRetentionStrategy@29, dockerTemplateBase=DockerTemplateBase{image='jenkins/jnlp-agent-maven', bindAllPorts=false, cpuPeriod=0, cpuQuota=0, privileged=false, tty=false}, removeVolumes=false, stopTimeout=10, pullStrategy=PULL_ALWAYS, pullTimeout=300, disabled=BySystem,0 ms,4 min 59 sec,Template provisioning failed., name='maven-agent'}' for cloud='Local Docker'
Also:   java.io.IOException: Broken pipe
                at java.base/sun.nio.ch.FileDispatcherImpl.write0(Native Method)
                at java.base/sun.nio.ch.SocketDispatcher.write(Unknown Source)
                at java.base/sun.nio.ch.IOUtil.writeFromNativeBuffer(Unknown Source)
                at java.base/sun.nio.ch.IOUtil.write(Unknown Source)
                at java.base/sun.nio.ch.IOUtil.write(Unknown Source)
                at java.base/sun.nio.ch.SocketChannelImpl.write(Unknown Source)
                at com.github.dockerjava.transport.UnixSocket$WrappedWritableByteChannel.write(UnixSocket.java:95)
                at java.base/java.nio.channels.Channels.writeFullyImpl(Unknown Source)
                at java.base/java.nio.channels.Channels.writeFully(Unknown Source)
                at java.base/java.nio.channels.Channels$1.write(Unknown Source)
                at org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection$1.write(DefaultBHttpClientConnection.java:232)
                at org.apache.hc.core5.http.impl.io.SessionOutputBufferImpl.flushBuffer(SessionOutputBufferImpl.java:117)
                at org.apache.hc.core5.http.impl.io.SessionOutputBufferImpl.writeLine(SessionOutputBufferImpl.java:204)
                at org.apache.hc.core5.http.impl.io.ChunkedOutputStream.flushCache(ChunkedOutputStream.java:126)
                at org.apache.hc.core5.http.impl.io.ChunkedOutputStream.finish(ChunkedOutputStream.java:184)
                at org.apache.hc.core5.http.impl.io.ChunkedOutputStream.close(ChunkedOutputStream.java:245)
                at org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection.sendRequestEntity(DefaultBHttpClientConnection.java:254)
java.io.IOException: Connection reset by peer
        at java.base/sun.nio.ch.FileDispatcherImpl.write0(Native Method)
        at java.base/sun.nio.ch.SocketDispatcher.write(Unknown Source)
        at java.base/sun.nio.ch.IOUtil.writeFromNativeBuffer(Unknown Source)
        at java.base/sun.nio.ch.IOUtil.write(Unknown Source)
        at java.base/sun.nio.ch.IOUtil.write(Unknown Source)
        at java.base/sun.nio.ch.SocketChannelImpl.write(Unknown Source)
        at com.github.dockerjava.transport.UnixSocket$WrappedWritableByteChannel.write(UnixSocket.java:95)
        at java.base/java.nio.channels.Channels.writeFullyImpl(Unknown Source)
        at java.base/java.nio.channels.Channels.writeFully(Unknown Source)
        at java.base/java.nio.channels.Channels$1.write(Unknown Source)
        at org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection$1.write(DefaultBHttpClientConnection.java:232)
        at org.apache.hc.core5.http.impl.io.SessionOutputBufferImpl.flushBuffer(SessionOutputBufferImpl.java:117)
        at org.apache.hc.core5.http.impl.io.SessionOutputBufferImpl.write(SessionOutputBufferImpl.java:150)
        at org.apache.hc.core5.http.impl.io.SessionOutputBufferImpl.write(SessionOutputBufferImpl.java:162)
        at org.apache.hc.core5.http.impl.io.SessionOutputBufferImpl.writeLine(SessionOutputBufferImpl.java:213)
        at org.apache.hc.core5.http.impl.io.ChunkedOutputStream.flushCacheWithAppend(ChunkedOutputStream.java:145)
        at org.apache.hc.core5.http.impl.io.ChunkedOutputStream.write(ChunkedOutputStream.java:222)
        at org.apache.hc.core5.http.io.entity.InputStreamEntity.writeTo(InputStreamEntity.java:96)
        at org.apache.hc.client5.http.impl.classic.RequestEntityProxy.writeTo(RequestEntityProxy.java:106)
        at org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection.sendRequestEntity(DefaultBHttpClientConnection.java:253)
        at org.apache.hc.core5.http.impl.io.HttpRequestExecutor.execute(HttpRequestExecutor.java:141)
        at com.github.dockerjava.httpclient5.HijackingHttpRequestExecutor.execute(HijackingHttpRequestExecutor.java:50)
        at org.apache.hc.core5.http.impl.io.HttpRequestExecutor.execute(HttpRequestExecutor.java:218)
        at org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager$InternalConnectionEndpoint.execute(PoolingHttpClientConnectionManager.java:717)
        at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.execute(InternalExecRuntime.java:216)
        at org.apache.hc.client5.http.impl.classic.MainClientExec.execute(MainClientExec.java:116)
        at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
        at org.apache.hc.client5.http.impl.classic.ConnectExec.execute(ConnectExec.java:188)
        at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
        at org.apache.hc.client5.http.impl.classic.ProtocolExec.execute(ProtocolExec.java:192)
        at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
        at org.apache.hc.client5.http.impl.classic.HttpRequestRetryExec.execute(HttpRequestRetryExec.java:113)
        at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
        at org.apache.hc.client5.http.impl.classic.ContentCompressionExec.execute(ContentCompressionExec.java:152)
        at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
        at org.apache.hc.client5.http.impl.classic.RedirectExec.execute(RedirectExec.java:116)
        at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
        at org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:170)
        at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:87)
        at com.github.dockerjava.httpclient5.ApacheDockerHttpClientImpl.execute(ApacheDockerHttpClientImpl.java:191)
Caused: java.lang.RuntimeException
        at com.github.dockerjava.httpclient5.ApacheDockerHttpClientImpl.execute(ApacheDockerHttpClientImpl.java:195)
        at com.github.dockerjava.httpclient5.ApacheDockerHttpClient.execute(ApacheDockerHttpClient.java:9)
        at com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:228)
        at com.github.dockerjava.core.DefaultInvocationBuilder.put(DefaultInvocationBuilder.java:223)
        at com.github.dockerjava.core.exec.CopyArchiveToContainerCmdExec.execute(CopyArchiveToContainerCmdExec.java:34)
        at com.github.dockerjava.core.exec.CopyArchiveToContainerCmdExec.execute(CopyArchiveToContainerCmdExec.java:13)
        at com.github.dockerjava.core.exec.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:21)
        at com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:33)
        at com.github.dockerjava.core.command.CopyArchiveToContainerCmdImpl.exec(CopyArchiveToContainerCmdImpl.java:150)
        at io.jenkins.docker.connector.DockerComputerConnector.injectRemotingJar(DockerComputerConnector.java:155)
        at io.jenkins.docker.connector.DockerComputerAttachConnector.beforeContainerStarted(DockerComputerAttachConnector.java:175)
        at com.nirima.jenkins.plugins.docker.DockerTemplate.doProvisionNode(DockerTemplate.java:754)
        at com.nirima.jenkins.plugins.docker.DockerTemplate.provisionNode(DockerTemplate.java:686)
        at com.nirima.jenkins.plugins.docker.DockerCloud$1.run(DockerCloud.java:414)
        at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
        at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
        at jenkins.util.ErrorLoggingExecutorService.lambda$wrap$0(ErrorLoggingExecutorService.java:51)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
2024-05-18 16:35:14.801+0000 [id=554]   WARNING j.u.ErrorLoggingExecutorService#lambda$wrap$0
Also:   java.io.IOException: Broken pipe
                at java.base/sun.nio.ch.FileDispatcherImpl.write0(Native Method)
                at java.base/sun.nio.ch.SocketDispatcher.write(Unknown Source)
                at java.base/sun.nio.ch.IOUtil.writeFromNativeBuffer(Unknown Source)
                at java.base/sun.nio.ch.IOUtil.write(Unknown Source)
                at java.base/sun.nio.ch.IOUtil.write(Unknown Source)
                at java.base/sun.nio.ch.SocketChannelImpl.write(Unknown Source)
                at com.github.dockerjava.transport.UnixSocket$WrappedWritableByteChannel.write(UnixSocket.java:95)
                at java.base/java.nio.channels.Channels.writeFullyImpl(Unknown Source)
                at java.base/java.nio.channels.Channels.writeFully(Unknown Source)
                at java.base/java.nio.channels.Channels$1.write(Unknown Source)
                at org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection$1.write(DefaultBHttpClientConnection.java:232)
                at org.apache.hc.core5.http.impl.io.SessionOutputBufferImpl.flushBuffer(SessionOutputBufferImpl.java:117)
                at org.apache.hc.core5.http.impl.io.SessionOutputBufferImpl.writeLine(SessionOutputBufferImpl.java:204)
                at org.apache.hc.core5.http.impl.io.ChunkedOutputStream.flushCache(ChunkedOutputStream.java:126)
                at org.apache.hc.core5.http.impl.io.ChunkedOutputStream.finish(ChunkedOutputStream.java:184)
                at org.apache.hc.core5.http.impl.io.ChunkedOutputStream.close(ChunkedOutputStream.java:245)
                at org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection.sendRequestEntity(DefaultBHttpClientConnection.java:254)
java.io.IOException: Connection reset by peer
        at java.base/sun.nio.ch.FileDispatcherImpl.write0(Native Method)
        at java.base/sun.nio.ch.SocketDispatcher.write(Unknown Source)
        at java.base/sun.nio.ch.IOUtil.writeFromNativeBuffer(Unknown Source)
        at java.base/sun.nio.ch.IOUtil.write(Unknown Source)
        at java.base/sun.nio.ch.IOUtil.write(Unknown Source)
        at java.base/sun.nio.ch.SocketChannelImpl.write(Unknown Source)
        at com.github.dockerjava.transport.UnixSocket$WrappedWritableByteChannel.write(UnixSocket.java:95)
        at java.base/java.nio.channels.Channels.writeFullyImpl(Unknown Source)
        at java.base/java.nio.channels.Channels.writeFully(Unknown Source)
        at java.base/java.nio.channels.Channels$1.write(Unknown Source)
        at org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection$1.write(DefaultBHttpClientConnection.java:232)
        at org.apache.hc.core5.http.impl.io.SessionOutputBufferImpl.flushBuffer(SessionOutputBufferImpl.java:117)
        at org.apache.hc.core5.http.impl.io.SessionOutputBufferImpl.write(SessionOutputBufferImpl.java:150)
        at org.apache.hc.core5.http.impl.io.SessionOutputBufferImpl.write(SessionOutputBufferImpl.java:162)
        at org.apache.hc.core5.http.impl.io.SessionOutputBufferImpl.writeLine(SessionOutputBufferImpl.java:213)
        at org.apache.hc.core5.http.impl.io.ChunkedOutputStream.flushCacheWithAppend(ChunkedOutputStream.java:145)
        at org.apache.hc.core5.http.impl.io.ChunkedOutputStream.write(ChunkedOutputStream.java:222)
        at org.apache.hc.core5.http.io.entity.InputStreamEntity.writeTo(InputStreamEntity.java:96)
        at org.apache.hc.client5.http.impl.classic.RequestEntityProxy.writeTo(RequestEntityProxy.java:106)
        at org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection.sendRequestEntity(DefaultBHttpClientConnection.java:253)
        at org.apache.hc.core5.http.impl.io.HttpRequestExecutor.execute(HttpRequestExecutor.java:141)
        at com.github.dockerjava.httpclient5.HijackingHttpRequestExecutor.execute(HijackingHttpRequestExecutor.java:50)
        at org.apache.hc.core5.http.impl.io.HttpRequestExecutor.execute(HttpRequestExecutor.java:218)
        at org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager$InternalConnectionEndpoint.execute(PoolingHttpClientConnectionManager.java:717)
        at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.execute(InternalExecRuntime.java:216)
        at org.apache.hc.client5.http.impl.classic.MainClientExec.execute(MainClientExec.java:116)
        at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
        at org.apache.hc.client5.http.impl.classic.ConnectExec.execute(ConnectExec.java:188)
        at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
        at org.apache.hc.client5.http.impl.classic.ProtocolExec.execute(ProtocolExec.java:192)
        at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
        at org.apache.hc.client5.http.impl.classic.HttpRequestRetryExec.execute(HttpRequestRetryExec.java:113)
        at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
        at org.apache.hc.client5.http.impl.classic.ContentCompressionExec.execute(ContentCompressionExec.java:152)
        at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
        at org.apache.hc.client5.http.impl.classic.RedirectExec.execute(RedirectExec.java:116)
        at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
        at org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:170)
        at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:87)
        at com.github.dockerjava.httpclient5.ApacheDockerHttpClientImpl.execute(ApacheDockerHttpClientImpl.java:191)
Caused: java.lang.RuntimeException
        at com.github.dockerjava.httpclient5.ApacheDockerHttpClientImpl.execute(ApacheDockerHttpClientImpl.java:195)
        at com.github.dockerjava.httpclient5.ApacheDockerHttpClient.execute(ApacheDockerHttpClient.java:9)
        at com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:228)
        at com.github.dockerjava.core.DefaultInvocationBuilder.put(DefaultInvocationBuilder.java:223)
        at com.github.dockerjava.core.exec.CopyArchiveToContainerCmdExec.execute(CopyArchiveToContainerCmdExec.java:34)
        at com.github.dockerjava.core.exec.CopyArchiveToContainerCmdExec.execute(CopyArchiveToContainerCmdExec.java:13)
        at com.github.dockerjava.core.exec.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:21)
        at com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:33)
        at com.github.dockerjava.core.command.CopyArchiveToContainerCmdImpl.exec(CopyArchiveToContainerCmdImpl.java:150)
        at io.jenkins.docker.connector.DockerComputerConnector.injectRemotingJar(DockerComputerConnector.java:155)
        at io.jenkins.docker.connector.DockerComputerAttachConnector.beforeContainerStarted(DockerComputerAttachConnector.java:175)
        at com.nirima.jenkins.plugins.docker.DockerTemplate.doProvisionNode(DockerTemplate.java:754)
        at com.nirima.jenkins.plugins.docker.DockerTemplate.provisionNode(DockerTemplate.java:686)
        at com.nirima.jenkins.plugins.docker.DockerCloud$1.run(DockerCloud.java:414)
        at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
        at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
        at jenkins.util.ErrorLoggingExecutorService.lambda$wrap$0(ErrorLoggingExecutorService.java:51)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
2024-05-18 16:35:21.504+0000 [id=38]    WARNING hudson.slaves.NodeProvisioner#update: Unexpected exception encountered while provisioning agent maven-agent (jenkins/jnlp-agent-maven)
Also:   java.io.IOException: Broken pipe
                at java.base/sun.nio.ch.FileDispatcherImpl.write0(Native Method)
                at java.base/sun.nio.ch.SocketDispatcher.write(Unknown Source)
                at java.base/sun.nio.ch.IOUtil.writeFromNativeBuffer(Unknown Source)
                at java.base/sun.nio.ch.IOUtil.write(Unknown Source)
                at java.base/sun.nio.ch.IOUtil.write(Unknown Source)
                at java.base/sun.nio.ch.SocketChannelImpl.write(Unknown Source)
                at com.github.dockerjava.transport.UnixSocket$WrappedWritableByteChannel.write(UnixSocket.java:95)
                at java.base/java.nio.channels.Channels.writeFullyImpl(Unknown Source)
                at java.base/java.nio.channels.Channels.writeFully(Unknown Source)
                at java.base/java.nio.channels.Channels$1.write(Unknown Source)
                at org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection$1.write(DefaultBHttpClientConnection.java:232)
                at org.apache.hc.core5.http.impl.io.SessionOutputBufferImpl.flushBuffer(SessionOutputBufferImpl.java:117)
                at org.apache.hc.core5.http.impl.io.SessionOutputBufferImpl.writeLine(SessionOutputBufferImpl.java:204)
                at org.apache.hc.core5.http.impl.io.ChunkedOutputStream.flushCache(ChunkedOutputStream.java:126)
                at org.apache.hc.core5.http.impl.io.ChunkedOutputStream.finish(ChunkedOutputStream.java:184)
                at org.apache.hc.core5.http.impl.io.ChunkedOutputStream.close(ChunkedOutputStream.java:245)
                at org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection.sendRequestEntity(DefaultBHttpClientConnection.java:254)
java.io.IOException: Connection reset by peer
        at java.base/sun.nio.ch.FileDispatcherImpl.write0(Native Method)
        at java.base/sun.nio.ch.SocketDispatcher.write(Unknown Source)
        at java.base/sun.nio.ch.IOUtil.writeFromNativeBuffer(Unknown Source)
        at java.base/sun.nio.ch.IOUtil.write(Unknown Source)
        at java.base/sun.nio.ch.IOUtil.write(Unknown Source)
        at java.base/sun.nio.ch.SocketChannelImpl.write(Unknown Source)
        at com.github.dockerjava.transport.UnixSocket$WrappedWritableByteChannel.write(UnixSocket.java:95)
        at java.base/java.nio.channels.Channels.writeFullyImpl(Unknown Source)
        at java.base/java.nio.channels.Channels.writeFully(Unknown Source)
        at java.base/java.nio.channels.Channels$1.write(Unknown Source)
        at org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection$1.write(DefaultBHttpClientConnection.java:232)
        at org.apache.hc.core5.http.impl.io.SessionOutputBufferImpl.flushBuffer(SessionOutputBufferImpl.java:117)
        at org.apache.hc.core5.http.impl.io.SessionOutputBufferImpl.write(SessionOutputBufferImpl.java:150)
        at org.apache.hc.core5.http.impl.io.SessionOutputBufferImpl.write(SessionOutputBufferImpl.java:162)
        at org.apache.hc.core5.http.impl.io.SessionOutputBufferImpl.writeLine(SessionOutputBufferImpl.java:213)
        at org.apache.hc.core5.http.impl.io.ChunkedOutputStream.flushCacheWithAppend(ChunkedOutputStream.java:145)
        at org.apache.hc.core5.http.impl.io.ChunkedOutputStream.write(ChunkedOutputStream.java:222)
        at org.apache.hc.core5.http.io.entity.InputStreamEntity.writeTo(InputStreamEntity.java:96)
        at org.apache.hc.client5.http.impl.classic.RequestEntityProxy.writeTo(RequestEntityProxy.java:106)
        at org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection.sendRequestEntity(DefaultBHttpClientConnection.java:253)
        at org.apache.hc.core5.http.impl.io.HttpRequestExecutor.execute(HttpRequestExecutor.java:141)
        at com.github.dockerjava.httpclient5.HijackingHttpRequestExecutor.execute(HijackingHttpRequestExecutor.java:50)
        at org.apache.hc.core5.http.impl.io.HttpRequestExecutor.execute(HttpRequestExecutor.java:218)
        at org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager$InternalConnectionEndpoint.execute(PoolingHttpClientConnectionManager.java:717)
        at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.execute(InternalExecRuntime.java:216)
        at org.apache.hc.client5.http.impl.classic.MainClientExec.execute(MainClientExec.java:116)
        at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
        at org.apache.hc.client5.http.impl.classic.ConnectExec.execute(ConnectExec.java:188)
        at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
        at org.apache.hc.client5.http.impl.classic.ProtocolExec.execute(ProtocolExec.java:192)
        at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
        at org.apache.hc.client5.http.impl.classic.HttpRequestRetryExec.execute(HttpRequestRetryExec.java:113)
        at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
        at org.apache.hc.client5.http.impl.classic.ContentCompressionExec.execute(ContentCompressionExec.java:152)
        at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
        at org.apache.hc.client5.http.impl.classic.RedirectExec.execute(RedirectExec.java:116)
        at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
        at org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:170)
        at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:87)
        at com.github.dockerjava.httpclient5.ApacheDockerHttpClientImpl.execute(ApacheDockerHttpClientImpl.java:191)
Caused: java.lang.RuntimeException
        at com.github.dockerjava.httpclient5.ApacheDockerHttpClientImpl.execute(ApacheDockerHttpClientImpl.java:195)
        at com.github.dockerjava.httpclient5.ApacheDockerHttpClient.execute(ApacheDockerHttpClient.java:9)
        at com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:228)
        at com.github.dockerjava.core.DefaultInvocationBuilder.put(DefaultInvocationBuilder.java:223)
        at com.github.dockerjava.core.exec.CopyArchiveToContainerCmdExec.execute(CopyArchiveToContainerCmdExec.java:34)
        at com.github.dockerjava.core.exec.CopyArchiveToContainerCmdExec.execute(CopyArchiveToContainerCmdExec.java:13)
        at com.github.dockerjava.core.exec.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:21)
        at com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:33)
        at com.github.dockerjava.core.command.CopyArchiveToContainerCmdImpl.exec(CopyArchiveToContainerCmdImpl.java:150)
        at io.jenkins.docker.connector.DockerComputerConnector.injectRemotingJar(DockerComputerConnector.java:155)
        at io.jenkins.docker.connector.DockerComputerAttachConnector.beforeContainerStarted(DockerComputerAttachConnector.java:175)
        at com.nirima.jenkins.plugins.docker.DockerTemplate.doProvisionNode(DockerTemplate.java:754)
        at com.nirima.jenkins.plugins.docker.DockerTemplate.provisionNode(DockerTemplate.java:686)
        at com.nirima.jenkins.plugins.docker.DockerCloud$1.run(DockerCloud.java:414)
        at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
        at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
        at jenkins.util.ErrorLoggingExecutorService.lambda$wrap$0(ErrorLoggingExecutorService.java:51)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)

When I try to change the image to jenkins/agent, the agent container can also start.

2024-05-18 16:37:21.500+0000 [id=579]   INFO    c.n.j.plugins.docker.DockerCloud#provision: Will provision 'jenkins/agent', for label: 'python3', in cloud: 'Local Docker'
2024-05-18 16:37:21.503+0000 [id=580]   INFO    c.n.j.p.docker.DockerTemplate#pullImage: Pulling image 'jenkins/agent:latest'. This may take awhile...
2024-05-18 16:37:24.092+0000 [id=580]   INFO    c.n.j.p.docker.DockerTemplate#pullImage: Finished pulling image 'jenkins/agent:latest', took 2588 ms
2024-05-18 16:37:24.094+0000 [id=580]   INFO    c.n.j.p.docker.DockerTemplate#doProvisionNode: Trying to run container for image "jenkins/agent"
2024-05-18 16:37:24.094+0000 [id=580]   INFO    c.n.j.p.docker.DockerTemplate#doProvisionNode: Trying to run container for node python3-agent-0001a2ads449d from image: jenkins/agent
2024-05-18 16:37:24.137+0000 [id=580]   INFO    c.n.j.p.docker.DockerTemplate#doProvisionNode: Started container ID 204ad62d99a6af3f2801a442c714c190e152eef1be00b9c625d20c2a99b2bdc6 for node python3-agent-0001a2ads449d from image: jenkins/agent
2024-05-18 16:37:24.890+0000 [id=579]   INFO    i.j.d.c.DockerMultiplexedInputStream#readInternal: stderr from python3-agent-0001a2ads449d (204ad62d99a6af3f2801a442c714c190e152eef1be00b9c625d20c2a99b2bdc6): May 18, 2024 4:37:24 PM org.jenkinsci.remoting.engine.WorkDirManager setupLogging
INFO: Using /home/jenkins/agent/agent.log as an agent error log destination; output log will not be generated
2024-05-18 16:37:24.963+0000 [id=585]   INFO    i.j.d.c.DockerMultiplexedInputStream#readInternal: stderr from python3-agent-0001a2ads449d (204ad62d99a6af3f2801a442c714c190e152eef1be00b9c625d20c2a99b2bdc6): channel started
2024-05-18 16:37:29.082+0000 [id=580]   INFO    i.j.docker.DockerTransientNode$1#println: Disconnected computer for node 'python3-agent-0001a2ads449d'.
2024-05-18 16:37:29.109+0000 [id=580]   INFO    i.j.docker.DockerTransientNode$1#println: Removed Node for node 'python3-agent-0001a2ads449d'.
2024-05-18 16:37:31.542+0000 [id=36]    INFO    hudson.slaves.NodeProvisioner#update: python3-agent (jenkins/agent) provisioning successfully completed. We have now 3 computer(s)
2024-05-18 16:37:32.331+0000 [id=591]   INFO    i.j.d.c.DockerMultiplexedInputStream#readInternal: stderr from python3-agent-0001a2ads449d (204ad62d99a6af3f2801a442c714c190e152eef1be00b9c625d20c2a99b2bdc6): May 18, 2024 4:37:32 PM org.jenkinsci.remoting.engine.WorkDirManager setupLogging

May you see the error, but that is a problem from my pipeline, not the agent. Agent was provisioned and running as well

Does anyone know what happens with the JNLP agent? Did I get some misconfiguration?
Thank

This is a docker setting

Hello and welcome to this community, @tatdatpham. :wave:

What kind of machine (CPU) are you running that on?

Hi @poddingue ,

I am using xeon Intel x86

processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 134
model name : Intel Xeon Processor (Icelake)
stepping : 0
microcode : 0x1
cpu MHz : 2194.824
cache size : 16384 KB

I have another machine test that is running on the EC2 instance. Both of them are running Rocky OS

1 Like

Thanks.
I was suspecting a platform problem, as the jnlp agent docker image is not available for aarch64 but my hypothesis was wrong.

yes, you are correct; I have built a new agent for Maven and NodeJs based on the Jenkins/agent image. Then it worked.

1 Like