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

Failed to prepare configFileProvider step

XMLWordPrintable

      Within a freestyle job (setup using the above environment), am able to read the contents of the config file (it's JSON formatted).

      However, using the pipeline scripts, build fails with this error.

      Snippet of the error from build log:

      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)

      And, this is the Jenkinsfile:

      stage(' == Capitals == ') {
      configFileProvider([configFile(field: 'capital_jsoncfg', variable: 'capitals_info')])

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

      }

      I did use snippet generator made available within the context of "Pipeline Syntax" to verify this piece of code. So, I presume (from reading the plugin documentation) script syntax should be okay.

            domi Dominik Bartholdi
            mramanathan Ramanathan M
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: