Jenkins cannot launch docker slave using docker plugin2019 Community Moderator ElectionHow to restart Jenkins manually?How is Docker different from a virtual machine?Should I use Vagrant or Docker for creating an isolated environment?How to remove old Docker containersJenkins: running build does not provision docker slaveJenkins docker plugin with docker slavesJenkins Docker Plugin does not seem to be provisioning slave containers for Jenkins buildsJenkins: connection between docker container with jenkins master and docker container with jenkins slavecould configure jenkins slave in docker container from jenkins server in dockerJenkins Workspace not visible on docker slaves
How to test the sharpness of a knife?
Fair way to split coins
PTIJ: Why do we make a Lulav holder?
Did Nintendo change its mind about 68000 SNES?
How can a new country break out from a developed country without war?
Can other pieces capture a threatening piece and prevent a checkmate?
Have the tides ever turned twice on any open problem?
Exit shell with shortcut (not typing exit) that closes session properly
Pre-Employment Background Check With Consent For Future Checks
Justification failure in beamer enumerate list
How to balance a monster modification (zombie)?
Symbolism of 18 Journeyers
Knife as defense against stray dogs
Help with identifying unique aircraft over NE Pennsylvania
Does the Shadow Magic sorcerer's Eyes of the Dark feature work on all Darkness spells or just his/her own?
Why is indicated airspeed rather than ground speed used during the takeoff roll?
Why is there so much iron?
Is this Pascal's Matrix?
Emojional cryptic crossword
Why are there no stars visible in cislunar space?
Do people actually use the word "kaputt" in conversation?
What (if any) is the reason to buy in small local stores?
Why do I have a large white artefact on the rendered image?
What is the tangent at a sharp point on a curve?
Jenkins cannot launch docker slave using docker plugin
2019 Community Moderator ElectionHow to restart Jenkins manually?How is Docker different from a virtual machine?Should I use Vagrant or Docker for creating an isolated environment?How to remove old Docker containersJenkins: running build does not provision docker slaveJenkins docker plugin with docker slavesJenkins Docker Plugin does not seem to be provisioning slave containers for Jenkins buildsJenkins: connection between docker container with jenkins master and docker container with jenkins slavecould configure jenkins slave in docker container from jenkins server in dockerJenkins Workspace not visible on docker slaves
I am using Jenkins Docker plugin to launch slaves dynamically on the docker host. Jenkins master runs on the same host. When building, it picks a random port on the docker-host and cannot connect to it. It launches docker containers. Here are the logs. Doesn't say more than this. How to debug the issue?
INFO: Started container ID 54fe5780ca820a6e2b7cae40610cfc3229dbf889b0c66d6e34a39b74e13aaec7 for node slave-0000w16w841rc from image: jenkinsubuntu
Feb 28, 2019 9:35:54 PM com.nirima.jenkins.plugins.docker.utils.PortUtils$ConnectionCheckSSH execute
INFO: SSH port is open on 127.0.0.1:10007
[02/28/19 21:35:54] SSH Launch of slave-0000w16w841rc on 127.0.0.1 failed in 29 ms
Feb 28, 2019 9:36:03 PM hudson.slaves.NodeProvisioner$2 run
INFO: Image of jenkinsubuntu provisioning successfully completed. We have now 7 computer(s) `
docker jenkins jenkins-plugins centos7
add a comment |
I am using Jenkins Docker plugin to launch slaves dynamically on the docker host. Jenkins master runs on the same host. When building, it picks a random port on the docker-host and cannot connect to it. It launches docker containers. Here are the logs. Doesn't say more than this. How to debug the issue?
INFO: Started container ID 54fe5780ca820a6e2b7cae40610cfc3229dbf889b0c66d6e34a39b74e13aaec7 for node slave-0000w16w841rc from image: jenkinsubuntu
Feb 28, 2019 9:35:54 PM com.nirima.jenkins.plugins.docker.utils.PortUtils$ConnectionCheckSSH execute
INFO: SSH port is open on 127.0.0.1:10007
[02/28/19 21:35:54] SSH Launch of slave-0000w16w841rc on 127.0.0.1 failed in 29 ms
Feb 28, 2019 9:36:03 PM hudson.slaves.NodeProvisioner$2 run
INFO: Image of jenkinsubuntu provisioning successfully completed. We have now 7 computer(s) `
docker jenkins jenkins-plugins centos7
Are you able to connect to docker host from jenkins host. Looks like there may be 2 issues. Either the connectivity to docker host or the authentication of jenkins with docker host. Is that verified ??
– ygbgames
Feb 26 at 21:34
@ygbgames Pretty sure it has access to the docker host. But like you were saying , authentication with docker host? Which authentication are we talking about ?
– Uppi
Feb 27 at 1:22
If it is trying ssh then it should be ssh key based authentication
– ygbgames
Feb 27 at 2:37
Can you show us the definition of the 'jenkinsubuntu' image? And, what version of Jenkins are you using?
– Andreas Lorenzen
Mar 7 at 0:35
add a comment |
I am using Jenkins Docker plugin to launch slaves dynamically on the docker host. Jenkins master runs on the same host. When building, it picks a random port on the docker-host and cannot connect to it. It launches docker containers. Here are the logs. Doesn't say more than this. How to debug the issue?
INFO: Started container ID 54fe5780ca820a6e2b7cae40610cfc3229dbf889b0c66d6e34a39b74e13aaec7 for node slave-0000w16w841rc from image: jenkinsubuntu
Feb 28, 2019 9:35:54 PM com.nirima.jenkins.plugins.docker.utils.PortUtils$ConnectionCheckSSH execute
INFO: SSH port is open on 127.0.0.1:10007
[02/28/19 21:35:54] SSH Launch of slave-0000w16w841rc on 127.0.0.1 failed in 29 ms
Feb 28, 2019 9:36:03 PM hudson.slaves.NodeProvisioner$2 run
INFO: Image of jenkinsubuntu provisioning successfully completed. We have now 7 computer(s) `
docker jenkins jenkins-plugins centos7
I am using Jenkins Docker plugin to launch slaves dynamically on the docker host. Jenkins master runs on the same host. When building, it picks a random port on the docker-host and cannot connect to it. It launches docker containers. Here are the logs. Doesn't say more than this. How to debug the issue?
INFO: Started container ID 54fe5780ca820a6e2b7cae40610cfc3229dbf889b0c66d6e34a39b74e13aaec7 for node slave-0000w16w841rc from image: jenkinsubuntu
Feb 28, 2019 9:35:54 PM com.nirima.jenkins.plugins.docker.utils.PortUtils$ConnectionCheckSSH execute
INFO: SSH port is open on 127.0.0.1:10007
[02/28/19 21:35:54] SSH Launch of slave-0000w16w841rc on 127.0.0.1 failed in 29 ms
Feb 28, 2019 9:36:03 PM hudson.slaves.NodeProvisioner$2 run
INFO: Image of jenkinsubuntu provisioning successfully completed. We have now 7 computer(s) `
docker jenkins jenkins-plugins centos7
docker jenkins jenkins-plugins centos7
edited Mar 7 at 13:41
Ali
80211129
80211129
asked Feb 26 at 18:37
UppiUppi
3842323
3842323
Are you able to connect to docker host from jenkins host. Looks like there may be 2 issues. Either the connectivity to docker host or the authentication of jenkins with docker host. Is that verified ??
– ygbgames
Feb 26 at 21:34
@ygbgames Pretty sure it has access to the docker host. But like you were saying , authentication with docker host? Which authentication are we talking about ?
– Uppi
Feb 27 at 1:22
If it is trying ssh then it should be ssh key based authentication
– ygbgames
Feb 27 at 2:37
Can you show us the definition of the 'jenkinsubuntu' image? And, what version of Jenkins are you using?
– Andreas Lorenzen
Mar 7 at 0:35
add a comment |
Are you able to connect to docker host from jenkins host. Looks like there may be 2 issues. Either the connectivity to docker host or the authentication of jenkins with docker host. Is that verified ??
– ygbgames
Feb 26 at 21:34
@ygbgames Pretty sure it has access to the docker host. But like you were saying , authentication with docker host? Which authentication are we talking about ?
– Uppi
Feb 27 at 1:22
If it is trying ssh then it should be ssh key based authentication
– ygbgames
Feb 27 at 2:37
Can you show us the definition of the 'jenkinsubuntu' image? And, what version of Jenkins are you using?
– Andreas Lorenzen
Mar 7 at 0:35
Are you able to connect to docker host from jenkins host. Looks like there may be 2 issues. Either the connectivity to docker host or the authentication of jenkins with docker host. Is that verified ??
– ygbgames
Feb 26 at 21:34
Are you able to connect to docker host from jenkins host. Looks like there may be 2 issues. Either the connectivity to docker host or the authentication of jenkins with docker host. Is that verified ??
– ygbgames
Feb 26 at 21:34
@ygbgames Pretty sure it has access to the docker host. But like you were saying , authentication with docker host? Which authentication are we talking about ?
– Uppi
Feb 27 at 1:22
@ygbgames Pretty sure it has access to the docker host. But like you were saying , authentication with docker host? Which authentication are we talking about ?
– Uppi
Feb 27 at 1:22
If it is trying ssh then it should be ssh key based authentication
– ygbgames
Feb 27 at 2:37
If it is trying ssh then it should be ssh key based authentication
– ygbgames
Feb 27 at 2:37
Can you show us the definition of the 'jenkinsubuntu' image? And, what version of Jenkins are you using?
– Andreas Lorenzen
Mar 7 at 0:35
Can you show us the definition of the 'jenkinsubuntu' image? And, what version of Jenkins are you using?
– Andreas Lorenzen
Mar 7 at 0:35
add a comment |
2 Answers
2
active
oldest
votes
Didn't find an answer. But ended-up selecting the connect method to attach docker container
in Docker template for docker plugin which in-turn made it work.
add a comment |
Although you have posted an alternative way but here what you should do and be aware about as you asked about how to debug the issue
- You need an image that contains
SSHD
and the plugin's documentation advises to use jenkins/ssh-slave as a base for your custom image. - According to the log you provided it seems that you use a custom image called
jenkinsubuntu
assuming that image based on jenkins/ssh-slave then you need to make sure that you didn't override the original entrypoint as described in the documentation:
Avoid overriding the docker command, as SSH Launcher relies on it.
You can use an Entrypoint to run some side service inside your build agent container before the agent runtime starts and establish a connexion. Just ensure your entrypoint eventually run the passed command :
exec "$@"
Lastly make sure that the host where the ssh will takes place contains a private key that matches the public key that was injected inside the container.
If the first and the second point was taken care of then here is what to you should do to debug the ssh problem.
- You can login try to login to the same container using ssh while its running.
- If the previous step worked then check the log either using
docker logs
or by checking/var/log
, note that you may need to change theLogLevel
under/etc/ssh/sshd_config
toVERBOSE
to make all the details of ssh login attempts saved in/var/log/auth.log
file where you can identify the issue
Thanks Mostafa. I based the current image on ssh-slave image . I will try to change the log level and see what it tells me.
– Uppi
Mar 7 at 19:00
@Uppi are you trying to login with root user ?
– Mostafa Hussein
Mar 7 at 19:28
No , The user is Jenkins
– Uppi
Mar 8 at 1:32
Have you changed the log level or not yet?
– Mostafa Hussein
Mar 8 at 4:10
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54892037%2fjenkins-cannot-launch-docker-slave-using-docker-plugin%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Didn't find an answer. But ended-up selecting the connect method to attach docker container
in Docker template for docker plugin which in-turn made it work.
add a comment |
Didn't find an answer. But ended-up selecting the connect method to attach docker container
in Docker template for docker plugin which in-turn made it work.
add a comment |
Didn't find an answer. But ended-up selecting the connect method to attach docker container
in Docker template for docker plugin which in-turn made it work.
Didn't find an answer. But ended-up selecting the connect method to attach docker container
in Docker template for docker plugin which in-turn made it work.
answered Mar 7 at 7:22
UppiUppi
3842323
3842323
add a comment |
add a comment |
Although you have posted an alternative way but here what you should do and be aware about as you asked about how to debug the issue
- You need an image that contains
SSHD
and the plugin's documentation advises to use jenkins/ssh-slave as a base for your custom image. - According to the log you provided it seems that you use a custom image called
jenkinsubuntu
assuming that image based on jenkins/ssh-slave then you need to make sure that you didn't override the original entrypoint as described in the documentation:
Avoid overriding the docker command, as SSH Launcher relies on it.
You can use an Entrypoint to run some side service inside your build agent container before the agent runtime starts and establish a connexion. Just ensure your entrypoint eventually run the passed command :
exec "$@"
Lastly make sure that the host where the ssh will takes place contains a private key that matches the public key that was injected inside the container.
If the first and the second point was taken care of then here is what to you should do to debug the ssh problem.
- You can login try to login to the same container using ssh while its running.
- If the previous step worked then check the log either using
docker logs
or by checking/var/log
, note that you may need to change theLogLevel
under/etc/ssh/sshd_config
toVERBOSE
to make all the details of ssh login attempts saved in/var/log/auth.log
file where you can identify the issue
Thanks Mostafa. I based the current image on ssh-slave image . I will try to change the log level and see what it tells me.
– Uppi
Mar 7 at 19:00
@Uppi are you trying to login with root user ?
– Mostafa Hussein
Mar 7 at 19:28
No , The user is Jenkins
– Uppi
Mar 8 at 1:32
Have you changed the log level or not yet?
– Mostafa Hussein
Mar 8 at 4:10
add a comment |
Although you have posted an alternative way but here what you should do and be aware about as you asked about how to debug the issue
- You need an image that contains
SSHD
and the plugin's documentation advises to use jenkins/ssh-slave as a base for your custom image. - According to the log you provided it seems that you use a custom image called
jenkinsubuntu
assuming that image based on jenkins/ssh-slave then you need to make sure that you didn't override the original entrypoint as described in the documentation:
Avoid overriding the docker command, as SSH Launcher relies on it.
You can use an Entrypoint to run some side service inside your build agent container before the agent runtime starts and establish a connexion. Just ensure your entrypoint eventually run the passed command :
exec "$@"
Lastly make sure that the host where the ssh will takes place contains a private key that matches the public key that was injected inside the container.
If the first and the second point was taken care of then here is what to you should do to debug the ssh problem.
- You can login try to login to the same container using ssh while its running.
- If the previous step worked then check the log either using
docker logs
or by checking/var/log
, note that you may need to change theLogLevel
under/etc/ssh/sshd_config
toVERBOSE
to make all the details of ssh login attempts saved in/var/log/auth.log
file where you can identify the issue
Thanks Mostafa. I based the current image on ssh-slave image . I will try to change the log level and see what it tells me.
– Uppi
Mar 7 at 19:00
@Uppi are you trying to login with root user ?
– Mostafa Hussein
Mar 7 at 19:28
No , The user is Jenkins
– Uppi
Mar 8 at 1:32
Have you changed the log level or not yet?
– Mostafa Hussein
Mar 8 at 4:10
add a comment |
Although you have posted an alternative way but here what you should do and be aware about as you asked about how to debug the issue
- You need an image that contains
SSHD
and the plugin's documentation advises to use jenkins/ssh-slave as a base for your custom image. - According to the log you provided it seems that you use a custom image called
jenkinsubuntu
assuming that image based on jenkins/ssh-slave then you need to make sure that you didn't override the original entrypoint as described in the documentation:
Avoid overriding the docker command, as SSH Launcher relies on it.
You can use an Entrypoint to run some side service inside your build agent container before the agent runtime starts and establish a connexion. Just ensure your entrypoint eventually run the passed command :
exec "$@"
Lastly make sure that the host where the ssh will takes place contains a private key that matches the public key that was injected inside the container.
If the first and the second point was taken care of then here is what to you should do to debug the ssh problem.
- You can login try to login to the same container using ssh while its running.
- If the previous step worked then check the log either using
docker logs
or by checking/var/log
, note that you may need to change theLogLevel
under/etc/ssh/sshd_config
toVERBOSE
to make all the details of ssh login attempts saved in/var/log/auth.log
file where you can identify the issue
Although you have posted an alternative way but here what you should do and be aware about as you asked about how to debug the issue
- You need an image that contains
SSHD
and the plugin's documentation advises to use jenkins/ssh-slave as a base for your custom image. - According to the log you provided it seems that you use a custom image called
jenkinsubuntu
assuming that image based on jenkins/ssh-slave then you need to make sure that you didn't override the original entrypoint as described in the documentation:
Avoid overriding the docker command, as SSH Launcher relies on it.
You can use an Entrypoint to run some side service inside your build agent container before the agent runtime starts and establish a connexion. Just ensure your entrypoint eventually run the passed command :
exec "$@"
Lastly make sure that the host where the ssh will takes place contains a private key that matches the public key that was injected inside the container.
If the first and the second point was taken care of then here is what to you should do to debug the ssh problem.
- You can login try to login to the same container using ssh while its running.
- If the previous step worked then check the log either using
docker logs
or by checking/var/log
, note that you may need to change theLogLevel
under/etc/ssh/sshd_config
toVERBOSE
to make all the details of ssh login attempts saved in/var/log/auth.log
file where you can identify the issue
edited Mar 7 at 18:48
answered Mar 7 at 18:37
Mostafa HusseinMostafa Hussein
4,86731338
4,86731338
Thanks Mostafa. I based the current image on ssh-slave image . I will try to change the log level and see what it tells me.
– Uppi
Mar 7 at 19:00
@Uppi are you trying to login with root user ?
– Mostafa Hussein
Mar 7 at 19:28
No , The user is Jenkins
– Uppi
Mar 8 at 1:32
Have you changed the log level or not yet?
– Mostafa Hussein
Mar 8 at 4:10
add a comment |
Thanks Mostafa. I based the current image on ssh-slave image . I will try to change the log level and see what it tells me.
– Uppi
Mar 7 at 19:00
@Uppi are you trying to login with root user ?
– Mostafa Hussein
Mar 7 at 19:28
No , The user is Jenkins
– Uppi
Mar 8 at 1:32
Have you changed the log level or not yet?
– Mostafa Hussein
Mar 8 at 4:10
Thanks Mostafa. I based the current image on ssh-slave image . I will try to change the log level and see what it tells me.
– Uppi
Mar 7 at 19:00
Thanks Mostafa. I based the current image on ssh-slave image . I will try to change the log level and see what it tells me.
– Uppi
Mar 7 at 19:00
@Uppi are you trying to login with root user ?
– Mostafa Hussein
Mar 7 at 19:28
@Uppi are you trying to login with root user ?
– Mostafa Hussein
Mar 7 at 19:28
No , The user is Jenkins
– Uppi
Mar 8 at 1:32
No , The user is Jenkins
– Uppi
Mar 8 at 1:32
Have you changed the log level or not yet?
– Mostafa Hussein
Mar 8 at 4:10
Have you changed the log level or not yet?
– Mostafa Hussein
Mar 8 at 4:10
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54892037%2fjenkins-cannot-launch-docker-slave-using-docker-plugin%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Are you able to connect to docker host from jenkins host. Looks like there may be 2 issues. Either the connectivity to docker host or the authentication of jenkins with docker host. Is that verified ??
– ygbgames
Feb 26 at 21:34
@ygbgames Pretty sure it has access to the docker host. But like you were saying , authentication with docker host? Which authentication are we talking about ?
– Uppi
Feb 27 at 1:22
If it is trying ssh then it should be ssh key based authentication
– ygbgames
Feb 27 at 2:37
Can you show us the definition of the 'jenkinsubuntu' image? And, what version of Jenkins are you using?
– Andreas Lorenzen
Mar 7 at 0:35