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

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

              Created:
              Updated:
              Resolved: