Bug 1304975

Summary: Failed to build when add Create resources in OpenShift with Add Build Step in config page for jenkins-1-rhel7 image
Product: OpenShift Container Platform Reporter: Wenjing Zheng <wzheng>
Component: ImageStreamsAssignee: Gabe Montero <gmontero>
Status: CLOSED ERRATA QA Contact: Wang Haoran <haowang>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.1.0CC: aos-bugs, bparees, gmontero, jokerman, mmccomas, tdawson
Target Milestone: ---   
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:28:05 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 Wenjing Zheng 2016-02-05 07:39:14 UTC
Description of problem:
Below warning appears when try to use "Add Build Step"->"Create resources in OpenShift":
Started by user Jenkins Admin
Building in workspace /var/lib/jenkins/jobs/testplugin/workspace
BUILD STEP:  OpenShiftCreator in perform on namespace test
ERROR: Build step failed with exceptionjava.lang.IllegalArgumentException: Invalid character: h
        at org.jboss.dmr.JSONParserImpl.invalid(JSONParserImpl.java:136)
        at org.jboss.dmr.JSONParser.yyLex(JSONParser.java:596)
        at org.jboss.dmr.JSONParser.yyParse(JSONParser.java:662)
        at org.jboss.dmr.ModelNode.fromJSONString(ModelNode.java:1472)
        at com.openshift.jenkins.plugins.pipeline.OpenShiftCreator.coreLogic(OpenShiftCreator.java:131)
        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

Version-Release number of selected component (if applicable):
jenkins-1-rhel7 f708901345d7

How reproducible:
always

Steps to Reproduce:
1. Create a project
2. $oc policy add-role-to-user admin system:serviceaccount:test:default -n test
3.  $oc new-app -f https://raw.githubusercontent.com/openshift/origin/master/examples/jenkins/jenkins-ephemeral-template.json
4. Go to jenkins job page click "new item" -->write item name: testplugin-->select "Freestyle project"-->save
5. select job "testplugin" to Configure
  click "Add build step"---->"Create resources in OpenShift " , and configure below:
The JSON or YAML that defines the OpenShift resource(s) to create : paste https://raw.githubusercontent.com/openshift/origin/master/examples/hello-openshift/hello-pod.json 
6. Save the changes and click Build Now

Actual results:
Job failed

Expected results:
Job should succeed

Additional info:

Comment 1 Ben Parees 2016-02-05 20:07:04 UTC
You need to paste the actual json content into the field, not the url to the json.

Comment 2 Ben Parees 2016-02-05 20:07:23 UTC
Gabe, we should probably make that field a textbox, not a textfield.

Comment 3 Gabe Montero 2016-02-05 22:14:30 UTC
yep, good call Ben, or maybe a "textarea" (described just before textbox at https://jenkins-ci.org/maven-site/jenkins-core/jelly-taglib-ref.html#form:textarea).

i'll play / compare and incorporate in my next push for the plugin

Comment 4 Wenjing Zheng 2016-02-06 02:05:31 UTC
Yes, should input the content of the json file, thanks! Closing this bug now.

Comment 6 errata-xmlrpc 2016-05-12 16:28:05 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