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

[Bug]: Replay is failing for Jenkins declarative pipeline #327

Open
ravindrakmr opened this issue Sep 6, 2023 · 0 comments
Open

[Bug]: Replay is failing for Jenkins declarative pipeline #327

ravindrakmr opened this issue Sep 6, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@ravindrakmr
Copy link

Jenkins Version

2.375.1, 2.414.1

JTE Version

2.5.3

Bug Description

I have a library with name git which is having a groovy file checkout_code.groovy. I am just using this library in one of the declarative Jenkins pipeline like this -
stage("Checkout code") {
steps {
script{
def gitVars = checkout_code()
//using gitVars variable
}
}
}
I also have the relevant pipeline_config.groovy file which is passing all required attribute to this git library. This is working fine when I do a fresh execution but failing on replay with error -
Also: hudson.remoting.ProxyException: org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: d4ceceb5-9942-4c47-a730-05b8a44fd847
hudson.remoting.ProxyException: java.io.IOException: cannot find current thread
at org.jenkinsci.plugins.workflow.cps.CpsStepContext.doGet(CpsStepContext.java:295)
at org.jenkinsci.plugins.workflow.support.DefaultStepContext.get(DefaultStepContext.java:75)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:294)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:196)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:47)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:20)
at org.jenkinsci.plugins.workflow.cps.LoggingInvoker.methodCall(LoggingInvoker.java:105)
at JTE_git_checkout_code.call(JTE_git_checkout_code:14)
at org.boozallen.plugins.jte.init.primitives.injectors.StepWrapperCPS.methodMissing(script1693927234186216937907.groovy:59)

Relevant log output

2023-09-06 13:37:57.464+0000 [id=2121]  WARNING o.j.plugins.workflow.cps.DSL#invokeStep: Unable to retrieve environment variables
java.io.IOException: cannot find current thread
        at org.jenkinsci.plugins.workflow.cps.CpsStepContext.doGet(CpsStepContext.java:295)
        at org.jenkinsci.plugins.workflow.support.DefaultStepContext.get(DefaultStepContext.java:75)
        at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:261)
        at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:196)
......
.......
2023-09-06 13:37:57.468+0000 [id=2121]  WARNING o.j.plugins.workflow.cps.DSL#invokeStep: Error storing the arguments for step: checkout
java.io.IOException: cannot find current thread
        at org.jenkinsci.plugins.workflow.cps.CpsStepContext.doGet(CpsStepContext.java:295)
        at org.jenkinsci.plugins.workflow.support.DefaultStepContext.get(DefaultStepContext.java:75)
        at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:275)
        at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:196)
........
.........
2023-09-06 13:38:01.594+0000 [id=1956]  WARNING h.i.i.InstallUncaughtExceptionHandler#handleException: Caught unhandled exception with ID ad23ff56-b418-4865-bcfc-ff8a2f65a6cf
java.lang.IllegalArgumentException: FlowNode not part of the same execution found, at index 0 with ID 39
        at org.jenkinsci.plugins.workflow.pipelinegraphanalysis.StatusAndTiming.verifySameRun(StatusAndTiming.java:155)
        at org.jenkinsci.plugins.workflow.pipelinegraphanalysis.StatusAndTiming.computeChunkTiming(StatusAndTiming.java:375)
        at com.cloudbees.workflow.rest.external.ChunkVisitor.makeAtomNode(ChunkVisitor.java:54)
        at com.cloudbees.workflow.rest.external.ChunkVisitor.atomNode(ChunkVisitor.java:154)
        at org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner.fireVisitChunkCallbacks(ForkScanner.java:765)
        at org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner.visitSimpleChunks(ForkScanner.java:783)
        at org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner.visitSimpleChunks(ForkScanner.java:647)
        at com.cloudbees.workflow.rest.external.RunExt.createNew(RunExt.java:323)
        at com.cloudbees.workflow.rest.external.RunExt.create(RunExt.java:311)
        at com.cloudbees.workflow.rest.external.JobExt.create(JobExt.java:143)
        at com.cloudbees.workflow.rest.endpoints.JobAPI.doRuns(JobAPI.java:69)
        at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)
        at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:397)
Caused: java.lang.reflect.InvocationTargetException
        at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:401)
        at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:409)
        at com.cloudbees.workflow.util.ServeJson$Processor.invoke(ServeJson.java:30)
Caused: java.lang.RuntimeException: Unexpected exception while serving JSON
        at com.cloudbees.workflow.util.ServeJson$Processor.invoke(ServeJson.java:34)
        at org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeInterceptedFunction.java:26)
        at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:207)
        at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:140)
        at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:558)
        at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:59)

Steps to Reproduce

  1. Run the pipeline using build with parameter option
  2. Replay the same pipeline with replay option of Jenkins
@ravindrakmr ravindrakmr added the bug Something isn't working label Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant