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
Reduced severity as the mock plugin is intended as a tool for automated testing.
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.
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
https://github.com/openshift/origin-server/pull/4210
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
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----------->