Bug 796919 - If embedded configure fails it is not removed or tracked in mongo
Summary: If embedded configure fails it is not removed or tracked in mongo
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Pod
Version: 2.x
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Rajat Chopra
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-23 21:14 UTC by Dan McPherson
Modified: 2015-05-15 01:47 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-02 21:56:36 UTC
Target Upstream Version:


Attachments (Terms of Use)

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/


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