Bug 1101524 - The download malformed cartridge is also added to the app even if the command "rhc cartridge add" failed
Summary: The download malformed cartridge is also added to the app even if the command...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers
Version: 2.1.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Luke Meyer
QA Contact: libra bugs
URL:
Whiteboard:
Depends On: 1100743
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-05-27 12:02 UTC by Brenton Leanhardt
Modified: 2014-06-23 07:37 UTC (History)
8 users (show)

Fixed In Version: rubygem-openshift-origin-common-1.22.5.6-1.el6op
Doc Type: Bug Fix
Doc Text:
Deploying a downloadable cartridge that had a malformed manifest to an application reported an error, however the cartridge was still added to the application. As a result, the application could no longer be deleted using the client tools. This bug fix updates manifest validation when adding cartridges; adding a downloadable cartridge with a malformed manifest now provides better information on problematic entries and the cartridge is no longer added to the application.
Clone Of: 1100743
Environment:
Last Closed: 2014-06-23 07:37:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:0781 0 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.1.2 bug fix update 2014-06-23 11:36:38 UTC

Description Brenton Leanhardt 2014-05-27 12:02:04 UTC
+++ This bug was initially created as a clone of Bug #1100743 +++

Description of problem:
The download malformed cartridge is also added to the app even if the command "rhc cartridge add" failed. The app can not be deleted when run the command "rhc app delete" after adding the malformed cartridge failed.

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

How reproducible:
always

Steps to Reproduce:
1. create one app
    rhc app create app1 php-5.3
2. add the download malformed cartridge to the app
    rhc cartridge add https://raw.githubusercontent.com/jhou1/openshift-malformed-cart/master/metadata/manifest.yml -a app1

Actual results:
The cartridge added failed message poped up, but the cartridge is displayed in the app information by the command "rhc apps".
Tha app can not be deleted.

----------------------------------
[gusun@dhcp-10-92 apps]$ rhc cartridge add https://raw.githubusercontent.com/jhou1/openshift-malformed-cart/master/metadata/manifest.yml -a app1
The cartridge
'https://raw.githubusercontent.com/jhou1/openshift-malformed-cart/master/metadata/manifest.yml'
will be downloaded and installed
Adding
https://raw.githubusercontent.com/jhou1/openshift-malformed-cart/master/metadata/manifest.yml
to application 'app1' ...
Unexpected error: can't convert nil into String

[gusun@dhcp-10-92 apps]$ rhc apps
app1 @ http://app1-gusun.int.rhcloud.com/
  (uuid: 537f2cae03ef643dba000017)
-----------------------------------------
  Domain:     gusun
  Created:    7:10 PM
  Gears:      1 (defaults to small)
  Git URL:    ssh://537f2cae03ef643dba000017.rhcloud.com/~/git/app1.git/
  SSH:        537f2cae03ef643dba000017.rhcloud.com
  Deployment: auto (on git push)

  php-5.3 (PHP 5.3)
  -----------------
    Gears: Located with jhou-jhou-mysql-5.1

  jhou-jhou-mysql-5.1 (MySQL Database 5.1)
  ----------------------------------------
    From:    https://raw.githubusercontent.com/jhou1/openshift-malformed-cart/master/metadata/manifest.yml
    Website: http://www.mysql.com
    Gears:   Located with php-5.3

You have access to 1 application.
[gusun@dhcp-10-92 apps]$ rhc app delete app1
This is a non-reversible action! Your application code and data will be
permanently deleted if you continue!

Are you sure you want to delete the application 'app1'? (yes|no): yes

Deleting application 'app1' ... 
+ git clone https://github.com/jhou1/downloadable-mysql.git jhou-mysql
fatal: destination path 'jhou-mysql' already exists and is not an empty
directory.

[gusun@dhcp-10-92 apps]$ 
----------------------------------


Expected results:
The cartridge should NOT be added successfully, and the app should be deleted by the command "rhc app delete".

Additional info:
Regression bug.
https://bugzilla.redhat.com/show_bug.cgi?id=977519

