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

Throw appropriate error when the code is not in node block

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • ssh-steps-plugin
    • None

      The pipeline example for sshCommand provided in the Github page is wrong, it gives a NullPointException in my installation:

      java.lang.NullPointerException
      	at org.jenkinsci.plugins.sshsteps.steps.CommandStep$Execution.run(CommandStep.java:71)
      	at org.jenkinsci.plugins.sshsteps.util.SSHStepExecution$1$1.call(SSHStepExecution.java:77)
      	at hudson.security.ACL.impersonate(ACL.java:290)
      	at org.jenkinsci.plugins.sshsteps.util.SSHStepExecution$1.run(SSHStepExecution.java:72)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Finished: FAILURE

      However, after adding pipelines, stages and steps wrappers around it, it worked fine:

      def remote = [:]
      remote.name = 'test'
      remote.host = 'test.domain.com'
      remote.user = 'root'
      remote.password = 'password'
      remote.allowAnyHosts = true
      pipeline { 
          agent any 
          stages {
              stage('SSH') {
                  steps{
                      sshCommand remote: remote, command: "ls -l /"
                  }
              }
          }
      }
      

            nrayapati Naresh Rayapati
            cassioiks Cassio Binkowski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: