This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 997924 - jbossas-7 build fails if the app has mock-plugin addon
jbossas-7 build fails if the app has mock-plugin addon
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Image (Show other bugs)
2.x
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: Ben Parees
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-16 09:59 EDT by Oleg Fayans
Modified: 2016-11-30 19:27 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-01-23 22:22:51 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Oleg Fayans 2013-08-16 09:59:50 EDT
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 12:26:07 EDT
Reduced severity as the mock plugin is intended as a tool for automated testing.
Comment 2 Ben Parees 2013-11-19 17:42:30 EST
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 11:24:16 EST
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-20 19:10:29 EST
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 04:16:06 EST
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@cas-cdm.dev.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.