Bug 997924 - jbossas-7 build fails if the app has mock-plugin addon
Summary: jbossas-7 build fails if the app has mock-plugin addon
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Image
Version: 2.x
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Ben Parees
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-16 13:59 UTC by Oleg Fayans
Modified: 2016-12-01 00:27 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-24 03:22:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
jbossas boot.log (10.01 KB, text/x-log)
2013-08-16 13:59 UTC, Oleg Fayans
no flags Details

Description Oleg Fayans 2013-08-16 13:59:50 UTC
Created attachment 787273 [details]
jbossas boot.log

Description of problem:

jbossas-7 app fails to build after any git push if it has a mock-plugin addon
Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. rhc app create myapp jbossas-7
2. rhc cartridge add mock-plugin-0.1 -a myapp
3. echo "<p></p>" >> myapp/src/main/webapp/index.html
4. git commit -am "test" && git push

Actual results:
build fails with the following error:
An error occurred executing 'gear postreceive' (exit code: 1)


Expected results:


Additional info:
Attached application log

Comment 1 Jhon Honce 2013-08-16 16:26:07 UTC
Reduced severity as the mock plugin is intended as a tool for automated testing.

Comment 2 Ben Parees 2013-11-19 22:42:30 UTC
the issue is the environment variable introduced by the mock plugin, which makes its way into the sed operation that is attempting to update the jboss config with variable substitutions.

s/${env.OPENSHIFT_MOCK_PLUGIN_EXAMPLE}/expose OPENSHIFT_MOCK_PLUGIN_EXAMPLE="test_value"/g

There are two problems w/ this generated sed command:
1) it contains a space - this is breaking the sed command.  the entire pattern needs to be quoted or the space escaped
2) it contains quotes - this won't break the sed command, but the quotes won't appear in the final replaced config file which is probably not correct behavior, so the quotes need to be escaped.

Comment 3 Ben Parees 2013-11-20 16:24:16 UTC
this can also be recreated by adding the following environment variable rather than adding the mock plugin (and this also demonstrates that it is a wider issue than just for users of the mock plugin):

1. rhc app create myapp jbossas-7
2. rhc app env OPENSHIFT_MINE="a \"quoted variable\"" -a myapp
3. echo "<p></p>" >> myapp/src/main/webapp/index.html
4. cd myapp && git commit -am "test" && git push

Comment 5 openshift-github-bot 2013-11-21 00:10:29 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/82cc8c8786897e41f1d70b690d3259154c1af00f
bug 997924: jbossas-7 build fails if the app has mock-plugin addon

Comment 6 chunchen 2013-11-21 09:16:06 UTC
It's fixed, verified on devenv_4057, please refer to the following results:

1. rhc app create cas jbossas-7
2. rhc cartridge add mock-plugin-0.1 -a cas
3. echo "<p></p>" >> cas/src/main/webapp/index.html
4. git commit -am "test" && git push


<----------snip----------->
remote: [INFO] Packaging webapp
remote: [INFO] Assembling webapp [cas] in [/var/lib/openshift/528dcd895f95c9ad5000037f/app-root/runtime/repo/target/cas]
remote: [INFO] Processing war project
remote: [INFO] Copying webapp resources [/var/lib/openshift/528dcd895f95c9ad5000037f/app-root/runtime/repo/src/main/webapp]
remote: [INFO] Webapp assembled in [108 msecs]
remote: [INFO] Building war: /var/lib/openshift/528dcd895f95c9ad5000037f/app-root/runtime/repo/deployments/ROOT.war
remote: [INFO] WEB-INF/web.xml already added, skipping
remote: [INFO] ------------------------------------------------------------------------
remote: [INFO] BUILD SUCCESS
remote: [INFO] ------------------------------------------------------------------------
remote: [INFO] Total time: 9.618s
remote: [INFO] Finished at: Thu Nov 21 04:11:36 EST 2013
remote: [INFO] Final Memory: 8M/165M
remote: [INFO] ------------------------------------------------------------------------
remote: Preparing build for deployment
remote: Deployment id is da7dd4b8
remote: Activating deployment
remote: Starting Mock-Plugin cartridge
remote: Deploying JBoss
remote: Starting jbossas cartridge
remote: Found 127.1.244.1:8080 listening port
remote: Found 127.1.244.1:9999 listening port
remote: /var/lib/openshift/528dcd895f95c9ad5000037f/jbossas/standalone/deployments /var/lib/openshift/528dcd895f95c9ad5000037f/jbossas
remote: CLIENT_MESSAGE: Artifact: ./ROOT.war is still deploying
remote: /var/lib/openshift/528dcd895f95c9ad5000037f/jbossas
remote: Artifacts deployed: ./ROOT.war
remote: Result: success
remote: Activation status: success
remote: Deployment completed with status: success
To ssh://528dcd895f95c9ad5000037f.rhcloud.com/~/git/cas.git/
   c82f1a3..3d9a83c  master -> master
<----------snip----------->


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