accessing file credential in pipeline causes nullPointerException

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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')

      Unknown macro: {       steps{                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.

            Assignee:
            Unassigned
            Reporter:
            Mike Alberghini
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: