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

"This stage has no steps" error when using sshagent

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • blueocean-plugin
    • None

      This configuration is supposed to connect to a remote machine and execute uname command.

       

      stage ('test ssh') {
         sshagent(['82d845e5-4c80-4327-9980-83844008eaa8']) {
            sh 'ssh -o StrictHostKeyChecking=no some.server.com uname -a'
         }
      }
      

      Instead I get "This stage has no steps" error.

      I've also tried to put sshagent {} inside step {} and other way around with the same result.

      Is my configuration correct? What's wrong?

       

          [JENKINS-53043] "This stage has no steps" error when using sshagent

          Daniel Robbins added a comment - - edited

          This is also an issue for us. Entire pipeline is broken for us at this time after upgrading due to security updates for jenkins/plugins.

          Any pipeline step that includes sshagent does not execute, no errors in logs and pipeline output is indicating that no steps are present.

          This was all working prior to upgrades.

           

           

          When using key that requires asking for passphrase

          [Pipeline] sshagent
          [ssh-agent] Using credentials git (Bitbucket Account)
          [ssh-agent] Looking for ssh-agent implementation...
          [ssh-agent]   Exec ssh-agent (binary ssh-agent on a remote machine)
          $ ssh-agent
          SSH_AUTH_SOCK=/tmp/ssh-LZ8O071QqSF0/agent.29897
          SSH_AGENT_PID=29900
          Running ssh-add (command line suppressed)
          ssh_askpass: exec(/var/lib/jenkins/workspace/enkins-build-testing_master-TLYGPGVK3W4MRGFA647ZAGBVCVYCQ3PJBBMQHCTJRF3U4EWG5ZDA@tmp/askpass_1020027293488114105.sh): No such file or directory
          

          When using key that does not require asking for passphrase

          [Pipeline] sshagent
          [ssh-agent] Using credentials git (Bitbucket Account)
          [ssh-agent] Looking for ssh-agent implementation...
          [ssh-agent]   Exec ssh-agent (binary ssh-agent on a remote machine)
          $ ssh-agent
          SSH_AUTH_SOCK=/tmp/ssh-xp4CDha4knEQ/agent.30068
          SSH_AGENT_PID=30071
          Running ssh-add (command line suppressed)
          Enter passphrase for /var/lib/jenkins/workspace/enkins-build-testing_master-TLYGPGVK3W4MRGFA647ZAGBVCVYCQ3PJBBMQHCTJRF3U4EWG5ZDA@tmp/private_key_8563029023929226717.key: [Pipeline] // sshagent
          

          Daniel Robbins added a comment - - edited This is also an issue for us. Entire pipeline is broken for us at this time after upgrading due to security updates for jenkins/plugins. Any pipeline step that includes sshagent does not execute, no errors in logs and pipeline output is indicating that no steps are present. This was all working prior to upgrades.     When using key that requires asking for passphrase [Pipeline] sshagent [ssh-agent] Using credentials git (Bitbucket Account) [ssh-agent] Looking for ssh-agent implementation... [ssh-agent] Exec ssh-agent (binary ssh-agent on a remote machine) $ ssh-agent SSH_AUTH_SOCK=/tmp/ssh-LZ8O071QqSF0/agent.29897 SSH_AGENT_PID=29900 Running ssh-add (command line suppressed) ssh_askpass: exec(/ var /lib/jenkins/workspace/enkins-build-testing_master-TLYGPGVK3W4MRGFA647ZAGBVCVYCQ3PJBBMQHCTJRF3U4EWG5ZDA@tmp/askpass_1020027293488114105.sh): No such file or directory When using key that does not require asking for passphrase [Pipeline] sshagent [ssh-agent] Using credentials git (Bitbucket Account) [ssh-agent] Looking for ssh-agent implementation... [ssh-agent] Exec ssh-agent (binary ssh-agent on a remote machine) $ ssh-agent SSH_AUTH_SOCK=/tmp/ssh-xp4CDha4knEQ/agent.30068 SSH_AGENT_PID=30071 Running ssh-add (command line suppressed) Enter passphrase for / var /lib/jenkins/workspace/enkins-build-testing_master-TLYGPGVK3W4MRGFA647ZAGBVCVYCQ3PJBBMQHCTJRF3U4EWG5ZDA@tmp/private_key_8563029023929226717.key: [Pipeline] // sshagent

          After some digging. This seems to be related to a combination of the ssh-agent and ssh-credentials plugins.

          Rolling back from credentials version 1.14 > 1.13 and agent version 1.17 > 1.15 has solved the issue.

          This allowed us to re-enable using the ssh key "From the Jenkins master ~/.ssh" from our jenkins linux user and all pipelines started working again.

           

          Daniel Robbins added a comment - After some digging. This seems to be related to a combination of the ssh-agent and ssh-credentials plugins. Rolling back from credentials version 1.14 > 1.13 and agent version 1.17 > 1.15 has solved the issue. This allowed us to re-enable using the ssh key "From the Jenkins master ~/.ssh" from our jenkins linux user and all pipelines started working again.  

            Unassigned Unassigned
            spidgorny Slawa Pid
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: