Jenkins Pipeline build error: Failed to prepare configFileProvider step

949 views
Skip to first unread message

Ramanathan Muthaiah

unread,
Jan 8, 2017, 11:08:24 PM1/8/17
to Jenkins Users
Hello All,

Need help with pipeline build error in this setup:

Jenkins v2.36 with standard pipeline plugins + configFileProvider plugin

Here is the content of Jenkinsfile, pipeline script:

node('master') {
         stage(' == Capitals == ') {          
                       configFileProvider([configFile(field: 'capital_jsoncfg', variable: 'capitals_info')]) {
                        echo " == content of json cfg == "
                        sh "cat $capitals_info"
                     }
           }
 }

And, the pipeline build fails with this error (followed by verbose output):

java.lang.IllegalArgumentException: Failed to prepare configFileProvider step
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeDescribable(DSL.java:315)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:129)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
	at groovy.lang.GroovyObject$invokeMethod.call(Unknown Source)

Read thru' the example given here:
https://wiki.jenkins-ci.org/display/JENKINS/Config+File+Provider+Plugin

Searched this forum and stack overflow for possible clues but no successful hits until now.

Does anyone know what's wrong with the pipeline script ?

P.S :

In the same setup of Jenkins master, I have a freestyle job configured to use the same json cfg, in that job there are no such issues.
Simple shell command, like, cat-ing the contents of JSON cfg works in the freestyle job.


TIA,
/Ram

Ramanathan Muthaiah

unread,
Jan 23, 2017, 10:32:52 PM1/23/17
to Jenkins Users
On Monday, January 9, 2017 at 9:38:24 AM UTC+5:30, Ramanathan Muthaiah wrote:
Hello All,

Need help with pipeline build error in this setup:

Jenkins v2.36 with standard pipeline plugins + configFileProvider plugin

Here is the content of Jenkinsfile, pipeline script:

node('master') {
         stage(' == Capitals == ') {          
                       configFileProvider([configFile(field: 'capital_jsoncfg', variable: 'capitals_info')]) {
                        echo " == content of json cfg == "
                        sh "cat $capitals_info"
                     }
           }
 }

And, the pipeline build fails with this error (followed by verbose output):

java.lang.IllegalArgumentException: Failed to prepare configFileProvider step
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeDescribable(DSL.java:315)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:129)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
	at groovy.lang.GroovyObject$invokeMethod.call(Unknown Source)

This issue is solved. Usage of incorrect syntax (marked in italics) was causing Pipeline build errors.

node('master') {
  stage
(' == Capitals == ') {
   
     configFileProvider
([configFile(fileId: '<substitute-alpha-numeric-value>', variable: 'capitals_info')]) {

         echo " == content of json cfg == "
         sh
"cat $capitals_info"
     
}
 
}
}

Dominik suggested he will make improvements to display a better error message.
https://issues.jenkins-ci.org/browse/JENKINS-40973

Thanks Dominik for your help.

/Ram
Reply all
Reply to author
Forward
0 new messages