-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Container cannot connect to node because it doesn't exist #757
Comments
We are actually testing "Attach Docker container" wich seems to be a solution. But, in the documentation of the plugin, this functionnality is marked as experimental. Is this still the case ? |
It's the newest option. 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. |
As for fixing the problem you saw with JNLP, it may be curable by changing the plugin code, but it's a tricky one. |
Thank you for your help. I tried to change code by myself and indeed, it is tricky and have a lot of impacts on others methods of connection. |
@pjdarton can you point me in the direction of this fix? I wasn't able to find it in jenkins jira.
|
I've updated my comment (above) to include links. |
I've seen other exceptions while using Attach, so I'm sticking with JNLP. For the record, I am using this workaround for this "node doesn't exist" problem with JNLP, and it's (so far) more reliable than Attach. |
So, I've been thinking ... and I suspect that there may be a few things we can do to improve this.
In parallel with that, we:
Disclaimer: When I say "we" I don't mean I'm promising to drive this myself (I've got a ton of not-docker-plugin work to do so I'm going to have to keep my time on this to a minimum) and, as you've got a decent workaround that works for you, I'm not really expecting you to do it either ... but if anyone has the time & inclination to sort this then I am happy to discuss/consult/advise/review changes. Re: "I've seen other exceptions while using Attach" |
@pjdarton, is there a work in progress on an update of JNLP connection ? createContainer --> addNode --> startContainer. I would like your opinion on it. |
Yes, I agree that what we need is to "add node" before the container starts ... but for JNLP only (e.g. for SSH we add the node after the container has started and its SSH port is open for business). As for "progress", my only "progress" on this was to post my thoughts on the subject (above). Been too busy on other things. ...but, just to set expectations: I'm off soon, just 2 working days left this year (with those already 100% committed to other tasks), so I'm unlikely to do much until mid-Jan at the earliest. |
@pjdarton, |
Refactor DockerTransientNode constructor so the launcher is provided post-construction. Refactor DockerComputerConnector.beforeContainerStarted(...) so it takes a node (that holds a containerId) instead of a containerId. Refactor DockerTemplate.doProvision(...) so that the DockerTransientNode is created without a launcher before we start the container. Enhance DockerComputerJNLPConnector so that it adds the node to Jenkins immediately before the container is created, ensuring that it'll be known to Jenkins (just) before the JNLP process starts.
Refactor DockerComputerConnector.beforeContainerStarted(...) and afterContainerStarted(...) so it takes a node (that holds a containerId) instead of a containerId. Refactor DockerTransientNode constructors so the launcher can be provided post-construction. Refactor DockerTemplate.doProvision(...) so that the DockerTransientNode is created without a launcher before we start the container and the launcher is only set after the container is started. Enhance DockerComputerJNLPConnector so that it adds the node to Jenkins immediately before the container is created, ensuring that it'll be known to Jenkins (just) before the JNLP process starts.
Refactor DockerComputerConnector.beforeContainerStarted(...) and afterContainerStarted(...) so it takes a node (that holds a containerId) instead of a containerId. Refactor DockerTransientNode constructors so the launcher can be provided post-construction. Refactor DockerTemplate.doProvision(...) so that the DockerTransientNode is created without a launcher before we start the container and the launcher is only set after the container is started. Enhance DockerComputerJNLPConnector so that it adds the node to Jenkins immediately before the container is created, ensuring that it'll be known to Jenkins (just) before the JNLP process starts.
We 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
The text was updated successfully, but these errors were encountered: