openshift / jenkins-plugin

Apache License 2.0
81 stars 50 forks source link

NullPointerException at com.openshift.jenkins.plugins.pipeline.OpenShiftCreator.makeRESTCall(OpenShiftCreator.java:96) #19

Closed livelace closed 8 years ago

livelace commented 8 years ago

` Started by user admin Building in workspace /var/lib/jenkins/jobs/2/workspace

Auth authToken len 13 inspectBuildEnvAndOverrideFields class name com.openshift.jenkins.plugins.pipeline.OpenShiftCreator inspectBuildEnvAndOverrideFields found field jsonyaml with current value { "apiVersion": "extensions/v1beta1", "kind": "Job", "metadata": { "name": "pi" }, "spec": { "selector": { "matchLabels": { "app": "pi" } }, "parallelism": 1, "completions": 1, "template": { "metadata": { "name": "pi", "labels": { "app": "pi" } }, "spec": { "containers": [ { "name": "pi", "image": "perl", "command": [ "perl", "-Mbignum=bpi", "-wle", "print bpi(2000)" ] } ], "restartPolicy": "Never" } } } } inspectBuildEnvAndOverrideFields for field jsonyaml got val from build env null inspectBuildEnvAndOverrideFields found field apiURL with current value https://openshift-master1.livelace.ru inspectBuildEnvAndOverrideFields for field apiURL got val from build env null inspectBuildEnvAndOverrideFields found field namespace with current value test inspectBuildEnvAndOverrideFields for field namespace got val from build env null inspectBuildEnvAndOverrideFields found field authToken with current value 1111111111111 inspectBuildEnvAndOverrideFields for field authToken got val from build env null inspectBuildEnvAndOverrideFields found field verbose with current value true inspectBuildEnvAndOverrideFields for field verbose got val from build env null inspectBuildEnvAndOverrideFields found field bearerToken with current value com.openshift.restclient.authorization.TokenAuthorizationStrategy@1f inspectBuildEnvAndOverrideFields found field auth with current value com.openshift.jenkins.plugins.pipeline.Auth@1c9d92bb

BUILD STEP: OpenShiftCreator in perform on namespace test ERROR: Build step failed with exception java.lang.NullPointerException at com.openshift.jenkins.plugins.pipeline.OpenShiftCreator.makeRESTCall(OpenShiftCreator.java:96) at com.openshift.jenkins.plugins.pipeline.OpenShiftCreator.coreLogic(OpenShiftCreator.java:150) at com.openshift.jenkins.plugins.pipeline.OpenShiftBaseStep.perform(OpenShiftBaseStep.java:147) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782) at hudson.model.Build$BuildExecution.build(Build.java:205) at hudson.model.Build$BuildExecution.doRun(Build.java:162) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) at hudson.model.Run.execute(Run.java:1738) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Build step 'Create resource(s) in OpenShift' marked build as failure Finished: FAILURE `

livelace commented 8 years ago

OpenShift Pipeline Jenkins Plugin - 1.0.8 jenkins - 1.642.2

gabemontero commented 8 years ago

Yep, the job api type was recently exposed in OpenShift. The immediate fix is easy enough. I should hopefully get to this in the next day or two.

livelace commented 8 years ago

Thanks.

livelace commented 8 years ago

I forgot to mention about lack of traffic and any network activity (in time of starting of job) in direction of where Openshift installed.

gabemontero commented 8 years ago

OK .. thx for that, but yeah, that wouldn't have any bearing. This bug would happen irregardless.

livelace commented 8 years ago

Oh, thanks. I understand now (don't know java). But little question: do you plan to add remote command execution inside pods ?

gabemontero commented 8 years ago

That is not on the list at this time. If you would like it, please open up a separate issue asking for it that we can mark as a request for enhancement.

gabemontero commented 8 years ago

@livelace : the changes to address the NPE and add the Job resource as a type the plugin can create have been pushed to the repo via commit 2463397158d3065340f029baa46ccea306ddd99e

If you are in the mode of pulling the changes from this repo and buliding/installing the plugin manually, go for it; otherwise, it will be in v1.0.9 of the plugin when the next official version is cut and pulled into the OpenShift Jenkins images.

closing out