Bug 1311024

Summary: Can't trigger job successfully in jenkins webconsole
Product: OpenShift Container Platform Reporter: XiuJuan Wang <xiuwang>
Component: ImageStreamsAssignee: Michal Fojtik <mfojtik>
Status: CLOSED ERRATA QA Contact: XiuJuan Wang <xiuwang>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.2.0CC: aos-bugs, jokerman, mmccomas, tdawson
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-12 16:30:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description XiuJuan Wang 2016-02-23 08:11:46 UTC
Description of problem:
Can't trigger job in jenkins webconsole due to below error
Could not create BuildConfig resource frontend in namespace test for subresource instantiate: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"the body of the request was in an unknown format - accepted media types include: application/json, application/yaml","reason":"UnsupportedMediaType","code":415}

Works with latest ci.dev.openshift.redhat.com:5000/openshift/jenkins-1-rhel7(a1653bcc8261) 
Version-Release number of selected component (if applicable):
ose 3.2 RC
jenkins-1-rhel7 (ac9dd63162a5)

How reproducible:
always

Steps to Reproduce:
1.Create a jenkins pods following 
https://github.com/openshift/origin/blob/master/examples/jenkins/README.md
2.Create the sample application configuration
3.Trigger job in jenkins webconsole

Actual results:

Errors shown in consoleout page.
BUILD STEP:  OpenShiftBuilder in perform for frontend on namespace test
ERROR: Build step failed with exception
com.openshift.restclient.OpenShiftException: Could not create BuildConfig resource frontend in namespace test for subresource instantiate: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"the body of the request was in an unknown format - accepted media types include: application/json, application/yaml","reason":"UnsupportedMediaType","code":415}

	at com.openshift.internal.restclient.DefaultClient.createOpenShiftException(DefaultClient.java:475)
	at com.openshift.internal.restclient.DefaultClient.create(DefaultClient.java:227)
	at com.openshift.internal.restclient.capability.resources.BuildTrigger.trigger(BuildTrigger.java:59)
	at com.openshift.jenkins.plugins.pipeline.OpenShiftBuilder$2.visit(OpenShiftBuilder.java:113)
	at com.openshift.jenkins.plugins.pipeline.OpenShiftBuilder$2.visit(OpenShiftBuilder.java:111)
	at com.openshift.internal.restclient.model.KubernetesResource.accept(KubernetesResource.java:86)
	at com.openshift.jenkins.plugins.pipeline.OpenShiftBuilder.coreLogic(OpenShiftBuilder.java:111)
	at com.openshift.jenkins.plugins.pipeline.OpenShiftBaseStep.perform(OpenShiftBaseStep.java:143)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
	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:537)
	at hudson.model.Run.execute(Run.java:1741)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:98)
	at hudson.model.Executor.run(Executor.java:408)
Caused by: com.openshift.internal.restclient.http.HttpClientException: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"the body of the request was in an unknown format - accepted media types include: application/json, application/yaml","reason":"UnsupportedMediaType","code":415}

	at com.openshift.internal.restclient.http.UrlConnectionHttpClient.createException(UrlConnectionHttpClient.java:225)
	at com.openshift.internal.restclient.http.UrlConnectionHttpClient.request(UrlConnectionHttpClient.java:190)
	at com.openshift.internal.restclient.http.UrlConnectionHttpClient.post(UrlConnectionHttpClient.java:123)
	at com.openshift.internal.restclient.DefaultClient.create(DefaultClient.java:223)
	... 15 more
Caused by: java.io.IOException: Server returned HTTP response code: 415 for URL: https://openshift.default.svc.cluster.local/oapi/v1/namespaces/test/buildconfigs/frontend/instantiate
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1840)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
	at com.openshift.internal.restclient.http.UrlConnectionHttpClient.request(UrlConnectionHttpClient.java:186)
	... 17 more
Build step 'Perform builds in OpenShift' marked build as failure
Finished: FAILURE


Expected results:
Could trigger job in jenkins web console

Additional info:

Check this page 
https://openshift-129.lab.sjc.redhat.com:8443/oapi/v1/namespaces/test/buildconfigs/frontend/instantiate

{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "User \"system:anonymous\" cannot get buildconfigs/instantiate in project \"test\"",
  "reason": "Forbidden",
  "details": {
    "name": "frontend",
    "kind": "buildconfigs/instantiate"
  },
  "code": 403
}

Comment 1 Michal Fojtik 2016-02-23 12:03:14 UTC
This is because the 'frontend' build config does not exists. The build config name is 'ruby-sample-build'.

I will fix that sample Jenkins job. In meanwhile, you can manually change the 'frontend' to 'ruby-sample-build' in Job configuration.

Comment 3 Michal Fojtik 2016-02-26 09:28:48 UTC
XiuJuan Wang:

What application template you create in this step? 

"2.Create the sample application configuration"

Is it the one that is included in the Jenkins example directory or the sample-app?
Also I cannot reproduce this on origin using the RHEL7 image.

Comment 4 XiuJuan Wang 2016-02-26 09:52:04 UTC
This template, https://raw.githubusercontent.com/openshift/origin/master/examples/jenkins/application-template.json. 

you could reproduce this bug using registry.access.redhat.com/openshift3/jenkins-1-rhel7(ac9dd63162a5)

Comment 7 XiuJuan Wang 2016-02-29 09:51:50 UTC
Move this bugs as verified accoriding to comment #3

Comment 9 errata-xmlrpc 2016-05-12 16:30:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2016:1064