Bug 836882

Summary: Show error message when create app in condition of user gear limited
Product: OKD Reporter: Rony Gong 🔥 <qgong>
Component: ocAssignee: N. Harrison Ripps <hripps>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 2.xCC: dmcphers, hripps, pruan, rmillner, xtian
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rhc-0.95.11-1+ Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-13 23:43:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rony Gong 🔥 2012-07-02 05:52:30 UTC
Description of problem:
user A max_gear is 3 and consumed 2 gears, then want create a scalable app, show error message.





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

How reproducible:
alaways



Steps to Reproduce:
1.
2.
3.
  
Actual results:
[rony@localhost mytest]$ rhc app create -a php -t php-5.3 -s
Password: 

Creating application: php in qgong
/usr/lib/ruby/gems/1.8/gems/rhc-0.95.5/lib/rhc-rest.rb:137:in `process_error_response': Failed to create application php due to: undefined local variable or method `create_result' for #<Gear:0x7f95adc08dd0> (Rhc::Rest::ServerErrorException)
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.95.5/lib/rhc-rest.rb:135:in `each'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.95.5/lib/rhc-rest.rb:135:in `process_error_response'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.95.5/lib/rhc-rest.rb:81:in `send'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.95.5/lib/rhc-rest/domain.rb:30:in `add_application'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.95.5/lib/rhc-common.rb:512:in `create_app'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.95.5/bin/rhc-app:227:in `create_app'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.95.5/bin/rhc-app:502
	from /usr/bin/rhc-app:19:in `load'
	from /usr/bin/rhc-app:19

Expected results:
show app limit message.


Additional info:

Comment 1 Rony Gong 🔥 2012-07-02 05:55:38 UTC
user A max_gear is 3 and consumed 2 gears, then want create a non-scalable app, could create success.

user A max_gear is 3 and consumed 3 gears, then want create a non-scalable/scalable app, could show: 

MESSAGES:
qgong has already reached the gear limit of 3

Comment 2 Peter Ruan 2012-07-03 19:23:00 UTC
similiar issue but different error message when I tried to create a scaleable app that pushed the limit over the edge.

[peter@unused-32-138 ~]$ rhc app create -a app3 -t php-5.3 -s -pvostok08 
Creating application: app3 in pppstage
/usr/lib/ruby/gems/1.8/gems/rhc-0.93.19/lib/rhc-rest.rb:134:in `raise': exception object expected (TypeError)
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.93.19/lib/rhc-rest.rb:134:in `process_error_response'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.93.19/lib/rhc-rest.rb:86:in `send'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.93.19/lib/rhc-rest/domain.rb:30:in `add_application'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.93.19/lib/rhc-common.rb:513:in `create_app'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.93.19/bin/rhc-app:227:in `create_app'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.93.19/bin/rhc-app:499
	from /usr/bin/rhc-app:19:in `load'
	from /usr/bin/rhc-app:19

Comment 3 N. Harrison Ripps 2012-07-11 20:17:05 UTC
Addressed problem with better handling of server errors. rhc now exits gracefully in this class of situation. Pull request submitted.

Comment 4 N. Harrison Ripps 2012-07-11 20:21:24 UTC
*** Bug 839325 has been marked as a duplicate of this bug. ***

Comment 5 Rony Gong 🔥 2012-07-12 06:23:12 UTC
Verified on devenv_stg_223
[root@localhost mytest]# rhc app create -a php -t php-5.3 -s
Password: 

Creating application: php in qgong1
Problem reported from server. Response code was 406.
Re-run with -d for more information.

MESSAGES:
qgong has already reached the gear limit of 3

[root@localhost mytest]# rhc app create -a php -t php-5.3 
Password: 

Creating application: php in qgong1
Problem reported from server. Response code was 400.
Re-run with -d for more information.

RESULT:
qgong has already reached the gear limit of 3