--- Additional comment from Jhon Honce on 2014-05-23 17:47:28 EDT ---

Node validation of manifest fixed in: 
Fixed in https://github.com/openshift/origin-server/pull/5449

--- Additional comment from openshift-github-bot on 2014-05-23 18:38:51 EDT ---

Commits pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/cba945eb794a21159f88e3b188283339299d4671
Bug 1100743 - Validate manifest endpoint element

https://github.com/openshift/origin-server/commit/87d07cd8070e2923df20cd31b642c647c535506d
Bug 1100743 - Validate manifest endpoint element

* Add test for empty elements as well

--- Additional comment from Guolei Sun on 2014-05-25 22:27:26 EDT ---

Verified on the latest devenv_4815.

Pass log:

---log begin---
[guoleis@rhl65 apps]$ rhc cartridge add https://raw.githubusercontent.com/jhou1/openshift-malformed-cart/master/metadata/manifest.yml -a app1
The cartridge
'https://raw.githubusercontent.com/jhou1/openshift-malformed-cart/master/metadata/manifest.yml'
will be downloaded and installed
Adding
https://raw.githubusercontent.com/jhou1/openshift-malformed-cart/master/metadata/manifest.yml
to application 'app1' ...
Unable to complete the requested operation due to: Couldn't parse
endpoints: Couldn't parse endpoint entry '{"Private-IP-Name"=>"DB_HOST",
"Private-Port"=>3306, "Public-Port-Name"=>"DB_PROXY_PORT"}':
Private-Port-Name is a required element
Reference ID: 43ae2af7abbabc84c334160ae68dcd3c
[guoleis@rhl65 apps]$ rhc app delete app1
This is a non-reversible action! Your application code and data will be
permanently deleted if you continue!

Are you sure you want to delete the application 'app1'? (yes|no): yes

Deleting application 'app1' ... deleted

---log end---

Comment 5 Yanping Zhang 2014-06-11 06:24:59 UTC
    Verified on 2.1.z/2014-06-10.3
     
    Steps to verify:
    1.Create an app
     # rhc app create test1 php-5.3
    2.add the download malformed cartridge to the app
     # rhc cartridge add https://raw.githubusercontent.com/jhou1/openshift-malformed-cart/master/metadata/manifest.yml -a test1
    3.Check the app
     # rhc app show test1 -l zyp
    4.Delete the app
     # rhc app delete test1 -l
     
    Actual results:
    2.Prompt info:
    The cartridge
    'https://raw.githubusercontent.com/jhou1/openshift-malformed-cart/master/metadata/manifest.yml'
    will be downloaded and installed
    Adding
    https://raw.githubusercontent.com/jhou1/openshift-malformed-cart/master/metadata/manifest.yml
    to application 'test1' ...
    Unable to complete the requested operation due to: Couldn't parse endpoints:
    Couldn't parse endpoint entry '{"Private-IP-Name"=>"DB_HOST",
    "Private-Port"=>3306, "Public-Port-Name"=>"DB_PROXY_PORT"}': Private-Port-Name
    is a required element
    Reference ID: 8064ca3c17700ce49bb358ad3ce402d8
    
    3.The app info showed without the malformed cartridge added
    test1 @ http://test1-yes.ose21z-manual.com.cn/
      (uuid: 5397f1a8db26c85e6f000038)
    ----------------------------------------------
      Domain:     yes
      Created:    11:05 PM
      Gears:      1 (defaults to small)
      Git URL:    ssh://5397f1a8db26c85e6f000038.com.cn/~/git/test1.git/
      SSH:        5397f1a8db26c85e6f000038.com.cn
      Deployment: auto (on git push)
     
      php-5.3 (PHP 5.3)
      -----------------
        Gears: 1 small
     
    4.Could delete successfully:
    This is a non-reversible action! Your application code and data will be
    permanently deleted if you continue!
     
    Are you sure you want to delete the application 'test1'? (yes|no): yes
     
    Deleting application 'test1' ... deleted

Comment 7 errata-xmlrpc 2014-06-23 07:37:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-0781.html


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