Bug 991387 - Should not show succeed when erase an existing cartridge in /usr/libexec/openshift/cartridges via oo-admin-cartridge
Summary: Should not show succeed when erase an existing cartridge in /usr/libexec/open...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Jhon Honce
QA Contact: libra bugs
URL:
Whiteboard:
: 998026 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-02 10:16 UTC by Yan Du
Modified: 2015-05-14 23:25 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-30 00:48:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Yan Du 2013-08-02 10:16:12 UTC
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 21:33:49 UTC
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 08:37:55 UTC
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-17 02:11:33 UTC
*** Bug 998026 has been marked as a duplicate of this bug. ***

Comment 4 Jhon Honce 2013-08-19 15:37:54 UTC
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 06:30:46 UTC
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 07:15:24 UTC
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 23:59:27 UTC
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 05:33:09 UTC
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.