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

          R. Tyler Croy created issue -
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-32101 [ JENKINS-32101 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 167585 ] New: JNJira + In-Review [ 182795 ]
          Andrew Bayer made changes -
          Labels Original: workflow New: pipeline workflow
          Andrew Bayer made changes -
          Labels Original: pipeline workflow New: pipeline
          Matt A made changes -
          Comment [ [~jglick] hi Jesse, I am having a similar problem to this issue except that even credentials created in the snippet generator aren't available when the Pipeline is running - they are not selectable from the dropdown.

          I've added more comments, logs, and screenshots here: https://issues.jenkins-ci.org/browse/JENKINS-32101 ]
          Jesse Glick made changes -
          Resolution New: Incomplete [ 4 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

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

              Created:
              Updated:
              Resolved: