Bug 1397753 - Failed to start build from a previous build using "Trigger OpenShift Build" jenkins dsl step
Summary: Failed to start build from a previous build using "Trigger OpenShift Build" j...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: ImageStreams
Version: 3.4.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Gabe Montero
QA Contact: Wang Haoran
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-23 10:13 UTC by Dongbo Yan
Modified: 2017-03-08 18:43 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: NullPointerException when accessing BuildConfig that was not previously retrieved Consequence: jenkins-plugin trigger openshift build of previous build failed Fix: retrieve build config, avoid NullPointerException Result: jenkins-plugin trigger openshift build of previous build works again
Clone Of:
Environment:
Last Closed: 2017-02-16 21:03:32 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Dongbo Yan 2016-11-23 10:13:09 UTC
Description of problem:
Failed to start build from a previous build using "Trigger OpenShift Build" jenkins dsl step

Version-Release number of selected component (if applicable):
brew-pulp.../openshift3/jenkins-1-rhel7   latest              9edb7f9e5157   
brew-pulp.../openshift3/jenkins-2-rhel7   latest              b5b09fbedfc0 
openshift-login	0.9
openshift-pipeline	1.0.36
openshift-sync	0.0.17

openshift v3.4.0.28+dfe3a66
kubernetes v1.4.0+776c994
etcd 3.1.0-rc.0

How reproducible:
Always

Steps to Reproduce:
1.Setup jenkins server and generate application under project
 $ oc new-app https://raw.githubusercontent.com/openshift/origin/master/examples/jenkins/pipeline/samplepipeline.json
 $ oc start-build sample-pipeline
2.wait nodejs-mongodb-example-1 build complete, create pipeline job, configure pipeline scripts
node{
    openshiftBuild bldCfg: 'nodejs-mongodb-example', buildName: 'nodejs-mongodb-example-1', showBuildLogs: 'true', verbose: 'true'
}
3.

Actual results:
Jenkins job failed, cannot start build from previous build

Expected results:
start build from previous build successfully

Additional info:
Starting the "Trigger OpenShift Build" step with build config "nodejs-mongodb-example" from the project "dyanv2".

OpenShiftBuilder logger follow true

OpenShiftBuilder build config retrieved null buildName nodejs-mongodb-example-6
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.lang.NullPointerException
	at com.openshift.jenkins.plugins.pipeline.model.IOpenShiftBuilder.coreLogic(IOpenShiftBuilder.java:233)
	at com.openshift.jenkins.plugins.pipeline.model.IOpenShiftPlugin.doItCore(IOpenShiftPlugin.java:305)
	at com.openshift.jenkins.plugins.pipeline.dsl.OpenShiftBuilderExecution.run(OpenShiftBuilderExecution.java:42)
	at com.openshift.jenkins.plugins.pipeline.dsl.OpenShiftBuilderExecution.run(OpenShiftBuilderExecution.java:18)
	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:52)
	at hudson.security.ACL.impersonate(ACL.java:221)
	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:49)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Finished: FAILURE

Comment 1 Gabe Montero 2016-11-23 17:02:26 UTC
This was introduced when I made the change to allow for the triggering of jenkins strategy builds earlier this week.

Another extended test candidate.

Comment 2 Gabe Montero 2016-11-23 17:49:31 UTC
Commit https://github.com/openshift/jenkins-plugin/commit/6a6cf1d531e73956efbfa7f12bbff1e6b777df93 addresses the NPE in the plugin.

I'll move the bug to QA once the plugin version and images are updated.

Comment 3 Gabe Montero 2016-11-28 15:24:56 UTC
Jenkins rhel image on brew-pulp now has v1.0.37 of the plugin, which includes the fix for this.

Comment 4 Dongbo Yan 2016-11-29 08:01:00 UTC
Test with
brew-pulp.../openshift3/jenkins-1-rhel7          bdda1c3ed6fd  
brew-pulp.../openshift3/jenkins-2-rhel7          40ed5bbd7488
openshift-login	0.9
openshift-pipeline	1.0.37
openshift-sync	0.1.5

openshift v3.4.0.30+e10cc28
kubernetes v1.4.0+776c994
etcd 3.1.0-rc.0

Comment 5 Troy Dawson 2017-02-16 21:03:32 UTC
This bug was fixed with the latest OCP 3.4.0 that is already released.


Note You need to log in before you can comment on or make changes to this bug.