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

Cant create SSH slave without credentials-id

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I am using the REST API to create a SSH slave using a username/privatekey (and not a credentials-id, doesn't match my use case).

      The request looks like:

      {{
      https://integration.wikimedia.org/ci/computer/doCreateItem?
      json=
      {
      "labelString": "ci-jessie-wikimedia",
      "launcher":

      { "host": "10.68.17.84", "port": 22, "privatekey": "/var/lib/nodepool/.ssh/nodepoolmanager_id_rsa", "stapler-class": "hudson.plugins.sshslaves.SSHLauncher", "username": "nodepoolmanager" }

      ,
      "mode": "EXCLUSIVE",
      "name": "ci-jessie-wikimedia-33",
      "nodeDescription": "Dynamic single use ci-jessie-wikimedia node",
      "nodeProperties":

      { "stapler-class-bag": "true" }

      ,
      "numExecutors": 1,
      "remoteFS": "/home/jenkins",
      "retentionStrategy":

      { "stapler-class": "hudson.slaves.RetentionStrategy$Always" }

      ,
      "type": "hudson.slaves.DumbSlave$DescriptorImpl"
      }
      &type=hudson.slaves.DumbSlave$
      DescriptorImpl&name=ci-jessie-wikimedia-33
      }}

      There is a NPE somewhere between the credentials plugin and the sshslaves plugin:
      {{
      Caused by: java.lang.NullPointerException
      at com.cloudbees.plugins.credentials.matchers.IdMatcher.<init>(IdMatcher.java:49)
      at com.cloudbees.plugins.credentials.CredentialsMatchers.withId(CredentialsMatchers.java:112)
      at hudson.plugins.sshslaves.SSHLauncher.lookupSystemCredentials(SSHLauncher.java:291)
      at hudson.plugins.sshslaves.SSHLauncher.<init>(SSHLauncher.java:268)
      }}

      The code state that a NPE is raised. Seems there is no way to create a SSH slave without a credentials-id which is rather annoying

      Downstream bug: https://phabricator.wikimedia.org/T103120

        Attachments

          Activity

          Hide
          jglick Jesse Glick added a comment -

          SSH Slaves are configured with an SSH private key or username/password credentials ID. To create the slave, you must first create the credentials.

          Show
          jglick Jesse Glick added a comment - SSH Slaves are configured with an SSH private key or username/password credentials ID. To create the slave, you must first create the credentials.

            People

            • Assignee:
              stephenconnolly Stephen Connolly
              Reporter:
              hashar Antoine Musso
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: