[JIRA] (JENKINS-57264) accessing file credential in pipeline causes nullPointerException

2 views
Skip to first unread message

michael.alberghini@keysight.com (JIRA)

unread,
Apr 30, 2019, 2:33:03 PM4/30/19
to jenkinsc...@googlegroups.com
Mike Alberghini created an issue
 
Jenkins / Bug JENKINS-57264
accessing file credential in pipeline causes nullPointerException
Issue Type: Bug Bug
Assignee: Unassigned
Components: credentials-plugin, plain-credentials-plugin
Created: 2019-04-30 18:32
Environment: Ubuntu 18.04.2
Jenkins 2.175
Credentials Plugin 2.1.18
Plain Credentials Plugin 1.5
Priority: Major Major
Reporter: Mike Alberghini

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 {       
        withCredentials([file(credentialsId: 'ansible-vault', variable: 'VAULT_PASS_FILE')])

Unknown macro: {               echo "Inside creds loop"         }

  
      }   
    }   
  }  
}  

 

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
 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

michael.alberghini@keysight.com (JIRA)

unread,
Apr 30, 2019, 2:45:01 PM4/30/19
to jenkinsc...@googlegroups.com

michael.alberghini@keysight.com (JIRA)

unread,
Apr 30, 2019, 2:46:02 PM4/30/19
to jenkinsc...@googlegroups.com
Mike Alberghini updated an issue
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. 
{quote}pipeline {
Unknown macro: \{   agent \ { label 'AWS-Pipeline-Executor' }
    stages { stage('Build') {
      steps {       
        withCredentials([file(credentialsId: 'ansible-vault', variable: 'VAULT_PASS_FILE')])

Unknown macro: \
{    
          echo "Inside creds loop"
        }
  
      }   
    }   
  }  
}  
{quote}
 

The only output is:

 
[Pipeline] Start of Pipeline[Pipeline] nodeRunning on [AWS-Pipeline-Executor|http://woodhouse.atl.is.keysight.com:8080/computer/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.

sydney.satchwill@getbraintree.com (JIRA)

unread,
May 2, 2019, 10:05:02 AM5/2/19
to jenkinsc...@googlegroups.com
Sydney Satchwill commented on Bug JENKINS-57264
 
Re: accessing file credential in pipeline causes nullPointerException

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

michael.alberghini@keysight.com (JIRA)

unread,
May 6, 2019, 2:55:02 PM5/6/19
to jenkinsc...@googlegroups.com
Mike Alberghini updated an issue
Change By: Mike Alberghini
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. 
{quote}pipeline
Unknown macro: \ {   agent
  \
{ label 'AWS-Pipeline-Executor' }
    stages { stage('Build') {
      steps

{       
        withCredentials([file(credentialsId : 'ansible-vault', variable: 'VAULT_PASS_FILE')])
Unknown macro: \{               echo "Inside creds loop"        
}
  
      }   
    }   
  }  
}  

{quote}
 

The only output is:

 
[Pipeline] Start of Pipeline[Pipeline] nodeRunning on [AWS-Pipeline-Executor|http://woodhouse.atl.is.keysight.com:8080/computer/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.

michael.alberghini@keysight.com (JIRA)

unread,
May 14, 2019, 11:18:02 AM5/14/19
to jenkinsc...@googlegroups.com
Mike Alberghini commented on Bug JENKINS-57264
 
Re: accessing file credential in pipeline causes nullPointerException

Updating Structs to 1.19 seems to have fixed the problem.

michael.alberghini@keysight.com (JIRA)

unread,
May 14, 2019, 11:19:02 AM5/14/19
to jenkinsc...@googlegroups.com
Mike Alberghini closed an issue as Fixed
 
Change By: Mike Alberghini
Status: Open Closed
Resolution: Fixed
Reply all
Reply to author
Forward
0 new messages