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

accessing file credential in pipeline causes nullPointerException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • Ubuntu 18.04.2
      Jenkins 2.175
      Credentials Plugin 2.1.18
      Plain Credentials Plugin 1.5

      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.

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

              Created:
              Updated:
              Resolved: