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

Cant create SSH slave without credentials-id

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Critical Critical
    • ssh-slaves-plugin
    • Jenkins 1.596.2
      SSH credentials 1.11
      SSH Slaves 1.9
      Credentials 1.22

      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

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

              Created:
              Updated:
              Resolved: