Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-17539

Swarm clients fail to connect if GitHub for authentication

      We use swarm plugin to manage slaves. No we decided to use github-oauth2 and cant get slaves to work with it,

          [JENKINS-17539] Swarm clients fail to connect if GitHub for authentication

          kofemann created issue -

          Jeff Koenig added a comment -

          I also have this issue. Could we potentially use the jenkins API to authenticate around this?

          Jeff Koenig added a comment - I also have this issue. Could we potentially use the jenkins API to authenticate around this?

          sogabe added a comment -

          any logs?

          sogabe added a comment - any logs?

          Jeff Koenig added a comment -

          If I try to use the API key like this...

          $ java -jar swarm-client-1.9-jar-with-dependencies.jar -master 'http://<server>:8080' -username <username> -password <api_key>
          Discovering Jenkins master
          Aug 13, 2013 12:00:29 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
          INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection refused
          Aug 13, 2013 12:00:29 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
          INFO: Retrying request
          

          otherwise if you don't specify a username or password...

          $ java -jar swarm-client-1.9-jar-with-dependencies.jar -master 'http://50.16.76.207:8080'
          Discovering Jenkins master
          Aug 13, 2013 12:04:33 PM org.apache.commons.httpclient.HttpMethodDirector authenticateHost
          WARNING: Required credentials not available for BASIC <any realm>@50.16.76.207:8080
          Aug 13, 2013 12:04:33 PM org.apache.commons.httpclient.HttpMethodDirector authenticateHost
          WARNING: Preemptive authentication requested but no default credentials available
          

          I am able to get the swarm secret key using the api key and curl like this...

          curl http://<username>:<api_key>@<server>:8080/plugin/swarm/slaveInfo
          

          Jeff Koenig added a comment - If I try to use the API key like this... $ java -jar swarm-client-1.9-jar-with-dependencies.jar -master 'http://<server>:8080' -username <username> -password <api_key> Discovering Jenkins master Aug 13, 2013 12:00:29 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection refused Aug 13, 2013 12:00:29 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry INFO: Retrying request otherwise if you don't specify a username or password... $ java -jar swarm-client-1.9-jar-with-dependencies.jar -master 'http://50.16.76.207:8080' Discovering Jenkins master Aug 13, 2013 12:04:33 PM org.apache.commons.httpclient.HttpMethodDirector authenticateHost WARNING: Required credentials not available for BASIC <any realm>@50.16.76.207:8080 Aug 13, 2013 12:04:33 PM org.apache.commons.httpclient.HttpMethodDirector authenticateHost WARNING: Preemptive authentication requested but no default credentials available I am able to get the swarm secret key using the api key and curl like this... curl http://<username>:<api_key>@<server>:8080/plugin/swarm/slaveInfo

          Jeff Koenig added a comment -

          Since this wasn't working for me, I came up with an alternative solution to using the swarm plugin. This solution doesn't have any plugin dependencies, and just uses the jenkins api to connect slaves.

          https://github.com/jkoenig311/jenkins_slave_connector

          Jeff Koenig added a comment - Since this wasn't working for me, I came up with an alternative solution to using the swarm plugin. This solution doesn't have any plugin dependencies, and just uses the jenkins api to connect slaves. https://github.com/jkoenig311/jenkins_slave_connector

          I am having this issue as well. Any progress on it?

          Hans-Christian Otto added a comment - I am having this issue as well. Any progress on it?

          I think this issue is resolved with v20.
          I ask @Sam to have a look again before mark it resolve

          Atish Narlawar added a comment - I think this issue is resolved with v20. I ask @Sam to have a look again before mark it resolve

          Cervator added a comment -

          Just encountered this - same situation, same logging, Jenkins Master v1.595 with GitHub OAuth enabled, new master-slave security stuff not enabled. Tried v19, 20, 21, 22, same result with each. Any updates or possible resolution?

          I can custom code something but when this setup works it is sooo easy

          I tried a few different scenarios (only with v22 for some combinations, seems same anyway) and got it working using the built-in-user security enabled with Anonymous given full slave rights + overall read access (no user/pass on swarm launch). But that doesn't help with GitHub OAuth since you do not get those checkboxes. It actually also gets the two WARNINGS from above, three times in total, but does connect.

          With GitHub OAth enabled I've got "Grant READ permissions for Anonymous Users" checked but it isn't enough. Creating a slave manually and connecting via the string including the -secret parameter works fine.

          Cervator added a comment - Just encountered this - same situation, same logging, Jenkins Master v1.595 with GitHub OAuth enabled, new master-slave security stuff not enabled. Tried v19, 20, 21, 22, same result with each. Any updates or possible resolution? I can custom code something but when this setup works it is sooo easy I tried a few different scenarios (only with v22 for some combinations, seems same anyway) and got it working using the built-in-user security enabled with Anonymous given full slave rights + overall read access (no user/pass on swarm launch). But that doesn't help with GitHub OAuth since you do not get those checkboxes. It actually also gets the two WARNINGS from above, three times in total, but does connect. With GitHub OAth enabled I've got "Grant READ permissions for Anonymous Users" checked but it isn't enough. Creating a slave manually and connecting via the string including the -secret parameter works fine.

          Cervator added a comment -

          Slight correction: I mean I tried the swarm plugin jar v19-22. I was at GitHub OAuth v19, but updating it to v20 didn't change anything

          Cervator added a comment - Slight correction: I mean I tried the swarm plugin jar v19-22. I was at GitHub OAuth v19, but updating it to v20 didn't change anything

          Ryan Walls added a comment -

          Any updates on this issue?

          Ryan Walls added a comment - Any updates on this issue?

            sag47 Sam Gleske
            kofemann kofemann
            Votes:
            5 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: