This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 902725 - rhc client still returns 0 when some commands fail
rhc client still returns 0 when some commands fail
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
2.x
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Clayton Coleman
libra bugs
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-22 05:44 EST by jizhao
Modified: 2015-05-14 22:12 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-03-15 10:17:51 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description jizhao 2013-01-22 05:44:01 EST
Description of problem:
Create 3 apps in order to reach the gear limit. Try to create the forth one, and it will fail, but client still returns 0.

Version-Release number of selected component (if applicable):
rhc 1.3.5
devenv_2706

How reproducible:
Always

Steps to Reproduce:
1.Create 3 apps
2.Try to create another app
3.Check the exit code of the command
$ echo $?
  
Actual results:
The exit code is still 0

Expected results:
The exit code shouldn't be 0

Additional info:
Comment 1 jizhao 2013-01-22 07:43:01 EST
rhc client also returns 0 for some other commands, like adding the phpmyadmin cartridge to an app which doesn't have mysql embedded; adding 10gen-mms-agent to an app which doesn't have mongodb embedded.
Comment 2 Clayton Coleman 2013-01-31 12:25:53 EST
This is working for me, please retest against 1.4.  I'll need exact commands and scenarios, and also please run with --trace and -d
Comment 3 jizhao 2013-02-01 01:03:38 EST
Version:
rhc 1.4.1

Steps to reproduce:
1.Create 3 apps in order to reach the gear limit
2.Try to create another app and check the exit code
$ rhc app create app4 python -p x -d
$ echo $?

Actual results:
The exit code of "rhc app create <app_name> <app_type> -d -p x" is 0, while "rhc app create <app_name> <app_type> -d --trace -p x" exits with 1. Below is the client output

root@ubuntu-0:~# rhc app create app4 python --trace -d -p x 
DEBUG: Connecting to https://ec2-50-19-202-32.compute-1.amazonaws.com/broker/rest/api
DEBUG: Getting all cartridges
DEBUG: SSL Verification failed -- Using self signed cert
DEBUG: Getting all cartridges
Using python-2.6 (Python 2.6) for 'python'
DEBUG: Getting all domains
DEBUG: SSL Verification failed -- Using self signed cert
DEBUG: Getting all domains
DEBUG: Finding domain jizhao1
DEBUG: Getting all domains

Application Options
-------------------
DEBUG: Getting all domains
  Namespace:  jizhao1
  Cartridges: python-2.6
  Gear Size:  default
  Scaling:    no

Creating application 'app4' ... DEBUG: Creating application 'app4' with these options - {:cartridges=>["python-2.6"]}
DEBUG: Adding application app4 to domain jizhao1
/var/lib/gems/1.8/gems/rhc-1.4.1/lib/rhc/rest/client.rb:425:in `handle_error!': jizhao+1@redhat.com has already reached the gear limit of 3 (RHC::Rest::ValidationException)
	from /var/lib/gems/1.8/gems/rhc-1.4.1/lib/rhc/rest/client.rb:59:in `request'
	from /var/lib/gems/1.8/gems/rhc-1.4.1/lib/rhc/rest/client.rb:49:in `each'
	from /var/lib/gems/1.8/gems/rhc-1.4.1/lib/rhc/rest/client.rb:49:in `request'
	from /var/lib/gems/1.8/gems/rhc-1.4.1/lib/rhc/rest/base.rb:25:in `rest_method'
	from /var/lib/gems/1.8/gems/rhc-1.4.1/lib/rhc/rest/domain.rb:20:in `add_application'
	from /var/lib/gems/1.8/gems/rhc-1.4.1/lib/rhc/commands/app.rb:359:in `create_app'
	from /var/lib/gems/1.8/gems/rhc-1.4.1/lib/rhc/commands/app.rb:84:in `create'
	from /var/lib/gems/1.8/gems/rhc-1.4.1/lib/rhc/helpers.rb:407:in `call'
	from /var/lib/gems/1.8/gems/rhc-1.4.1/lib/rhc/helpers.rb:407:in `section'
	from /var/lib/gems/1.8/gems/rhc-1.4.1/lib/rhc/helpers.rb:421:in `paragraph'
	from /var/lib/gems/1.8/gems/rhc-1.4.1/lib/rhc/commands/app.rb:79:in `create'
	from /var/lib/gems/1.8/gems/rhc-1.4.1/lib/rhc/commands.rb:201:in `send'
	from /var/lib/gems/1.8/gems/rhc-1.4.1/lib/rhc/commands.rb:201:in `execute'
	from /var/lib/gems/1.8/gems/rhc-1.4.1/lib/rhc/commands.rb:192:in `to_commander'
	from /var/lib/gems/1.8/gems/commander-4.1.2/lib/commander/command.rb:180:in `call'
	from /var/lib/gems/1.8/gems/commander-4.1.2/lib/commander/command.rb:180:in `call'
	from /var/lib/gems/1.8/gems/commander-4.1.2/lib/commander/command.rb:155:in `run'
	from /var/lib/gems/1.8/gems/commander-4.1.2/lib/commander/runner.rb:402:in `run_active_command'
	from /var/lib/gems/1.8/gems/rhc-1.4.1/lib/rhc/command_runner.rb:95:in `run!'
	from /var/lib/gems/1.8/gems/commander-4.1.2/lib/commander/delegates.rb:7:in `run!'
	from /var/lib/gems/1.8/gems/rhc-1.4.1/lib/rhc/cli.rb:42:in `start'
	from /var/lib/gems/1.8/gems/rhc-1.4.1/bin/rhc:18
	from /usr/local/bin/rhc:19:in `load'
	from /usr/local/bin/rhc:19


Expected result:
The exit code shouldn't be 0.
Comment 4 jizhao 2013-02-01 03:53:19 EST
Embedding phpmyadmin before embedding mysql, and embedding rockmongo before embedding mongodb also exit with 0.

Steps to reproduce:
1.Create an app
2.Try to embed phpmyadmin to it and check the exit code.
3.Try to embed rockmongo to it and check the exit code.

Actual results:
The exit code is 0.

Expected results:
The exit code shouldn't be 0.
Comment 5 jizhao 2013-02-01 05:55:15 EST
Create 2 apps with the same name also exits with 0.
Comment 6 Clayton Coleman 2013-02-05 11:05:34 EST
I still can't recreate this. App create at the limit returns exit code 128.  Embed phpmyadmin returns exit code 128.

[Feb 13 11:04 cc4 ~/code/rhc]$ bundle exec bin/rhc app create foo3 php-5.3 --no-dns
Application Options
-------------------
  Namespace:  aoeu98eu
  Cartridges: php-5.3
  Gear Size:  default
  Scaling:    no

Creating application 'foo3' ... test83798148@example.com has already reached the gear limit of 3
[Feb 13 11:04 cc4 ~/code/rhc]$ echo $?
128


What version of ubuntu are you on?
Comment 7 Peter Ruan 2013-02-15 18:07:47 EST
[peter@unused-16-138 <DEV> junk]# rhc app create app2 php-5.3 -pvostok08 -k
Application Options
-------------------
  Namespace:  ppp123
  Cartridges: php-5.3
  Gear Size:  default
  Scaling:    no

Creating application 'app2' ... pruan@redhat.com has already reached the gear limit of 3
[peter@unused-16-138 <DEV> junk]# echo $?
128

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