Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipeline as YAML fails to run if user trigger it with Replay option #32

Open
sunishsurendrank opened this issue Aug 21, 2020 · 7 comments

Comments

@sunishsurendrank
Copy link

sunishsurendrank commented Aug 21, 2020

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.

@sunishsurendrank sunishsurendrank changed the title Pipline as YAML fails to run if user trigger it with Replay option Pipeline as YAML fails to run if user trigger it with Replay option Aug 21, 2020
@aytuncbeken
Copy link
Contributor

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.

@sunishsurendrank
Copy link
Author

Is this issue fixed!

@danjeltahko
Copy link

I have this same error

@sunishsurendrank
Copy link
Author

@danjeltahko I am not sure this issue is fixed yet @aytuncbeken can you provide some update?

@adev101
Copy link

adev101 commented Aug 16, 2024

I see still same error. Plugin I added is Pipeline As YAML (Incubated) Version192.vc72d50cb_c258

@jonesbusy
Copy link
Contributor

PR are welcome

Nobody is actively contributing to this plugin. Recent contribution like #77 were only there to make it work with recent jenkins version

@ashishshaji
Copy link

issue is still present, unable to run yml files as script. can anyone suggest a jenkin version where this plugin (pipeline as yaml) works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants