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

Failing to find credentials doesn't actually fail a Workflow

      Because of the presence of the ignoreMissing option for the sshagent() Workflow step, one might assume that the absence of a credential will result in a failed build. Or at the very least that the contents of the sshagent() {} block would not execute.

      Neither is the case unfortunately.

      With the following workflow:

      node {
        sshagent(["non-existent-garbage"]) {
          unstash "foo"
          sh "ls"
        }
      }
      

      The following will occur:

      [Workflow] Allocate node : Start
      Running on Docker-bb75aee9cf85 in /home/jenkins/workspace/multipass/master
      [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 {
      [Workflow] unstash
      [Workflow] sh
      [master] Running shell script
      + ls build/archives
      jenkins.io-2.0.35+3e5ba13.zip
      [Workflow] } //sshagent
      [Workflow] SSH Agent : End
      [Workflow] } //node
      [Workflow] Allocate node : End
      [Workflow] End of Workflow
      Finished: SUCCESS
      

      There does not seem to be any way to prevent the execution of the block if the credentials are missing.

          [JENKINS-32104] Failing to find credentials doesn't actually fail a Workflow

          R. Tyler Croy created issue -
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 167587 ] New: JNJira + In-Review [ 182797 ]
          Andrew Bayer made changes -
          Labels Original: workflow New: pipeline workflow
          Andrew Bayer made changes -
          Labels Original: pipeline workflow New: pipeline
          R. Tyler Croy made changes -
          Link New: This issue is duplicated by JENKINS-37863 [ JENKINS-37863 ]
          Jesse Glick made changes -
          Labels Original: pipeline New: pipeline robustness
          Timothy Clarke made changes -
          Attachment New: Key Scope.png [ 39746 ]
          Allan BURDAJEWICZ made changes -
          Assignee New: Allan BURDAJEWICZ [ allan_burdajewicz ]
          Jesse Glick made changes -
          Assignee Original: Allan BURDAJEWICZ [ allan_burdajewicz ]
          Jesse Glick made changes -
          Remote Link New: This issue links to "ssh-agent-plugin #144 (Web Link)" [ 29620 ]
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

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

              Created:
              Updated: