Bug 1304975 - Failed to build when add Create resources in OpenShift with Add Build Step in config page for jenkins-1-rhel7 image
Failed to build when add Create resources in OpenShift with Add Build Step in...
Product: OpenShift Container Platform
Classification: Red Hat
Component: Image (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Gabe Montero
Wang Haoran
Depends On:
  Show dependency treegraph
Reported: 2016-02-05 02:39 EST by Wenjing Zheng
Modified: 2016-05-12 12:28 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-05-12 12:28:05 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Wenjing Zheng 2016-02-05 02:39:14 EST
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:

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 15:07:04 EST
You need to paste the actual json content into the field, not the url to the json.
Comment 2 Ben Parees 2016-02-05 15:07:23 EST
Gabe, we should probably make that field a textbox, not a textfield.
Comment 3 Gabe Montero 2016-02-05 17:14:30 EST
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-05 21:05:31 EST
Yes, should input the content of the json file, thanks! Closing this bug now.
Comment 6 errata-xmlrpc 2016-05-12 12:28:05 EDT
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.


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