Bug 991387 - Should not show succeed when erase an existing cartridge in /usr/libexec/openshift/cartridges via oo-admin-cartridge
Should not show succeed when erase an existing cartridge in /usr/libexec/open...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Jhon Honce
libra bugs
: Reopened
: 998026 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-02 06:16 EDT by Yan Du
Modified: 2015-05-14 19:25 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-01-29 19:48:17 EST
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 Yan Du 2013-08-02 06:16:12 EDT
Description of problem:
erase cartridge by oo-admin-cartridge, and check the cartridge by oo-admin-cartridge -a list, the cartridge can't be erased successfully


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


How reproducible:
Always


Steps to Reproduce:

1. Erase a cartridge by oo-admin-cartridge --action erase --name zend --version 5.6 --cartridge_version 0.0.4
2. Run oo-admin-cartridge -a list to check


Actual results:
[root@ip-10-167-13-167 cartridges]# oo-admin-cartridge --action erase --name zend --version 5.6 --cartridge_version 0.0.4
succeeded

[root@ip-10-167-13-167 cartridges]# oo-admin-cartridge -a list
(redhat, diy, 0.1, 0.0.3)
(redhat, php, 5.3, 0.0.3)
(redhat, mongodb, 2.2, 0.2.1)
(redhat, jbossas, 7, 0.0.4)
(redhat, cron, 1.4, 0.0.4)
(redhat, perl, 5.10, 0.0.3)
(redhat, mock, 0.1, 0.0.1)
(redhat, zend, 5.6, 0.0.3)
(redhat, zend, 5.6, 0.0.4)       <===============
(redhat, jenkins, 1.4, 0.0.3)
(redhat, phpmyadmin, 3.4, 0.0.3)
(redhat, nodejs, 0.6, 0.0.3)
(redhat, haproxy, 1.4, 0.0.4)
(redhat, jbossews, 2.0, 0.0.4)
(redhat, mock-plugin, 0.1, 0.0.1)
(redhat, jbosseap, 6.0, 0.0.4)
(redhat, 10gen-mms-agent, 0.1, 0.0.2)
(redhat, python, 2.6, 0.0.3)
(redhat, postgresql, 9.2, 0.3.1)
(redhat, switchyard, 0.6, 0.0.3)
(redhat, ruby, 1.9, 0.0.5)
(redhat, metrics, 0.1, 0.0.2)
(redhat, jenkins-client, 1.4, 0.0.2)
(redhat, mysql, 5.1, 0.2.1)
(redhat, rockmongo, 1.1, 0.0.2)


Expected results:
the cartridge can be erased successfully
Comment 1 Jhon Honce 2013-08-02 17:33:49 EDT
Erase will only remove versions of cartridges not included in /usr/libexec/openshift/cartridges

If that is not your case please reopen.
Comment 2 Yan Du 2013-08-05 04:37:55 EDT
test on devenv-stage_437

1. cartridge can be erased if the cartridge version is not included in /usr/libexec/openshift/cartridges

2. should not show "succeeded" when trying to erase the cartridge which is still included in /usr/libexec/openshift/cartridges, a friendly message show up will be perfect. Thanks.
Comment 3 Miciah Dashiel Butler Masters 2013-08-16 22:11:33 EDT
*** Bug 998026 has been marked as a duplicate of this bug. ***
Comment 4 Jhon Honce 2013-08-19 11:37:54 EDT
oo-admin-cartridge removes/adds files from the cartridge repository in /var/lib/openshift/.cartridge_repository.  If you attempt to remove versions of cartridges not installed in the repository error messages will be generated.

Every restart of mcollective causes the cartridge repository to be reinstalled.
Comment 5 Yan Du 2013-08-20 02:30:46 EDT
test on devenv_3677

issue still can be reproduced.

steps:

1. modified the version in vim /usr/libexec/openshift/cartridges/zend/metadata/manifest.yml
 (eg: change "Cartridge-Version: 0.0.3"  to "Cartridge-Version: 0.0.1")

2. oo-admin-cartridge -a install -s /usr/libexec/openshift/cartridges/zend

3. oo-admin-cartridge -l
(redhat, zend, 5.6, 0.0.1)
(redhat, zend, 5.6, 0.0.3)

4. even the version is included in /usr/libexec/openshift/cartridges/zend/metadata/manifest.yml, try to erase it.

[root@ip-10-178-12-200 ~]# oo-admin-cartridge --action erase --name zend --version 5.6 --cartridge_version 0.0.1
succeeded

5. use oo-admin-cartridge -l to check, found the zend 5.6 version 0.0.1 is still existed
(redhat, zend, 5.6, 0.0.1)
(redhat, zend, 5.6, 0.0.3)

if the cartridge can't be removed when it is included, then in step4, should not show succeeded, maybe should show something else, like "included cartrdige can't be removed."  showing succeeded is a little confusing, since the cartridge can't be removed (result in step5). 
Thanks
Comment 6 Qiushui Zhang 2013-09-26 03:15:24 EDT
As long as the command "oo-admin-cartridge" goes into the "install" process, it will return a "succeeded".

[root@ip-10-185-58-142 cgroup]# oo-admin-cartridge -a install -s /usr/libexec/openshift/cartridges/abc
install failed for /usr/libexec/openshift/cartridges/abc: Illegal path to cartridge source: '/usr/libexec/openshift/cartridges/abc'
succeeded

This could be confusing.
Comment 7 openshift-github-bot 2013-11-06 18:59:27 EST
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/d4e4f322a1a0185df57f434c20e02d16554b8545
Fix bug 991387: Don't allow erase of carts in the cart_base_path
Comment 8 Yan Du 2013-11-08 00:33:09 EST
Test on devenv_4003, when install/erase an invalid cartridge, will not show succeed message again.


[root@ip-10-179-31-109 ~]#  oo-admin-cartridge -a install -s /usr/libexec/openshift/cartridges/abc
install failed for /usr/libexec/openshift/cartridges/abc: Illegal path to cartridge source: '/usr/libexec/openshift/cartridges/abc'
installation failed


[root@ip-10-179-31-109 ~]# oo-admin-cartridge --action erase --name zend --version 5.6 --cartridge_version 0.0.1
requested cartridge does not exist: (key not found: (zend, 5.6, 0.0.1))


[root@ip-10-179-31-109 ~]# oo-admin-cartridge --action erase --name zend --version 5.6 --cartridge_version 0.0.6
Couldn't erase cartridge: (Cannot erase cartridge installed in CARTRIDGE_BASE_PATH)

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