continuously get this warning "Still waiting to schedule task All nodes of label ‘slave’ are offline" while trying to use Jenkins master as an Agent.

Expected behavior

I am trying to run my scripts in Jenkins via docker where I added a docker template details under Nodes and Clouds section in Manage Jenkins.
This is the cloud config i have done
image

Docker Template details

image

JenkinsFile

image

Actual behavior

I must be able to run my script from the slave machines dynamically created, but all i see it this

image

On clicking Slave i see this

image

Log details for the slave

Connecting to docker container 0fd8735dec95e6f8253222f4dc58bddd133399cfc4e275f74403d71fccb335ab, running command java -jar /home/jenkins/agent/remoting-3107.v665000b_51092.jar -noReconnect -noKeepAlive -agentLog /home/jenkins/agent/agent.log
HTTP/1.1 101 UPGRADED
Api-Version: 1.43
Connection: Upgrade
Content-Type: application/vnd.docker.raw-stream
Docker-Experimental: false
Ostype: linux
Server: Docker/24.0.2 (linux)
Upgrade: tcp
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:287)
at hudson.model.Computer.connect(Computer.java:447)
at com.nirima.jenkins.plugins.docker.strategy.DockerOnceRetentionStrategy.start(DockerOnceRetentionStrategy.java:145)
at com.nirima.jenkins.plugins.docker.strategy.DockerOnceRetentionStrategy.start(DockerOnceRetentionStrategy.java:49)
at hudson.model.AbstractCIBase.createNewComputerForNode(AbstractCIBase.java:192)
at hudson.model.AbstractCIBase.updateNewComputer(AbstractCIBase.java:221)
at jenkins.model.Jenkins.updateNewComputer(Jenkins.java:1679)
at jenkins.model.Nodes.addNode(Nodes.java:144)
at jenkins.model.Jenkins.addNode(Jenkins.java:2221)
at io.jenkins.docker.DockerTransientNode.robustlyAddToJenkins(DockerTransientNode.java:448)
at com.nirima.jenkins.plugins.docker.DockerCloud$1.run(DockerCloud.java:411)
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(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:829)
java.io.EOFException: unexpected stream termination
at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:459)
at hudson.remoting.ChannelBuilder.build(ChannelBuilder.java:404)
at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:437)
at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:404)
at io.jenkins.docker.connector.DockerComputerAttachConnector$DockerAttachLauncher.launch(DockerComputerAttachConnector.java:347)
at hudson.slaves.DelegatingComputerLauncher.launch(DelegatingComputerLauncher.java:64)
at io.jenkins.docker.connector.DockerDelegatingComputerLauncher.launch(DockerDelegatingComputerLauncher.java:46)
at hudson.slaves.SlaveComputer.lambda$_connect$0(SlaveComputer.java:298)
at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:80)
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:829)