Container cannot connect to node because it doesn't exist
See original GitHub issueWe recently updated our version of Jenkins to 2.176.3. And now a connection error with docker-agent randomly block the queue of jobs :
Refusing headers from remote: Unknown client name: docker-00026wu6nor9w
The docker container is ready and try to connect to the Jenkins master but the node doesn’t exist yet.
I saw in the code of docker-plugin that the container is created and started before the Jenkins node. While the connection method is JNLP, the commands to download and run the remoting.jar are executed at the start of the container. But at this moment, the node wasn’t added to Jenkins master.
Have you ever encountered this error? Is there a solution?
Is it possible to modify provision methods and create the Jenkins node before instanciate the container to fix this issue?
Jenkins version : 2.176.3 docker-plugin version : 1.1.7 docker engine version : 1.13.1
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (9 by maintainers)

Top Related StackOverflow Question
As for fixing the problem you saw with JNLP, it may be curable by changing the plugin code, but it’s a tricky one. It’s tricky because, until the container has started, we don’t know everything we need to know about the slave node we return to Jenkins … but, if the container runs very quickly and has no retry logic inside it then we need to pass the slave node to Jenkins before we start the container. i.e. both events have reasons why they need to happen before the other one…
It’s the newest option. When it was originally introduced it had a bug (#628) that caused it to fail sometimes if the network wasn’t perfect between Jenkins & docker, but that’s now been fixed (in PR #693). I am not aware of there being any other problems with it, but it hasn’t had the same number of years of use that the other methods have.
I would suggest that you continue to use it and, if you do find bugs, you raise a bug report (providing awesome levels of clarity to make it easy to fix) … and ideally also follow that with a PR that fixes the issue too.