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










5















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) `









share|improve this question
























  • 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















5















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) `









share|improve this question
























  • 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













5












5








5


1






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) `









share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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

















  • 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












2 Answers
2






active

oldest

votes


















5














Didn't find an answer. But ended-up selecting the connect method to attach docker containerin Docker template for docker plugin which in-turn made it work.






share|improve this answer






























    1














    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 the LogLevel under /etc/ssh/sshd_config to VERBOSE to make all the details of ssh login attempts saved in /var/log/auth.log file where you can identify the issue






    share|improve this answer

























    • 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










    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
    );



    );













    draft saved

    draft discarded


















    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









    5














    Didn't find an answer. But ended-up selecting the connect method to attach docker containerin Docker template for docker plugin which in-turn made it work.






    share|improve this answer



























      5














      Didn't find an answer. But ended-up selecting the connect method to attach docker containerin Docker template for docker plugin which in-turn made it work.






      share|improve this answer

























        5












        5








        5







        Didn't find an answer. But ended-up selecting the connect method to attach docker containerin Docker template for docker plugin which in-turn made it work.






        share|improve this answer













        Didn't find an answer. But ended-up selecting the connect method to attach docker containerin Docker template for docker plugin which in-turn made it work.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 7 at 7:22









        UppiUppi

        3842323




        3842323























            1














            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 the LogLevel under /etc/ssh/sshd_config to VERBOSE to make all the details of ssh login attempts saved in /var/log/auth.log file where you can identify the issue






            share|improve this answer

























            • 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















            1














            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 the LogLevel under /etc/ssh/sshd_config to VERBOSE to make all the details of ssh login attempts saved in /var/log/auth.log file where you can identify the issue






            share|improve this answer

























            • 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













            1












            1








            1







            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 the LogLevel under /etc/ssh/sshd_config to VERBOSE to make all the details of ssh login attempts saved in /var/log/auth.log file where you can identify the issue






            share|improve this answer















            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 the LogLevel under /etc/ssh/sshd_config to VERBOSE to make all the details of ssh login attempts saved in /var/log/auth.log file where you can identify the issue







            share|improve this answer














            share|improve this answer



            share|improve this answer








            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

















            • 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

















            draft saved

            draft discarded
















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

            2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived

            Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme