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

Build step 'Execute shell script on remote host using ssh' failing with NPE

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Not A Defect
    • Component/s: ssh-plugin
    • Labels:
    • Environment:
      Jenkins 2.121.2
    • Similar Issues:

      Description

      I am running a script on remote hosts , it used to work very well, however after upgrading to 2.121.1 i see failures.

       [SSH] script:
      df -h | head -3 | grep -E '90%|91%|92%|93%|94%|95%|96%|97%|98%|99%|100%'
      if [ $? == 0 ]
      then
       echo "TestDrive Server: Not Enough free disk space, please remove some files"
       exit 1
      else 
       echo "TestDrive Server: Disk Space is free, chill !!!!"
       exit 0
      fi
      [SSH] executing...
      ERROR: Build step failed with exception
      java.lang.NullPointerException
       at com.cloudbees.plugins.credentials.matchers.IdMatcher.<init>(IdMatcher.java:56)
       at com.cloudbees.plugins.credentials.CredentialsMatchers.withId(CredentialsMatchers.java:132)
       at org.jvnet.hudson.plugins.CredentialsSSHSite.lookupCredentialsById(CredentialsSSHSite.java:313)
       at org.jvnet.hudson.plugins.CredentialsSSHSite.createSession(CredentialsSSHSite.java:111)
       at org.jvnet.hudson.plugins.CredentialsSSHSite.executeCommand(CredentialsSSHSite.java:208)
       at org.jvnet.hudson.plugins.SSHBuilder.perform(SSHBuilder.java:104)
       at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
       at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
       at hudson.model.Build$BuildExecution.build(Build.java:206)
       at hudson.model.Build$BuildExecution.doRun(Build.java:163)
       at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
       at hudson.model.Run.execute(Run.java:1798)
       at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
       at hudson.model.ResourceController.execute(ResourceController.java:97)
       at hudson.model.Executor.run(Executor.java:429)
      Build step 'Execute shell script on remote host using ssh' marked build as failure
      Sending e-mails to: kakadia@avaya.com nandaa@avaya.com
      Finished: FAILURE

       

       

        Attachments

          Activity

          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          I believe this is an issue in credentials handling by SSH Plugin. Null is passed to SSH Credentials plugin where it should not

          Show
          oleg_nenashev Oleg Nenashev added a comment - I believe this is an issue in credentials handling by SSH Plugin. Null is passed to SSH Credentials plugin where it should not
          Hide
          ravikakadia Ravi Kakadia added a comment -

          Issue is resolved.

          After upgrade of Jenkins the credentials were reset, I had to go to Manage Jenkins screen and reconfigure the credentials for each of my servers. Credentials were there, I just had to select them again.

          Show
          ravikakadia Ravi Kakadia added a comment - Issue is resolved. After upgrade of Jenkins the credentials were reset, I had to go to Manage Jenkins screen and reconfigure the credentials for each of my servers. Credentials were there, I just had to select them again.

            People

            • Assignee:
              Unassigned
              Reporter:
              ravikakadia Ravi Kakadia
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: