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

accessing file credential in pipeline causes nullPointerException

    Details

    • Similar Issues:

      Description

      After a plugin update, one of my pipelines stopped working.  It's a groovy script that kicks off packer, which uses ansible to configure an AWS system.  After a bit of pairing down, I determined that the pipeline was crashing at the withCredentials([file bit.  I stripped the code down to a simple pipeline that demonstrates the error. 

      pipeline

      Unknown macro: {   agent   { label 'AWS-Pipeline-Executor' }

          stages { stage('Build') {
            steps

      Unknown macro: {                withCredentials([file(credentialsId}

            }   
          }   
        }  
      }  

       

      The only output is:

       
      [Pipeline] Start of Pipeline[Pipeline] nodeRunning on AWS-Pipeline-Executor in /home/asdc-jenkins/jenkins/workspace/.DevOps/MikeTest[Pipeline] {[Pipeline] stage[Pipeline]

      { (Build)[Pipeline] }

      [Pipeline] // stage[Pipeline] }[Pipeline] // node[Pipeline] End of Pipelinejava.lang.NullPointerException
      Finished: FAILURE
       

       

      Attached is the Jenkins log showing the error thrown.

        Attachments

          Activity

          Hide
          ssatchwillbt Sydney Satchwill added a comment -

          I had the same plugin versions and issue. I was able to fix by updating Structs plugin 1.18 -> 1.19

          Show
          ssatchwillbt Sydney Satchwill added a comment - I had the same plugin versions and issue. I was able to fix by updating Structs plugin 1.18 -> 1.19
          Hide
          malberghini Mike Alberghini added a comment -

          Updating Structs to 1.19 seems to have fixed the problem.

          Show
          malberghini Mike Alberghini added a comment - Updating Structs to 1.19 seems to have fixed the problem.

            People

            • Assignee:
              Unassigned
              Reporter:
              malberghini Mike Alberghini
            • Votes:
              4 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: