jenkinsci / jenkinsci/workflow-multibranch-plugin

[JENKINS-62206] Triggering Pipeline job from a multibranch pipeline fails

Open
#515 1 comment 0 reactions 0 assignees View on GitHub
component:workflow-multibranch-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
87
Forks
131
PR merge metrics
No merged PRs in 30d

Description

triggering a pipeline job from the multibranch pipeline doesnt work , it fails with the following error

Sucessfully[Pipeline] build[Pipeline] }[Pipeline] // scriptError when executing success post condition:

hudson.AbortException: No item named Data-Deploy-Dev found

at org.jenkinsci.plugins.workflow.support.steps.build.BuildTriggerStepExecution.start(BuildTriggerStepExecution.java:75)

at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:286)

at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:179)

at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)

at sun.reflect.GeneratedMethodAccessor1473.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)

at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)

at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)

here is the code in the Multibranch pipeline

post {

always

{ echo 'Test run completed' }

success {

script {

if (env.BRANCH_NAME == 'master') {

echo 'Sucessfully'

build job: 'Data-Deploy-Dev', parameters: [

string(name: 'DOCKER_APP_IMAGE_TAG', value: "${env.DOCKER_APP_IMAGE_TAG}"),

string(name: 'DOCKER_WEB_IMAGE_TAG', value: "${env.DOCKER_WEB_IMAGE_TAG}")

], wait: false

}

else

{ echo 'Sucessfully!' }

}

}

failure

{ echo 'Failed!' }

unstable

{ echo 'This will run only if the run was marked as unstable' }

changed

{ echo 'This will run only if the state of the Pipeline has changed' echo 'For example, if the Pipeline was previously failing but is now successful' }

}

 

the pipeline job Data-Deploy-Dev is present, but still it errors as not found

---
Originally reported by naziamahimi, imported from: Triggering Pipeline job from a multibranch pipeline fails


  • status: Open
  • priority: Major
  • component(s): workflow-multibranch-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 20251212-090250

Raw content of original issue

triggering a pipeline job from the multibranch pipeline doesnt work , it fails with the following error
Sucessfully[Pipeline] build[Pipeline] }[Pipeline] // scriptError when executing success post condition:
hudson.AbortException: No item named Data-Deploy-Dev found
at org.jenkinsci.plugins.workflow.support.steps.build.BuildTriggerStepExecution.start(BuildTriggerStepExecution.java:75)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:286)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:179)
at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)
at sun.reflect.GeneratedMethodAccessor1473.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
here is the code in the Multibranch pipeline

post {
always

{ echo 'Test run completed' }

success {
script {
if (env.BRANCH_NAME == 'master') {
echo 'Sucessfully'
build job: 'Data-Deploy-Dev', parameters: [
string(name: 'DOCKER_APP_IMAGE_TAG', value: "${env.DOCKER_APP_IMAGE_TAG}"),
string(name: 'DOCKER_WEB_IMAGE_TAG', value: "${env.DOCKER_WEB_IMAGE_TAG}")
], wait: false
}

else

{ echo 'Sucessfully!' }

}
}
failure

{ echo 'Failed!' }

unstable

{ echo 'This will run only if the run was marked as unstable' }

changed

{ echo 'This will run only if the state of the Pipeline has changed' echo 'For example, if the Pipeline was previously failing but is now successful' }

}

 

the pipeline job Data-Deploy-Dev is present, but still it errors as not found

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.