pipeline-as-yaml-plugin
pipeline-as-yaml-plugin copied to clipboard
Pipeline as YAML fails to run if user trigger it with Replay option
I have created a Pipeline in YAML as shown below.
pipeline:
agent:
any:
stages:
- stage: "Checkout"
steps:
script:
- git 'https://github.com/username/API.git'
- stage: "Build Multi stage Docker Image"
steps:
script:
- sh "docker build -t username/webserver:v$BUILD_NUMBER ."
The pipeline when successful when I build it. But failing when I replay it with the below error.
Replayed #40
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.LinkedHashMap
at org.jenkinsci.plugins.workflow.multibranch.yaml.pipeline.parsers.PipelineParser.parse(PipelineParser.java:34)
Caused: org.jenkinsci.plugins.workflow.multibranch.yaml.pipeline.exceptions.PipelineAsYamlRuntimeException: java.lang.String cannot be cast to java.util.LinkedHashMap
at org.jenkinsci.plugins.workflow.multibranch.yaml.pipeline.parsers.PipelineParser.parse(PipelineParser.java:53)
at org.jenkinsci.plugins.workflow.multibranch.yaml.pipeline.cps.PipelineCpsFlowDefinition.create(PipelineCpsFlowDefinition.java:41)
at org.jenkinsci.plugins.workflow.multibranch.yaml.pipeline.PipelineAsYamlScriptFlowDefinition.create(PipelineAsYamlScriptFlowDefinition.java:56)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:309)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:428)
Finished: FAILURE
To Reproduce To reproduce this issue please create a Pipeline using YAML and try to run via replay.
Expected behavior The pipeline should be successful.
Hi @sunishsurendrank ,
Thanks for reporting this bug. I opened PR to workflow-cps for some changes. After these changes are applied, I will be able to fix this error.
Is this issue fixed!
I have this same error
@DanjelTahko I am not sure this issue is fixed yet @aytuncbeken can you provide some update?