Bug 796919

Summary: If embedded configure fails it is not removed or tracked in mongo
Product: OKD Reporter: Dan McPherson <dmcphers>
Component: PodAssignee: Rajat Chopra <rchopra>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 2.xCC: jialiu, rmillner
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-02 21:56:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Dan McPherson 2012-02-23 21:14:00 UTC
Description of problem:

If embedded configure fails it is not removed or tracked in mongo

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Get an embedded configure to fail.  Add an exit 1 for example
2. Remove the exit 1
3. Try to create it again (will fail because there is stuff left on disk)
4. Try to remove it (it will fail because it isn't in mongo

  
Actual results:
It will fail because it is still on disk
But it isn't in mongo so you can't remove it

Expected results:
Result should be in mongo. before they are on disk
and when it fails it should remove it from the node.


Additional info:

Comment 1 Rajat Chopra 2012-02-28 07:26:56 UTC
Note: the problem observed is different from listed.
Try to create it again.. it says cant add again, its already embedded
Try to remove it... it says it was never added, add it first.

Either way, there was a problem because mongo ended up storing half the info about the failed cartridge.

Fixed with check in #692265f67d5fafb6db0a19c2b4143590dbd0aff7

Comment 2 Johnny Liu 2012-02-29 12:07:11 UTC
Verified this bug with devenv_1649, and PASS.

1. Add "exit 1" to /usr/libexec/li/cartridges/embedded/mongodb-2.0/info/hooks/configure

2. Try to embed mongodb to this app

3. Fail to embed as expected.
$ rhc-ctl-app -a jbosstest -e add-mongodb-2.0 -p xx
Problem reported from server. Response code was 500.
Re-run with -d for more information.

RESULT:
Node execution failure (invalid exit code from node).  If the problem persists please contact Red Hat support.

$ rhc-domain-info -p xx
Application Info
================
jbosstest
    Framework: jbossas-7
     Creation: 2012-02-29T06:45:45-05:00
         UUID: 95a3cfa1ba0b42779d1521dc852b0cc6
      Git URL: ssh://95a3cfa1ba0b42779d1521dc852b0cc6.rhcloud.com/~/git/jbosstest.git/
   Public URL: http://jbosstest-jialiu.dev.rhcloud.com/

 Embedded: 
      None

4. Remove "exit 1"

5. Re-embed successfully.
$ rhc-ctl-app -a jbosstest -e add-mongodb-2.0 -p xx

RESULT:

MongoDB 2.0 database added.  Please make note of these credentials:

       Root User: admin
   Root Password: a4Ik6eGIutxN
   Database Name: jbosstest
  Connection URL: mongodb://127.1.252.1:27017/

You can manage your new MongoDB by also embedding rockmongo-1.1

$ rhc-domain-info -p xx
Application Info
================
jbosstest
    Framework: jbossas-7
     Creation: 2012-02-29T06:45:45-05:00
         UUID: 95a3cfa1ba0b42779d1521dc852b0cc6
      Git URL: ssh://95a3cfa1ba0b42779d1521dc852b0cc6.rhcloud.com/~/git/jbosstest.git/
   Public URL: http://jbosstest-jialiu.dev.rhcloud.com/

 Embedded: 
      mongodb-2.0 - Connection URL: mongodb://127.1.252.1:27017/