Bug 996676 - Cartridge directory is not removed immediately after cartridge-remove
Cartridge directory is not removed immediately after cartridge-remove
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Pod (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Abhishek Gupta
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-13 12:59 EDT by Michal Fojtik
Modified: 2015-05-14 20:19 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-29 08:50:39 EDT
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)

  None (edit)
Description Michal Fojtik 2013-08-13 12:59:38 EDT
Description of problem:

When removing a cartridge from application, the console states it is removed and it exists, but the cartridge directory is still in gear and thus you cannot add it again for a while.


Steps to Reproduce:

1. Create whatever application using rhc create
2. Add a custom cartridge via $ rhc add-cartridge
3. Remove the cartridge viac $ rhc remove-cartridge

Boom, the fails with:

 ~/demo01 → rhc add-cartridge https://raw.github.com/mfojtik/openshift-puma-cartridge/master/metadata/manifest.yml --app demo01
The cartridge 'https://raw.github.com/mfojtik/openshift-puma-cartridge/master/metadata/manifest.yml' will be downloaded and installed
Adding https://raw.github.com/mfojtik/openshift-puma-cartridge/master/metadata/manifest.yml to application 'demo01' ... 
+ git clone git://github.com/mfojtik/openshift-puma-cartridge.git puma
fatal: destination path 'puma' already exists and is not an empty directory.

Expected results:

We should poll in the 'remove-cartridge' command until the directory is erased from the gear and after that say that the cartridge was fully removed.

Additional info:
Comment 1 Hiro Asari 2013-08-13 15:41:14 EDT
The cartridge removal is done by broker's REST call:

https://XXXXX/broker/rest/domains

Broker needs to make sure that the directories are remove before returning success to the client.
Comment 2 Abhishek Gupta 2013-08-15 18:38:30 EDT
Can you give provide me with a custom cartridge that I can use to reproduce this issue? The cartridge in the example above is a web_framework cartridge and cannot be added to an existing application.
Comment 3 Michal Fojtik 2013-08-16 08:22:11 EDT
Sure,

The 'ruby01', is just empty Ruby-1.9 application (rhc app create ruby01 ruby-1.9):

 ~/code/openshift-origin-cartridge-puma → rhc cartridge-remove mfojtik-puma --app ruby01
Using mfojtik-puma-2.4.1 (Puma 2.4.1) for 'mfojtik-puma'

Removing a cartridge is a destructive operation that may result in loss of data associated with the cartridge.

Are you sure you wish to remove mfojtik-puma-2.4.1 from 'ruby01'? (yes|no): yes

Removing mfojtik-puma-2.4.1 from 'ruby01' ... removed
 ~/code/openshift-origin-cartridge-puma → rhc cartridge-add https://raw.github.com/mfojtik/openshift-puma-cartridge/master/metadata/manifest.yml --app ruby01
The cartridge 'https://raw.github.com/mfojtik/openshift-puma-cartridge/master/metadata/manifest.yml' will be downloaded and installed
Adding https://raw.github.com/mfojtik/openshift-puma-cartridge/master/metadata/manifest.yml to application 'ruby01' ... 
+ git clone git://github.com/mfojtik/openshift-puma-cartridge.git puma
fatal: destination path 'puma' already exists and is not an empty directory.


 ~/code/openshift-origin-cartridge-puma → rhc cartridge-add https://raw.github.com/mfojtik/openshift-puma-cartridge/master/metadata/manifest.yml --app ruby01
The cartridge 'https://raw.github.com/mfojtik/openshift-puma-cartridge/master/metadata/manifest.yml' will be downloaded and installed
Adding https://raw.github.com/mfojtik/openshift-puma-cartridge/master/metadata/manifest.yml to application 'ruby01' ... done

mfojtik-puma-2.4.1 (Puma 2.4.1)
-------------------------------
  From:  https://raw.github.com/mfojtik/openshift-puma-cartridge/master/metadata/manifest.yml
  Gears: Located with ruby-1.9

Puma cartridge succesfully installed.
Comment 4 Michal Fojtik 2013-08-16 08:23:44 EDT
Also I discovered, that the directory is being removed right after I execute cartridge-add second time... 

+ I'm not able to reproduce this for 'addon' cartridges.
Comment 5 Abhishek Gupta 2013-08-19 16:49:24 EDT
Figured out the problem. The manifest file is missing the "plugin" category. Forked the repo, and successfully tested after adding the "plugin" category.
Comment 6 Jianwei Hou 2013-08-19 22:37:23 EDT
Looks like this is an issue with the custom cartridge other than broker, the problem is not reproducible from QE side. According to comment 5, the problem can be resolved after adding the missing category. Moving to verified.

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