Issue
I have a Jenkins-Freestyle-job containing a logparser-step:
Now I want to transform this job to a pipeline using descriptive pipeline syntax. Therefor I used the snipped generator which gave me this for the input above:
logParser projectRulePath: 'C:\\Program Files (x86)\\Jenkins\\consoleparser.config.properties', showGraphs: true, unstableOnWarning: true, useProjectRule: true
However when I execute that job I get the following error:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 139: Missing required parameter: "parsingRulesPath" @ line 139, column 15.
logParser ([
^
1 error
at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1085)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:142)
at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:127)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:571)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:523)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:337)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:428)
I don´t really know what the difference between the global and the project-rule is. However as my freestyle-job works as intended I just used the project-rule for the pipeline also.
I am using the Log Parser Plugin 2.1
EDIT: I downgraded the plugin to 2.0, which seems to solve the issue.
Solution
Seems like a bug in either the snipped-generator which does not create the mandatory property parsingRulesPath
, or within the plugin in version 2.1, as the same works in v2.0.
We can workaround that by providing the property parsingRulesPath
:
logParser ([
projectRulePath: 'C:\\Program Files (x86)\\Jenkins\\consoleparser.config.properties', ,
parsingRulesPath: '',
showGraphs: true,
unstableOnWarning: true,
useProjectRule: true
])
Something similar has already been mentioned in https://issues.jenkins.io/browse/JENKINS-27208, however in a way such that projectRulePath
is missing.
Answered By - HimBromBeere