Bug 861303 - [US2813][fork] Can not add cartridge successfully with syntax "rhc cartridge add -c $cartridgetype -a $appname"
Summary: [US2813][fork] Can not add cartridge successfully with syntax "rhc cartridge ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: oc
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Clayton Coleman
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-28 05:45 UTC by Wei Sun
Modified: 2015-05-15 02:05 UTC (History)
1 user (show)

Fixed In Version: fork_ami_US2597_US2599_US2813_US2817_US2872_186
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-11-06 18:50:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Wei Sun 2012-09-28 05:45:22 UTC
Description of problem:
 Run "rhc cartridge add -h",could get -c option,but can not work well while add cartridge with rhc cartridge add -c mongodb-2.2 -a $appbame . If don't use -c option,like"rhc cartridge mongodb-2.2 -a $appname",can work well.  
 
But using -c option to remove cartridge will work like : rhc cartrdge remove -c mongodb-2.2 -a $appname
 
Version-Release number of selected component (if applicable):
server:devenv_2248
client:building an rhc package on fork_ami_US2597_US2599_US2813_US2817_US2872_173 (ami-f92f9d90)

How reproducible:
always

Steps to Reproduce:
1.create an app
2.add a cartridge to the app with -c option
rhc cartridge add -a $appname -c $cartridge_type

Actual results:

