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

Only credentials added via the snippet generator are usable

      I had an SSH credential added before starting to use the sshagent workflow step and I was unable to refer to the credential by name (JENKINS-32101) or even by ID. Not in the screenshot that it doesn't show up in the snippet generator UI either.

      When referring to a credential which was previously added (2d954d6d-9eda-444a-90ff-693df2ef3f26) with:

      node {
          sshagent(['2d954d6d-9eda-444a-90ff-693df2ef3f26']) {
              // do work here
          }
      }
      

      The workflow fails to find the credential:

      Running on master in /home/tyler/.jenkins/jobs/multipass/branches/master/workspace
      [Workflow] node {
      [Workflow] SSH Agent : Start
      FATAL: [ssh-agent] Could not find specified credentials
      [ssh-agent] Looking for ssh-agent implementation...
      [ssh-agent]   Java/JNR ssh-agent
      [ssh-agent] Started.
      [Workflow] sshagent {
      

      Workaround

      If I add the credential directly through the snippet generator, then I am able to refer to it from workflow.

          [JENKINS-32102] Only credentials added via the snippet generator are usable

          Code changed in jenkins
          User: R. Tyler Croy
          Path:
          Jenkinsfile
          http://jenkins-ci.org/commit/jenkins.io/ff3bc09b643da104c514798098a735f8fff591b3
          Log:
          Add support for deploying the built zip out to the beta site

          The following tickets were created as a result of this experimentation:

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: R. Tyler Croy Path: Jenkinsfile http://jenkins-ci.org/commit/jenkins.io/ff3bc09b643da104c514798098a735f8fff591b3 Log: Add support for deploying the built zip out to the beta site The following tickets were created as a result of this experimentation: JENKINS-32101 JENKINS-32102 JENKINS-32104

          Jesse Glick added a comment -

          Not following what the issue is. Steps to reproduce from scratch?

          Jesse Glick added a comment - Not following what the issue is. Steps to reproduce from scratch?

          Jesse Glick added a comment -

          malcorn your issue is probably unrelated, though it is unclear to me what this issue is about either.

          Jesse Glick added a comment - malcorn your issue is probably unrelated, though it is unclear to me what this issue is about either.

            Unassigned Unassigned
            rtyler R. Tyler Croy
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: