Description of problem: When creating an application from a template, if there is a problem during the git clone step, the application creation fails hard without a useful error message. Version-Release number of selected component (if applicable): How reproducible: Always (if the template has a bad git url) Steps to Reproduce: 1. Create a template with a bad git url 2. Create an application from that template 3. Actual results: Generic Node Execution failure message The broker log shows: DEBUG: server results: Clonong git repository from remote 'git://github.com/linickx/wordpress-example.git'. DEBUG: server results: fatal: remote error: DEBUG: server results: Repository not found. DEBUG: server results: Initialized empty Git repository in /var/lib/stickshift/35a024a3aca64f568126867e4d37f8cb/git/drupal.git/ DEBUG: Cartridge command php-5.3::configure exitcode = 128 Expected results: Error message stating something about the git repo not being available. Additional info:
An early test should be done to validate the git repo is reachable and valid before any creation starts.
Added verification to the remote cloning command to stop and print a helpful error message if the remote clone fails. Crankcase commit 21d8924bd9. Waiting on pull request #123.
Moved to pull request #126.
Tested this on devenv_1850 with the following steps, it still failed with Node execution failure. 1. Create an template with wrong git url like: #rhc-admin-ctl-template -c add -d /tmp/des.yaml -g git://github.com/openshift/wordpress-example1.git -t testword --cost 1 -m '{"name1":"me"}' return: 4ba9919e4a0440a3a9b1d2c82cef882a 2. Create an app with the template: curl -k -X POST -H "Accept: application/xml" -H "Content-type: application/json" -d '{name:"myapp1", template: 4ba9919e4a0440a3a9b1d2c82cef882a}' --user xtian+t100:xx https://ec2-23-22-75-68.compute-1.amazonaws.com/broker/rest/domains/domainxdev02/applications Error shown in the response of RESTAPI: <severity>error</severity> <field nil="true"></field> <text>Failed to create application myapp1 due to:Node execution failure (invalid exit code from node). If the problem persists please contact Red Hat support.</text> <exit-code>143</exit-code> Error in broker log: DEBUG: server results: Cloning git repository from remote 'git://github.com/openshift/wordpress-example1.git'. DEBUG: server results: fatal: remote error: DEBUG: server results: Repository not found. DEBUG: server results: Initialized empty Git repository in /var/lib/stickshift/1bcb9fd6445b454087ac34db7df2b941/git/myapp1.git/ DEBUG: Cartridge command php-5.3::configure exitcode = 128 Node execution failure (invalid exit code from node). If the problem persists please contact Red Hat support. #<StickShift::NodeException: Node execution failure (invalid exit code from node). If the problem persists please contact Red Hat support.>
Ok, I see the problem. The error message is being suppressed both because the calling hook runs with "set -e" to exit on the first error and because the exception in broker isn't designed to bring better information to the surface. Taking this ticket out of being a release blocker. It only affects administrators creating new templates. And we need to work out the changes needed to bring better mcollective error reporting up through the broker.
Tested this bug on devenv_2640 today with the following steps: 1.Go to openshift website and login 2.Try to create an application with invalid input of source code field like "asdfasdf" Actual results: Caught server error like "We appear to be having technical difficulties.". The log of site is as following: 2013-01-08 00:43:31.534 [DEBUG] OpenShift API (7153.9ms) post https://localhost:443/broker/rest/domains/aaaa3434/applications.json [ code: 500 ] (pid:4024) 2013-01-08 00:43:31.538 [DEBUG] Server error: : #128: (pid:4024) 2013-01-08 00:43:31.539 [DEBUG] Found errors on the response object: {} (pid:4024) 2013-01-08 00:43:31.628 [ERROR] Unhandled exception reference #aad43ac456900be13ad68bdde7bcd410: Failed. Response code = 500. Response message = Internal Server Error. /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-console-1.3.2/lib/active_resource/persistent_connection.rb:209:in `handle_response' /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-console-1.3.2/lib/active_resource/persistent_connection.rb:172:in `request' /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-console-1.3.2/lib/active_resource/persistent_connection.rb:127:in `block in post' /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-console-1.3.2/lib/active_resource/persistent_connection.rb:275:in `with_auth' /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-console-1.3.2/lib/active_resource/persistent_connection.rb:127:in `post' /opt/rh/ruby193/root/usr/share/gems/gems/activeresource-3.2.8/lib/active_resource/base.rb:1360:in `create'
Created attachment 674514 [details] The broker log
*** This bug has been marked as a duplicate of bug 896364 ***