OpenShiftmatoMacBook-Pro:test OpenShift$ rhc cartridge add -a zendtest -c mongodb-2.2 -d
Password: ******
D, [2012-09-28T13:14:15.751242 #809] DEBUG -- : Connecting to https://ec2-23-22-148-197.compute-1.amazonaws.com/broker/rest/api
D, [2012-09-28T13:14:17.073572 #809] DEBUG -- : Getting all domains
D, [2012-09-28T13:14:17.073884 #809] DEBUG -- : Request: #<RestClient::Request:0x102405440 @tf=nil, @verify_ssl=false, @open_timeout=nil, @ssl_ca_file=nil, @password=nil, @url="https://ec2-23-22-148-197.compute-1.amazonaws.com/broker/rest/domains", @raw_response=false, @processed_headers={"Authorization"=>"Basic d3N1bkByZWRoYXQuY29tOnJlaGRhdA==", "Content-Type"=>"application/x-www-form-urlencoded", "User-Agent"=>"rhc/0.99.3 (ruby 1.8.7; universal-darwin10.0)", "Content-Length"=>"0", "Accept-Encoding"=>"gzip, deflate", "Accept"=>"application/json"}, @payload="", @ssl_client_key=nil, @user=nil, @timeout=nil, @method="GET", @max_redirects=10, @cookies={}, @ssl_client_cert=nil, @args={:timeout=>nil, :method=>"GET", :headers=>{"Authorization"=>"Basic d3N1bkByZWRoYXQuY29tOnJlaGRhdA==", "User-Agent"=>"rhc/0.99.3 (ruby 1.8.7; universal-darwin10.0)", :accept=>:json}, :url=>"https://ec2-23-22-148-197.compute-1.amazonaws.com/broker/rest/domains", :payload=>{}}, @block_response=nil, @headers={"Authorization"=>"Basic d3N1bkByZWRoYXQuY29tOnJlaGRhdA==", "User-Agent"=>"rhc/0.99.3 (ruby 1.8.7; universal-darwin10.0)", :accept=>:json}>
Missing required argument 'cart_type'.
Usage: rhc cartridge add <cartridge_type> [--namespace namespace] [--app app]
Add a cartridge to your application
Options for cartridge add
  -n, --namespace namespace Namespace of the application you are adding the cartridge to
  -a, --app app             Application you are adding the cartridge to
  -c, --cartridge cart_type The type of the cartridge you are adding (run 'rhc cartridge list' to obtain a list of available
cartridges)
Global Options
  -l, --rhlogin login       OpenShift login
  -p, --password password   OpenShift password
  -d, --debug               Turn on debugging
  --noprompt                Do not ask for input
  --config FILE             Path of a different config file
  -h, --help                Display help documentation
  -v, --version             Display version information
  --trace                   Display backtrace when an error occurs
  --timeout                 Set the timeout in seconds for network commands

Expected results:
Can add cartridge to the app successfully.

Additional info:
1.without -c option,can work
OpenShiftmatoMacBook-Pro:test OpenShift$ rhc cartridge add mongodb-2.2 -a zendtest  -d
Password: ******
D, [2012-09-28T13:25:22.433898 #818] DEBUG -- : Connecting to https://ec2-23-22-148-197.compute-1.amazonaws.com/broker/rest/api
D, [2012-09-28T13:25:23.607423 #818] DEBUG -- : Getting all domains
D, [2012-09-28T13:25:23.607725 #818] DEBUG -- : Request: #<RestClient::Request:0x102408af0 @tf=nil, @verify_ssl=false, @open_timeout=nil, @ssl_ca_file=nil, @password=nil, @url="https://ec2-23-22-148-197.compute-1.amazonaws.com/broker/rest/domains", @raw_response=false, @processed_headers={"Authorization"=>"Basic d3N1bkByZWRoYXQuY29tOnJlZGhhdA==", "Content-Type"=>"application/x-www-form-urlencoded", "User-Agent"=>"rhc/0.99.3 (ruby 1.8.7; universal-darwin10.0)", "Content-Length"=>"0", "Accept-Encoding"=>"gzip, deflate", "Accept"=>"application/json"}, @payload="", @ssl_client_key=nil, @user=nil, @timeout=nil, @method="GET", @max_redirects=10, @cookies={}, @ssl_client_cert=nil, @args={:timeout=>nil, :method=>"GET", :headers=>{"Authorization"=>"Basic d3N1bkByZWRoYXQuY29tOnJlZGhhdA==", "User-Agent"=>"rhc/0.99.3 (ruby 1.8.7; universal-darwin10.0)", :accept=>:json}, :url=>"https://ec2-23-22-148-197.compute-1.amazonaws.com/broker/rest/domains", :payload=>{}}, @block_response=nil, @headers={"Authorization"=>"Basic d3N1bkByZWRoYXQuY29tOnJlZGhhdA==", "User-Agent"=>"rhc/0.99.3 (ruby 1.8.7; universal-darwin10.0)", :accept=>:json}>
D, [2012-09-28T13:25:24.845868 #818] DEBUG -- : Finding cartridge typeembeddedregex^mongodb-2.2(-[0-9.]+){0,1}$
D, [2012-09-28T13:25:24.845949 #818] DEBUG -- : Getting all cartridges
D, [2012-09-28T13:25:24.846221 #818] DEBUG -- : Request: #<RestClient::Request:0x1023aefc8 @tf=nil, @verify_ssl=false, @open_timeout=nil, @ssl_ca_file=nil, @password=nil, @url="https://ec2-23-22-148-197.compute-1.amazonaws.com/broker/rest/cartridges", @raw_response=false, @processed_headers={"Authorization"=>"Basic d3N1bkByZWRoYXQuY29tOnJlZGhhdA==", "Content-Type"=>"application/x-www-form-urlencoded", "User-Agent"=>"rhc/0.99.3 (ruby 1.8.7; universal-darwin10.0)", "Content-Length"=>"0", "Accept-Encoding"=>"gzip, deflate", "Accept"=>"application/json"}, @payload="", @ssl_client_key=nil, @user=nil, @timeout=nil, @method="GET", @max_redirects=10, @cookies={}, @ssl_client_cert=nil, @args={:timeout=>nil, :method=>"GET", :headers=>{"Authorization"=>"Basic d3N1bkByZWRoYXQuY29tOnJlZGhhdA==", "User-Agent"=>"rhc/0.99.3 (ruby 1.8.7; universal-darwin10.0)", :accept=>:json}, :url=>"https://ec2-23-22-148-197.compute-1.amazonaws.com/broker/rest/cartridges", :payload=>{}}, @block_response=nil, @headers={"Authorization"=>"Basic d3N1bkByZWRoYXQuY29tOnJlZGhhdA==", "User-Agent"=>"rhc/0.99.3 (ruby 1.8.7; universal-darwin10.0)", :accept=>:json}>
Adding 'mongodb-2.2' to application 'zendtest'
D, [2012-09-28T13:25:26.207971 #818] DEBUG -- : Finding domain wsunfull
D, [2012-09-28T13:25:26.208040 #818] DEBUG -- : Getting all domains
D, [2012-09-28T13:25:26.208305 #818] DEBUG -- : Request: #<RestClient::Request:0x1021aed90 @tf=nil, @verify_ssl=false, @open_timeout=nil, @ssl_ca_file=nil, @password=nil, @url="https://ec2-23-22-148-197.compute-1.amazonaws.com/broker/rest/domains", @raw_response=false, @processed_headers={"Authorization"=>"Basic d3N1bkByZWRoYXQuY29tOnJlZGhhdA==", "Content-Type"=>"application/x-www-form-urlencoded", "User-Agent"=>"rhc/0.99.3 (ruby 1.8.7; universal-darwin10.0)", "Content-Length"=>"0", "Accept-Encoding"=>"gzip, deflate", "Accept"=>"application/json"}, @payload="", @ssl_client_key=nil, @user=nil, @timeout=nil, @method="GET", @max_redirects=10, @cookies={}, @ssl_client_cert=nil, @args={:timeout=>nil, :method=>"GET", :headers=>{"Authorization"=>"Basic d3N1bkByZWRoYXQuY29tOnJlZGhhdA==", "User-Agent"=>"rhc/0.99.3 (ruby 1.8.7; universal-darwin10.0)", :accept=>:json}, :url=>"https://ec2-23-22-148-197.compute-1.amazonaws.com/broker/rest/domains", :payload=>{}}, @block_response=nil, @headers={"Authorization"=>"Basic d3N1bkByZWRoYXQuY29tOnJlZGhhdA==", "User-Agent"=>"rhc/0.99.3 (ruby 1.8.7; universal-darwin10.0)", :accept=>:json}>
D, [2012-09-28T13:25:27.617606 #818] DEBUG -- : Finding application :name => zendtest, :framework => 
D, [2012-09-28T13:25:27.617689 #818] DEBUG -- : Getting all applications for domain wsunfull
D, [2012-09-28T13:25:27.617964 #818] DEBUG -- : Request: #<RestClient::Request:0x1021598e0 @tf=nil, @verify_ssl=false, @open_timeout=nil, @ssl_ca_file=nil, @password=nil, @url="https://ec2-23-22-148-197.compute-1.amazonaws.com/broker/rest/domains/wsunfull/applications", @raw_response=false, @processed_headers={"Authorization"=>"Basic d3N1bkByZWRoYXQuY29tOnJlZGhhdA==", "Content-Type"=>"application/x-www-form-urlencoded", "User-Agent"=>"rhc/0.99.3 (ruby 1.8.7; universal-darwin10.0)", "Content-Length"=>"0", "Accept-Encoding"=>"gzip, deflate", "Accept"=>"application/json"}, @payload="", @ssl_client_key=nil, @user=nil, @timeout=nil, @method="GET", @max_redirects=10, @cookies={}, @ssl_client_cert=nil, @args={:timeout=>nil, :method=>"GET", :headers=>{"Authorization"=>"Basic d3N1bkByZWRoYXQuY29tOnJlZGhhdA==", "User-Agent"=>"rhc/0.99.3 (ruby 1.8.7; universal-darwin10.0)", :accept=>:json}, :url=>"https://ec2-23-22-148-197.compute-1.amazonaws.com/broker/rest/domains/wsunfull/applications", :payload=>{}}, @block_response=nil, @headers={"Authorization"=>"Basic d3N1bkByZWRoYXQuY29tOnJlZGhhdA==", "User-Agent"=>"rhc/0.99.3 (ruby 1.8.7; universal-darwin10.0)", :accept=>:json}>
D, [2012-09-28T13:25:29.101137 #818] DEBUG -- : Adding cartridge mongodb-2.2
D, [2012-09-28T13:25:29.101498 #818] DEBUG -- : Request: #<RestClient::Request:0x101fcbe88 @tf=nil, @verify_ssl=false, @open_timeout=nil, @ssl_ca_file=nil, @password=nil, @url="https://ec2-23-22-148-197.compute-1.amazonaws.com/broker/rest/domains/wsunfull/applications/zendtest/cartridges", @raw_response=false, @processed_headers={"Authorization"=>"Basic d3N1bkByZWRoYXQuY29tOnJlZGhhdA==", "Content-Type"=>"application/x-www-form-urlencoded", "User-Agent"=>"rhc/0.99.3 (ruby 1.8.7; universal-darwin10.0)", "Content-Length"=>"16", "Accept-Encoding"=>"gzip, deflate", "Accept"=>"application/json"}, @payload="name=mongodb-2.2", @ssl_client_key=nil, @user=nil, @timeout=nil, @method="POST", @max_redirects=10, @cookies={}, @ssl_client_cert=nil, @args={:timeout=>nil, :method=>"POST", :headers=>{"Authorization"=>"Basic d3N1bkByZWRoYXQuY29tOnJlZGhhdA==", "User-Agent"=>"rhc/0.99.3 (ruby 1.8.7; universal-darwin10.0)", :accept=>:json}, :url=>"https://ec2-23-22-148-197.compute-1.amazonaws.com/broker/rest/domains/wsunfull/applications/zendtest/cartridges", :payload=>{:name=>"mongodb-2.2"}}, @block_response=nil, @headers={"Authorization"=>"Basic d3N1bkByZWRoYXQuY29tOnJlZGhhdA==", "User-Agent"=>"rhc/0.99.3 (ruby 1.8.7; universal-darwin10.0)", :accept=>:json}>
Success
Useful mongodb-2.2 properties
=============================
  password       = cTs-hALN5bD9
  database_name  = zendtest
  username       = admin
  connection_url = mongodb://127.0.251.1:27017/

2.rhc cartridge add -h
OpenShiftmatoMacBook-Pro:test OpenShift$ rhc cartridge add -h
Usage: rhc cartridge add <cartridge_type> [--namespace namespace] [--app app]
Add a cartridge to your application
Options for cartridge add
  -n, --namespace namespace Namespace of the application you are adding the cartridge to
  -a, --app app             Application you are adding the cartridge to
  -c, --cartridge cart_type The type of the cartridge you are adding (run 'rhc cartridge list' to obtain a list of available
cartridges)
Global Options
  -l, --rhlogin login       OpenShift login
  -p, --password password   OpenShift password
  -d, --debug               Turn on debugging
  --noprompt                Do not ask for input
  --config FILE             Path of a different config file
  -h, --help                Display help documentation
  -v, --version             Display version information
  --trace                   Display backtrace when an error occurs
  --timeout                 Set the timeout in seconds for network commands

3.remove the cartridge with -c option,can work
OpenShiftmatoMacBook-Pro:test OpenShift$ rhc cartridge remove -c mongodb-2.2 -a zendtest --confirm
Password: ******
RESULT:
Success: Cartridge 'mongodb-2.2' removed from application 'zendtest'.

4.use master rhc 0.99.2,can work
[wsun@localhost ~]$ rhc app cartridge add -a zendtest -c mongodb-2.2
Password: ******
RESULT:
MongoDB 2.2 database added.  Please make note of these credentials:
       Root User: admin
   Root Password: eAGc9zp_VtUC
   Database Name: zendtest
Connection URL: mongodb://127.0.251.1:27017/
You can manage your new MongoDB by also embedding rockmongo-1.1

Comment 1 John (J5) Palmieri 2012-09-28 17:39:49 UTC
Works for me with a few bug fixes applied from other bugs.  Going to punt it back to testing.

Comment 2 Wei Sun 2012-09-29 01:40:09 UTC
verified on fork_ami_US2597_US2599_US2813_US2817_US2872_186

Step:
1.create an application
2.add a cartridge to the app with -c option
rhc cartridge add -a $appname -c $cartridge_type

Result:

[sunwei@dhcp-8-229 dev]$ rhc cartridge add -a phptest -c mysql-5.1
Password: ******

Adding 'mysql-5.1' to application 'phptest'
Success

Useful mysql-5.1 properties
===========================
  username       = admin
  password       = 9W4kb6n5VB8f
  database_name  = phptest
  connection_url = mysql://127.0.250.129:3306/


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